Merge pull request #13046 from taosdata/fix/dnode

fix: msg redirect while mnode replica large than 0
This commit is contained in:
Shengliang Guan 2022-05-26 23:10:10 +08:00 committed by GitHub
commit 2aa83680ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View File

@ -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;

View File

@ -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

View File

@ -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