fix: donot retry if error code not match retry code
This commit is contained in:
parent
ed7e614a15
commit
8f6aaf0a60
|
@ -1308,11 +1308,11 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans) {
|
||||||
if (pTrans->policy == TRN_POLICY_ROLLBACK) {
|
if (pTrans->policy == TRN_POLICY_ROLLBACK) {
|
||||||
if (pTrans->lastAction != 0) {
|
if (pTrans->lastAction != 0) {
|
||||||
STransAction *pAction = taosArrayGet(pTrans->redoActions, pTrans->lastAction);
|
STransAction *pAction = taosArrayGet(pTrans->redoActions, pTrans->lastAction);
|
||||||
if (pAction->retryCode != 0 && pAction->retryCode != pAction->errCode) {
|
if (pAction->retryCode != 0 && pAction->retryCode == pAction->errCode) {
|
||||||
if (pTrans->failedTimes < 6) {
|
if (pTrans->failedTimes < 6) {
|
||||||
mError("trans:%d, stage keep on redoAction since action:%d code:0x%x not 0x%x, failedTimes:%d", pTrans->id,
|
mError("trans:%d, stage keep on redoAction since action:%d code:0x%x not 0x%x, failedTimes:%d", pTrans->id,
|
||||||
pTrans->lastAction, pTrans->code, pAction->retryCode, pTrans->failedTimes);
|
pTrans->lastAction, pTrans->code, pAction->retryCode, pTrans->failedTimes);
|
||||||
taosMsleep(100);
|
taosMsleep(1000);
|
||||||
continueExec = true;
|
continueExec = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print =============== conflict stb
|
print =============== conflict stb
|
||||||
sql create database db vgroups 1;
|
sql create database db vgroups 4;
|
||||||
sql use db;
|
sql use db;
|
||||||
sql create table stb (ts timestamp, i int) tags (j int);
|
sql create table stb (ts timestamp, i int) tags (j int);
|
||||||
sql_error create table stb using stb tags (1);
|
sql_error create table stb using stb tags (1);
|
||||||
|
@ -16,6 +16,9 @@ sql_error create table ctb (ts timestamp, i int) tags (j int);
|
||||||
sql create table ntb (ts timestamp, i int);
|
sql create table ntb (ts timestamp, i int);
|
||||||
sql_error create table ntb (ts timestamp, i int) tags (j int);
|
sql_error create table ntb (ts timestamp, i int) tags (j int);
|
||||||
|
|
||||||
|
sql drop table ntb
|
||||||
|
sql create table ntb (ts timestamp, i int) tags (j int);
|
||||||
|
|
||||||
sql drop database db
|
sql drop database db
|
||||||
|
|
||||||
print =============== create database d1
|
print =============== create database d1
|
||||||
|
|
Loading…
Reference in New Issue