提交 fee4b875 编写于 作者: D dmchen

error code

上级 e020c4e8
......@@ -272,7 +272,7 @@ SSyncState syncGetState(int64_t rid);
void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet);
const char* syncStr(ESyncState state);
SSyncCfg syncNodeGetConfig(int64_t rid);
int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg);
#ifdef __cplusplus
}
......
......@@ -288,7 +288,7 @@ static int32_t vnodePrepareCommit(SVnode *pVnode, SCommitInfo *pInfo) {
tsem_wait(&pVnode->canCommit);
pVnode->config.syncCfg = syncNodeGetConfig(pVnode->sync);
if(syncNodeGetConfig(pVnode->sync, &pVnode->config.syncCfg) != 0) goto _exit;
pVnode->state.commitTerm = pVnode->state.applyTerm;
......
......@@ -106,20 +106,19 @@ _err:
return -1;
}
SSyncCfg syncNodeGetConfig(int64_t rid){
int32_t syncNodeGetConfig(int64_t rid, SSyncCfg *cfg){
SSyncNode* pSyncNode = syncNodeAcquire(rid);
SSyncCfg cfg = {0};
if (pSyncNode == NULL) {
sError("failed to acquire rid:%" PRId64 " of tsNodeReftId for pSyncNode", rid);
return cfg;
return -1;
}
cfg = pSyncNode->raftCfg.cfg;
*cfg = pSyncNode->raftCfg.cfg;
syncNodeRelease(pSyncNode);
return cfg;
return 0;
}
void syncStop(int64_t rid) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册