diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 020a1b36063fabc158642101bc7cac4de8c30a67..d3a81adca6dc8fa48dcbbff8d95960f43e0caa1d 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1436,7 +1436,7 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO return; } else { // reach the maximum retry count, abort atomic_val_compare_exchange_32(&pState->code, TSDB_CODE_SUCCESS, numOfRows); - tscError("%p sub:%p retrieve failed,code:%s,orderOfSub:%d failed.no more retry,set global code:%d", pPObj, pSql, + tscError("%p sub:%p retrieve failed,code:%d,orderOfSub:%d failed.no more retry,set global code:%d", pPObj, pSql, numOfRows, subqueryIndex, tstrerror(pState->code)); } } diff --git a/src/mnode/src/mgmtMain.c b/src/mnode/src/mgmtMain.c index 37edddec107904fbc3ef9c5de0fa476892a391a0..434552980fb22657cffcb79080b85473d6e5e574 100644 --- a/src/mnode/src/mgmtMain.c +++ b/src/mnode/src/mgmtMain.c @@ -55,11 +55,6 @@ int32_t mgmtStartSystem() { return -1; } - if (grantInit() < 0) { - mError("failed to init grant"); - return -1; - } - if (mgmtInitUsers() < 0) { mError("failed to init users"); return -1; @@ -99,6 +94,11 @@ int32_t mgmtStartSystem() { mError("failed to init balance") } + if (grantInit() < 0) { + mError("failed to init grant"); + return -1; + } + if (mgmtInitServer() < 0) { return -1; } @@ -132,19 +132,18 @@ int32_t mgmtInitSystem() { void mgmtCleanUpSystem() { mPrint("starting to clean up mgmt"); - grantCleanUp(); - mgmtCleanupMnodes(); - balanceCleanUp(); mgmtCleanUpShell(); mgmtCleanupServer(); - mgmtCleanUpAccts(); + grantCleanUp(); + balanceCleanUp(); + sdbCleanUp(); + mgmtCleanupMnodes(); mgmtCleanUpTables(); mgmtCleanUpVgroups(); mgmtCleanUpDbs(); mgmtCleanupDnodes(); mgmtCleanUpUsers(); - sdbCleanUp(); - taosTmrCleanUp(tsMgmtTmr); + mgmtCleanUpAccts(); tsMgmtIsRunning = false; mPrint("mgmt is cleaned up"); } diff --git a/src/mnode/src/mgmtShell.c b/src/mnode/src/mgmtShell.c index 3cb0225b970fa76ba307fa22e0180f93e0720fd9..c869e752d3e6f9f68fd4f7ed7502704254b4f649 100644 --- a/src/mnode/src/mgmtShell.c +++ b/src/mnode/src/mgmtShell.c @@ -66,21 +66,26 @@ int32_t mgmtInitShell() { tsMgmtTmr = taosTmrInit((tsMaxShellConns) * 3, 200, 3600000, "MND"); tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT"); - tsQhandleCache = taosCacheInit(tsMgmtTmr, 2); + tsQhandleCache = taosCacheInit(tsMgmtTmr, 10); return 0; } void mgmtCleanUpShell() { - if (tsMgmtTranQhandle) { - taosCleanUpScheduler(tsMgmtTranQhandle); - tsMgmtTranQhandle = NULL; + if (tsMgmtTmr != NULL){ + taosTmrCleanUp(tsMgmtTmr); + tsMgmtTmr = NULL; } - if (tsQhandleCache) { + if (tsQhandleCache != NULL) { taosCacheCleanup(tsQhandleCache); tsQhandleCache = NULL; } + + if (tsMgmtTranQhandle != NULL) { + taosCleanUpScheduler(tsMgmtTranQhandle); + tsMgmtTranQhandle = NULL; + } } void mgmtAddShellMsgHandle(uint8_t showType, void (*fp)(SQueuedMsg *queuedMsg)) { diff --git a/tests/examples/JDBC/springbootdemo/readme.md b/tests/examples/JDBC/springbootdemo/readme.md index 64aabedcdce5d16a610f4f2b084b8d62d54ff133..ac3bb44ef95c251e25c664cd50414494e19f6820 100644 --- a/tests/examples/JDBC/springbootdemo/readme.md +++ b/tests/examples/JDBC/springbootdemo/readme.md @@ -14,7 +14,7 @@ spring.datasource.druid.max-active=5 # max wait time for get connection, ms spring.datasource.druid.max-wait=60000 -spring.datasource.druid.validation-query=describe log.dn +spring.datasource.druid.validation-query=select server_status(); spring.datasource.druid.validation-query-timeout=5000 spring.datasource.druid.test-on-borrow=false spring.datasource.druid.test-on-return=false diff --git a/tests/examples/JDBC/springbootdemo/src/main/resources/application.properties b/tests/examples/JDBC/springbootdemo/src/main/resources/application.properties index dc77e144f0ffbe131f7eda69b7bb66fd7870c05e..926559a90c7ac4bdfbcc2cb0d086154ec0c9cd7f 100644 --- a/tests/examples/JDBC/springbootdemo/src/main/resources/application.properties +++ b/tests/examples/JDBC/springbootdemo/src/main/resources/application.properties @@ -10,7 +10,7 @@ spring.datasource.druid.max-active=5 # max wait time for get connection, ms spring.datasource.druid.max-wait=60000 -spring.datasource.druid.validation-query=describe log.dn +spring.datasource.druid.validation-query=select server_status(); spring.datasource.druid.validation-query-timeout=5000 spring.datasource.druid.test-on-borrow=false spring.datasource.druid.test-on-return=false @@ -23,4 +23,4 @@ spring.datasource.druid.max-evictable-idle-time-millis=900000 #mybatis mybatis.mapper-locations=classpath:mapper/*.xml -logging.level.com.taosdata.jdbc.springbootdemo.dao=debug \ No newline at end of file +logging.level.com.taosdata.jdbc.springbootdemo.dao=debug diff --git a/tests/script/unique/db/replica_add12.sim b/tests/script/unique/db/replica_add12.sim index 5d1ec794509537e0bc4f428492d3bb68744e177a..b0de807fca7d1b293918092606a5a0730c790556 100644 --- a/tests/script/unique/db/replica_add12.sim +++ b/tests/script/unique/db/replica_add12.sim @@ -73,9 +73,9 @@ endi sleep 2000 sql show dnodes -print dnode1 ==> openVnodes: $data3_1 -print dnode2 ==> openVnodes: $data3_2 -print dnode3 ==> openVnodes: $data3_3 +print dnode1 ==> openVnodes: $data2_1 +print dnode2 ==> openVnodes: $data2_2 +print dnode3 ==> openVnodes: $data2_3 if $data2_1 != 0 then return -1 @@ -99,9 +99,9 @@ sleep 10000 print ======== step3 sql show dnodes -print dnode1 ==> openVnodes: $data3_1 -print dnode2 ==> openVnodes: $data3_2 -print dnode3 ==> openVnodes: $data3_3 +print dnode1 ==> openVnodes: $data2_1 +print dnode2 ==> openVnodes: $data2_2 +print dnode3 ==> openVnodes: $data2_3 if $data2_1 != 0 then return -1 diff --git a/tests/script/unique/mnode/mgmt22.sim b/tests/script/unique/mnode/mgmt22.sim index ae3c386122102fa13ccc75de90ee90709ccbadc7..50692524cf65d121cad8f23dce3e707050520c8d 100644 --- a/tests/script/unique/mnode/mgmt22.sim +++ b/tests/script/unique/mnode/mgmt22.sim @@ -8,7 +8,8 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2 system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2 print ============== step1 -system sh/exec_up.sh -n dnode1 -s start +system sh/exec_up.sh -n dnode1 -s start -t +sleep 3000 sql connect sql show mnodes @@ -19,7 +20,7 @@ if $data2_1 != master then endi print ============== step2 -system sh/exec_up.sh -n dnode2 -s start +system sh/exec_up.sh -n dnode2 -s start -t sql create dnode $hostname2 $x = 0 @@ -44,8 +45,12 @@ print ============== step3 sql_error drop dnode $hostname1 -x error1 print should not drop master +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +return + print ============== step4 -system sh/exec_up.sh -n dnode1 -s stop +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT sql_error show mnodes print error of no master @@ -78,7 +83,7 @@ if $data2_2 != slave then endi print ============== step7 -system sh/exec_up.sh -n dnode3 -s start +system sh/exec_up.sh -n dnode3 -s start -t sql create dnode $hostname3 sleep 5000