diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index d81347d2f2590e69d13cb9ad301b3ca01a54bf5c..42b9c024c96918609408aaf4dd42ad55217623ae 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -119,6 +119,8 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { if (code != TSDB_CODE_SUCCESS) { pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; return code; } @@ -126,6 +128,8 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { if (code != TSDB_CODE_SUCCESS) { pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; return code; } @@ -133,12 +137,16 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { if (code != TSDB_CODE_SUCCESS) { pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; return code; } bool tsdbCfgChanged = (memcmp(&tsdbCfg, &pVnode->tsdbCfg, sizeof(STsdbCfg)) != 0); bool syncCfgChanged = (memcmp(&syncCfg, &pVnode->syncCfg, sizeof(SSyncCfg)) != 0); + vDebug("vgId:%d, tsdbchanged:%d syncchanged:%d while alter vnode", pVnode->vgId, tsdbCfgChanged, syncCfgChanged); + if (tsdbCfgChanged || syncCfgChanged) { // vnode in non-ready state and still needs to return success instead of TSDB_CODE_VND_INVALID_STATUS // dbCfgVersion can be corrected by status msg @@ -146,6 +154,8 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { vDebug("vgId:%d, vnode is not ready, do alter operation later", pVnode->vgId); pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; return TSDB_CODE_SUCCESS; } @@ -153,6 +163,8 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { if (code != TSDB_CODE_SUCCESS) { pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; vnodeSetReadyStatus(pVnode); return code; } @@ -162,6 +174,8 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { if (code != TSDB_CODE_SUCCESS) { pVnode->dbCfgVersion = dbCfgVersion; pVnode->vgCfgVersion = vgCfgVersion; + pVnode->syncCfg = syncCfg; + pVnode->tsdbCfg = tsdbCfg; vnodeSetReadyStatus(pVnode); return code; }