enh(sync): syncStartStandBy

This commit is contained in:
Minghao Li 2022-05-24 17:14:12 +08:00
parent 8f37bb2e56
commit 6cf9f50c3a
2 changed files with 6 additions and 1 deletions

View File

@ -81,6 +81,7 @@ typedef struct {
sem_t syncSem;
int64_t sync;
ESyncState state;
bool isStandBy;
} SSyncMgmt;
typedef struct {

View File

@ -182,7 +182,11 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw) {
void mndSyncStart(SMnode *pMnode) {
SSyncMgmt *pMgmt = &pMnode->syncMgmt;
syncSetMsgCb(pMgmt->sync, &pMnode->msgCb);
syncStart(pMgmt->sync);
if (pMgmt->isStandBy) {
syncStartStandBy(pMgmt->sync);
} else {
syncStart(pMgmt->sync);
}
mDebug("sync:%" PRId64 " is started", pMgmt->sync);
}