[TD-3178]<feature> add compact-status in vgroup
This commit is contained in:
parent
55b8eb778f
commit
27e9b11889
|
@ -539,7 +539,7 @@ typedef struct {
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
uint8_t role;
|
uint8_t role;
|
||||||
uint8_t replica;
|
uint8_t replica;
|
||||||
uint8_t reserved;
|
uint8_t compact;
|
||||||
} SVnodeLoad;
|
} SVnodeLoad;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -145,6 +145,7 @@ typedef struct SVgObj {
|
||||||
int8_t reserved0[4];
|
int8_t reserved0[4];
|
||||||
SVnodeGid vnodeGid[TSDB_MAX_REPLICA];
|
SVnodeGid vnodeGid[TSDB_MAX_REPLICA];
|
||||||
int32_t vgCfgVersion;
|
int32_t vgCfgVersion;
|
||||||
|
int8_t compact;
|
||||||
int8_t reserved1[8];
|
int8_t reserved1[8];
|
||||||
int8_t updateEnd[4];
|
int8_t updateEnd[4];
|
||||||
int32_t refCount;
|
int32_t refCount;
|
||||||
|
|
|
@ -354,6 +354,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
|
||||||
pVgroup->pDb->dbCfgVersion, pVgroup->vgCfgVersion, pVgroup->numOfVnodes);
|
pVgroup->pDb->dbCfgVersion, pVgroup->vgCfgVersion, pVgroup->numOfVnodes);
|
||||||
mnodeSendAlterVgroupMsg(pVgroup);
|
mnodeSendAlterVgroupMsg(pVgroup);
|
||||||
}
|
}
|
||||||
|
pVgroup->compact = pVload->compact;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) {
|
static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) {
|
||||||
|
@ -721,6 +722,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
|
||||||
cols++;
|
cols++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pShow->bytes[cols] = 4;
|
||||||
|
pSchema[cols].type = TSDB_DATA_TYPE_INT;
|
||||||
|
strcpy(pSchema[cols].name, "compacting");
|
||||||
|
pSchema[cols].bytes = htons(pShow->bytes[cols]);
|
||||||
|
cols++;
|
||||||
|
|
||||||
|
|
||||||
pMeta->numOfColumns = htons(cols);
|
pMeta->numOfColumns = htons(cols);
|
||||||
pShow->numOfColumns = cols;
|
pShow->numOfColumns = cols;
|
||||||
|
|
||||||
|
@ -824,7 +832,11 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
|
||||||
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, role, pShow->bytes[cols]);
|
STR_WITH_MAXSIZE_TO_VARSTR(pWrite, role, pShow->bytes[cols]);
|
||||||
cols++;
|
cols++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
|
*(int8_t *)pWrite = pVgroup->compact;
|
||||||
|
cols++;
|
||||||
|
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
numOfRows++;
|
numOfRows++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) {
|
||||||
pLoad->status = pVnode->status;
|
pLoad->status = pVnode->status;
|
||||||
pLoad->role = pVnode->role;
|
pLoad->role = pVnode->role;
|
||||||
pLoad->replica = pVnode->syncCfg.replica;
|
pLoad->replica = pVnode->syncCfg.replica;
|
||||||
|
pLoad->compact = 1;//pVnode->compact;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) {
|
int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) {
|
||||||
|
|
Loading…
Reference in New Issue