refactor: modify syncNodeAppendEntriesPeersSnapshot
This commit is contained in:
parent
78db753a64
commit
80c4e77b0b
|
@ -144,6 +144,14 @@ int32_t syncNodeAppendEntriesPeersSnapshot(SSyncNode* pSyncNode) {
|
|||
sInfo("nextIndex:%ld in snapshot: <lastApplyIndex:%ld, lastApplyTerm:%lu>, begin snapshot", nextIndex,
|
||||
snapshot.lastApplyIndex, snapshot.lastApplyTerm);
|
||||
|
||||
SyncIndex lastIndex;
|
||||
SyncTerm lastTerm;
|
||||
ret = syncNodeGetLastIndexTerm(pSyncNode, &lastIndex, &lastTerm);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
ret = syncNodeGetPreIndexTerm(pSyncNode, lastIndex + 1, &preLogIndex, &preLogTerm);
|
||||
ASSERT(ret == 0);
|
||||
|
||||
// to claim leader
|
||||
SyncAppendEntries* pMsg = syncAppendEntriesBuild(0, pSyncNode->vgId);
|
||||
assert(pMsg != NULL);
|
||||
|
|
Loading…
Reference in New Issue