diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index a4cee6d3948cf76c7cf345424d7cd04c14bc316c..f5ce25cce0c11b68533a4d7a9e94aab5105b1439 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -539,7 +539,7 @@ typedef struct { uint8_t status; uint8_t role; uint8_t replica; - uint8_t reserved; + uint8_t compact; } SVnodeLoad; typedef struct { diff --git a/src/mnode/inc/mnodeDef.h b/src/mnode/inc/mnodeDef.h index e052f34a33b2a74dcd858721694225859f1581b8..f170f58b538dbbabfad9cdfedfc469339a6e3251 100644 --- a/src/mnode/inc/mnodeDef.h +++ b/src/mnode/inc/mnodeDef.h @@ -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; diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index b422934521a44c3f7e7a68f5df6110a39d592fb5..711381374677ba101412f0149a6c45d2454c9f6a 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -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++; } diff --git a/src/vnode/src/vnodeMgmt.c b/src/vnode/src/vnodeMgmt.c index 32f95321383981924c5b6496bd4302edca19da5e..aabc1dba9d43d5793c219419734be9487f248b40 100644 --- a/src/vnode/src/vnodeMgmt.c +++ b/src/vnode/src/vnodeMgmt.c @@ -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) {