!102 【轻量级 PR】:灾备集群不走双主双重启逻辑
Merge pull request !102 from zhouwenbin_db/N/A
This commit is contained in:
commit
d86cf089c2
@ -405,6 +405,14 @@ static void GetDnStaticRoleFromDdb(const DnArbCtx *ctx)
|
||||
} else {
|
||||
GetDatanodeDynamicConfigChangeFromDdb(ctx->groupIdx);
|
||||
}
|
||||
if (g_needIncTermToDdbAgain) {
|
||||
(void)pthread_rwlock_wrlock(&term_update_rwlock);
|
||||
/* Prevent multiple worker threads from increasing term at the same time. */
|
||||
if (g_needIncTermToDdbAgain) {
|
||||
(void)IncrementTermToDdb();
|
||||
}
|
||||
(void)pthread_rwlock_unlock(&term_update_rwlock);
|
||||
}
|
||||
}
|
||||
|
||||
static void ResetHeartbeat(const DnArbCtx *ctx)
|
||||
@ -1463,7 +1471,9 @@ static bool MoreDyPrimary(DnArbCtx *ctx, const char *typeName)
|
||||
if (ctx->cond.igPrimaryCount >= 1 && ctx->instId != ctx->repGroup->lastFailoverDn) {
|
||||
SendRestartMsg(ctx, typeName);
|
||||
write_runlog(LOG, "Dynamic primary %u is not last failover dn, restart to cascade_standby.\n", ctx->instId);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* restart dn instance */
|
||||
|
Loading…
x
Reference in New Issue
Block a user