sync refactor

This commit is contained in:
Minghao Li 2022-03-21 20:06:57 +08:00
parent 48aace92c5
commit 3139aaef05
3 changed files with 9 additions and 8 deletions

View File

@ -120,6 +120,7 @@ int main(int argc, char** argv) {
"elect sleep, state: %d, %s, term:%lu electTimerLogicClock:%lu, electTimerLogicClockUser:%lu, electTimerMS:%d",
gSyncNode->state, syncUtilState2String(gSyncNode->state), gSyncNode->pRaftStore->currentTerm,
gSyncNode->electTimerLogicClock, gSyncNode->electTimerLogicClockUser, gSyncNode->electTimerMS);
taosMsleep(1000);
}
return 0;

View File

@ -33,7 +33,7 @@ int64_t syncNodeInit() {
syncInfo.queue = gSyncIO->pMsgQ;
syncInfo.FpEqMsg = syncIOEqMsg;
syncInfo.pFsm = pFsm;
snprintf(syncInfo.path, sizeof(syncInfo.path), "./elect_test_%d", myIndex);
snprintf(syncInfo.path, sizeof(syncInfo.path), "./elect2_test_%d", myIndex);
int code = walInit();
assert(code == 0);
@ -48,7 +48,7 @@ int64_t syncNodeInit() {
walCfg.level = TAOS_WAL_FSYNC;
char tmpdir[128];
snprintf(tmpdir, sizeof(tmpdir), "./elect_test_wal_%d", myIndex);
snprintf(tmpdir, sizeof(tmpdir), "./elect2_test_wal_%d", myIndex);
pWal = walOpen(tmpdir, &walCfg);
assert(pWal != NULL);
@ -64,7 +64,6 @@ int64_t syncNodeInit() {
// taosGetFqdn(pCfg->nodeInfo[0].nodeFqdn);
}
int64_t rid = syncStart(&syncInfo);
assert(rid > 0);
@ -127,6 +126,7 @@ int main(int argc, char** argv) {
"elect sleep, state: %d, %s, term:%lu electTimerLogicClock:%lu, electTimerLogicClockUser:%lu, electTimerMS:%d",
pSyncNode->state, syncUtilState2String(pSyncNode->state), pSyncNode->pRaftStore->currentTerm,
pSyncNode->electTimerLogicClock, pSyncNode->electTimerLogicClockUser, pSyncNode->electTimerMS);
taosMsleep(1000);
}
syncNodeRelease(pSyncNode);