fix/TD-31542-fix-case

This commit is contained in:
dmchen 2024-08-26 06:51:09 +00:00
parent e4a4832bb9
commit 7322f68240
2 changed files with 7 additions and 6 deletions

View File

@ -730,7 +730,7 @@ SyncIndex syncNodeGetSnapshotConfigIndex(SSyncNode* pSyncNode, SyncIndex snapsho
sError("vgId:%d, failed get snapshot config index, configIndexCount:%d", pSyncNode->vgId, sError("vgId:%d, failed get snapshot config index, configIndexCount:%d", pSyncNode->vgId,
pSyncNode->raftCfg.configIndexCount); pSyncNode->raftCfg.configIndexCount);
terrno = TSDB_CODE_SYN_INTERNAL_ERROR; terrno = TSDB_CODE_SYN_INTERNAL_ERROR;
return -1; return -2;
} }
SyncIndex lastIndex = (pSyncNode->raftCfg.configIndexArr)[0]; SyncIndex lastIndex = (pSyncNode->raftCfg.configIndexArr)[0];

View File

@ -611,17 +611,18 @@ int32_t syncFsmExecute(SSyncNode* pNode, SSyncFSM* pFsm, ESyncState role, SyncTe
int32_t code = 0, lino = 0; int32_t code = 0, lino = 0;
bool retry = false; bool retry = false;
do { do {
SRpcMsg rpcMsg = {.code = applyCode};
TAOS_CHECK_EXIT(syncEntry2OriginalRpc(pEntry, &rpcMsg));
SFsmCbMeta cbMeta = {0}; SFsmCbMeta cbMeta = {0};
cbMeta.index = pEntry->index;
cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(pNode, pEntry->index); cbMeta.lastConfigIndex = syncNodeGetSnapshotConfigIndex(pNode, pEntry->index);
if (cbMeta.lastConfigIndex < 0) { if (cbMeta.lastConfigIndex < -1) {
code = TSDB_CODE_SYN_INTERNAL_ERROR; code = TSDB_CODE_SYN_INTERNAL_ERROR;
if (terrno != 0) code = terrno; if (terrno != 0) code = terrno;
return code; return code;
} }
SRpcMsg rpcMsg = {.code = applyCode};
TAOS_CHECK_EXIT(syncEntry2OriginalRpc(pEntry, &rpcMsg));
cbMeta.index = pEntry->index;
cbMeta.isWeak = pEntry->isWeak; cbMeta.isWeak = pEntry->isWeak;
cbMeta.code = applyCode; cbMeta.code = applyCode;
cbMeta.state = role; cbMeta.state = role;