refactor(sync): set ranmdom seed by ns
This commit is contained in:
parent
057c502815
commit
50e3527f2b
|
@ -35,8 +35,9 @@ bool syncEnvIsStart() {
|
|||
}
|
||||
|
||||
int32_t syncEnvStart() {
|
||||
int32_t ret = 0;
|
||||
taosSeedRand(taosGetTimestampSec());
|
||||
int32_t ret = 0;
|
||||
uint32_t seed = (uint32_t)(taosGetTimestampNs() & 0x00000000FFFFFFFF);
|
||||
taosSeedRand(seed);
|
||||
// gSyncEnv = doSyncEnvStart(gSyncEnv);
|
||||
gSyncEnv = doSyncEnvStart();
|
||||
assert(gSyncEnv != NULL);
|
||||
|
|
|
@ -2290,7 +2290,7 @@ static int32_t syncNodeConfigChangeFinish(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyn
|
|||
ths->pFsm->FpReConfigCb(ths->pFsm, pRpcMsg, cbMeta);
|
||||
}
|
||||
|
||||
// update changing
|
||||
// clear changing
|
||||
ths->changing = false;
|
||||
|
||||
char tmpbuf[512];
|
||||
|
@ -2309,6 +2309,9 @@ static int32_t syncNodeConfigChangeFinish(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyn
|
|||
|
||||
static int32_t syncNodeConfigChange(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftEntry* pEntry,
|
||||
SyncReconfigFinish* pFinish) {
|
||||
// set changing
|
||||
ths->changing = true;
|
||||
|
||||
// old config
|
||||
SSyncCfg oldSyncCfg = ths->pRaftCfg->cfg;
|
||||
|
||||
|
|
Loading…
Reference in New Issue