From 335b56ed81a8e16758fc21b3909f534241bb163b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 27 May 2022 21:26:04 +0800 Subject: [PATCH] fix: set standby while create mnode --- source/dnode/mnode/impl/src/mndSync.c | 7 +------ tests/script/tsim/mnode/basic1.sim | 9 +++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index d5fcf9b1eb..b53b3003c1 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -219,17 +219,12 @@ void mndSyncStart(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; syncSetMsgCb(pMgmt->sync, &pMnode->msgCb); - syncStart(pMgmt->sync); - -#if 0 if (pMgmt->standby) { syncStartStandBy(pMgmt->sync); } else { syncStart(pMgmt->sync); } -#endif - - mDebug("sync:%" PRId64 " is started", pMgmt->sync); + mDebug("sync:%" PRId64 " is started, standby:%d", pMgmt->sync, pMgmt->standby); } void mndSyncStop(SMnode *pMnode) {} diff --git a/tests/script/tsim/mnode/basic1.sim b/tests/script/tsim/mnode/basic1.sim index 9131237ca6..e922ebe376 100644 --- a/tests/script/tsim/mnode/basic1.sim +++ b/tests/script/tsim/mnode/basic1.sim @@ -36,13 +36,14 @@ if $data(2)[4] != ready then goto step1 endi -print =============== create drop mnode 1 sql_error create mnode on dnode 1 sql_error drop mnode on dnode 1 + +print =============== create mnode 2 sql create mnode on dnode 2 $x = 0 -step1: +step2: $x = $x + 1 sleep 1000 if $x == 20 then @@ -65,11 +66,11 @@ if $data(2)[0] != 2 then return -1 endi if $data(2)[2] != FOLLOWER then - goto step1 + goto step2 endi sleep 2000 -print ============ drop mnodes +print ============ drop mnode 2 sql drop mnode on dnode 2 sql show mnodes if $rows != 1 then -- GitLab