From 1ed7a4be11770db381de9ab0974bb63db5d08c53 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 26 May 2022 22:38:31 +0800 Subject: [PATCH] fix: msg redirect while mnode replica large than 0 --- source/libs/transport/src/transCli.c | 3 ++- tests/script/jenkins/basic.txt | 2 +- tests/script/tsim/mnode/basic2.sim | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index ba0da63dc1..0313ea5832 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -928,7 +928,8 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { */ tmsg_t msgType = pCtx->msgType; if ((pTransInst->retry != NULL && (pTransInst->retry(pResp->code))) || - (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL)) { + (pResp->code == TSDB_CODE_RPC_NETWORK_UNAVAIL || pResp->code == TSDB_CODE_APP_NOT_READY || + pResp->code == TSDB_CODE_NODE_NOT_DEPLOYED || pResp->code == TSDB_CODE_SYN_NOT_LEADER)) { pMsg->sent = 0; pMsg->st = taosGetTimestampUs(); pCtx->retryCount += 1; diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index cec52ee40f..623182fddf 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -56,7 +56,7 @@ # ---- mnode #./test.sh -f tsim/mnode/basic1.sim -#./test.sh -f tsim/mnode/basic2.sim +./test.sh -f tsim/mnode/basic2.sim # ---- show ./test.sh -f tsim/show/basic.sim diff --git a/tests/script/tsim/mnode/basic2.sim b/tests/script/tsim/mnode/basic2.sim index 66dee512eb..024e2b2406 100644 --- a/tests/script/tsim/mnode/basic2.sim +++ b/tests/script/tsim/mnode/basic2.sim @@ -40,7 +40,7 @@ print =============== create mnode 2 sql create mnode on dnode 2 $x = 0 -step1: +step2: $x = $x + 1 sleep 1000 if $x == 20 then @@ -63,7 +63,7 @@ if $data(2)[0] != 2 then return -1 endi if $data(2)[2] != FOLLOWER then - goto step1 + goto step2 endi print =============== create user @@ -103,17 +103,25 @@ if $rows != 3 then return -1 endi -sql show dnodes +$x = 0 +step3: + $x = $x + 1 + sleep 500 + if $x == 20 then + return -1 + endi +sql show dnodes -x step3 if $data(1)[4] != ready then - return -1 + goto step3 endi if $data(2)[4] != ready then - return -1 + goto step3 endi print =============== insert data -sql create table db.stb (ts timestamp, i int) tags (j int) -sql create table db.ctb using db.stb tags(1); +#sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd" +#sql create table db.ctb using db.stb tags(101, 102, "103") +#sql insert into db.ctb values(now, 1, "2") system sh/exec.sh -n dnode1 -s stop system sh/exec.sh -n dnode2 -s stop \ No newline at end of file