refactor(sync): add pre-commit interface

This commit is contained in:
Minghao Li 2022-07-26 19:12:13 +08:00
parent 9a540919b9
commit 166331c377
1 changed files with 3 additions and 7 deletions

View File

@ -2501,19 +2501,15 @@ int32_t syncNodeOnClientRequestCb(SSyncNode* ths, SyncClientRequest* pMsg, SyncI
// if mulit replica, start replicate right now
if (ths->replicaNum > 1) {
syncNodeReplicate(ths);
}
// pre commit
syncNodePreCommit(ths, pEntry, 0);
}
// if only myself, maybe commit right now
if (ths->replicaNum == 1) {
syncMaybeAdvanceCommitIndex(ths);
}
} else {
// pre commit
syncNodePreCommit(ths, pEntry, 0);
}
if (pRetIndex != NULL) {