提交 27e9b118 编写于 作者: Y yihaoDeng

[TD-3178]<feature> add compact-status in vgroup

上级 55b8eb77
......@@ -539,7 +539,7 @@ typedef struct {
uint8_t status;
uint8_t role;
uint8_t replica;
uint8_t reserved;
uint8_t compact;
} SVnodeLoad;
typedef struct {
......
......@@ -145,6 +145,7 @@ typedef struct SVgObj {
int8_t reserved0[4];
SVnodeGid vnodeGid[TSDB_MAX_REPLICA];
int32_t vgCfgVersion;
int8_t compact;
int8_t reserved1[8];
int8_t updateEnd[4];
int32_t refCount;
......
......@@ -354,6 +354,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl
pVgroup->pDb->dbCfgVersion, pVgroup->vgCfgVersion, pVgroup->numOfVnodes);
mnodeSendAlterVgroupMsg(pVgroup);
}
pVgroup->compact = pVload->compact;
}
static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) {
......@@ -721,6 +722,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
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);
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]);
cols++;
}
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
*(int8_t *)pWrite = pVgroup->compact;
cols++;
mnodeDecVgroupRef(pVgroup);
numOfRows++;
}
......
......@@ -148,6 +148,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) {
pLoad->status = pVnode->status;
pLoad->role = pVnode->role;
pLoad->replica = pVnode->syncCfg.replica;
pLoad->compact = 1;//pVnode->compact;
}
int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册