提交 b7e4b7ee 编写于 作者: guanshengliang's avatar guanshengliang

invalid read while sync

上级 478b1a07
...@@ -55,11 +55,6 @@ int32_t mgmtStartSystem() { ...@@ -55,11 +55,6 @@ int32_t mgmtStartSystem() {
return -1; return -1;
} }
if (grantInit() < 0) {
mError("failed to init grant");
return -1;
}
if (mgmtInitUsers() < 0) { if (mgmtInitUsers() < 0) {
mError("failed to init users"); mError("failed to init users");
return -1; return -1;
...@@ -99,6 +94,11 @@ int32_t mgmtStartSystem() { ...@@ -99,6 +94,11 @@ int32_t mgmtStartSystem() {
mError("failed to init balance") mError("failed to init balance")
} }
if (grantInit() < 0) {
mError("failed to init grant");
return -1;
}
if (mgmtInitServer() < 0) { if (mgmtInitServer() < 0) {
return -1; return -1;
} }
...@@ -132,19 +132,18 @@ int32_t mgmtInitSystem() { ...@@ -132,19 +132,18 @@ int32_t mgmtInitSystem() {
void mgmtCleanUpSystem() { void mgmtCleanUpSystem() {
mPrint("starting to clean up mgmt"); mPrint("starting to clean up mgmt");
grantCleanUp();
mgmtCleanupMnodes();
balanceCleanUp();
mgmtCleanUpShell(); mgmtCleanUpShell();
mgmtCleanupServer(); mgmtCleanupServer();
mgmtCleanUpAccts(); grantCleanUp();
balanceCleanUp();
sdbCleanUp();
mgmtCleanupMnodes();
mgmtCleanUpTables(); mgmtCleanUpTables();
mgmtCleanUpVgroups(); mgmtCleanUpVgroups();
mgmtCleanUpDbs(); mgmtCleanUpDbs();
mgmtCleanupDnodes(); mgmtCleanupDnodes();
mgmtCleanUpUsers(); mgmtCleanUpUsers();
sdbCleanUp(); mgmtCleanUpAccts();
taosTmrCleanUp(tsMgmtTmr);
tsMgmtIsRunning = false; tsMgmtIsRunning = false;
mPrint("mgmt is cleaned up"); mPrint("mgmt is cleaned up");
} }
......
...@@ -66,21 +66,26 @@ int32_t mgmtInitShell() { ...@@ -66,21 +66,26 @@ int32_t mgmtInitShell() {
tsMgmtTmr = taosTmrInit((tsMaxShellConns) * 3, 200, 3600000, "MND"); tsMgmtTmr = taosTmrInit((tsMaxShellConns) * 3, 200, 3600000, "MND");
tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT"); tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT");
tsQhandleCache = taosCacheInit(tsMgmtTmr, 2); tsQhandleCache = taosCacheInit(tsMgmtTmr, 10);
return 0; return 0;
} }
void mgmtCleanUpShell() { void mgmtCleanUpShell() {
if (tsMgmtTranQhandle) { if (tsMgmtTmr != NULL){
taosCleanUpScheduler(tsMgmtTranQhandle); taosTmrCleanUp(tsMgmtTmr);
tsMgmtTranQhandle = NULL; tsMgmtTmr = NULL;
} }
if (tsQhandleCache) { if (tsQhandleCache != NULL) {
taosCacheCleanup(tsQhandleCache); taosCacheCleanup(tsQhandleCache);
tsQhandleCache = NULL; tsQhandleCache = NULL;
} }
if (tsMgmtTranQhandle != NULL) {
taosCleanUpScheduler(tsMgmtTranQhandle);
tsMgmtTranQhandle = NULL;
}
} }
void mgmtAddShellMsgHandle(uint8_t showType, void (*fp)(SQueuedMsg *queuedMsg)) { void mgmtAddShellMsgHandle(uint8_t showType, void (*fp)(SQueuedMsg *queuedMsg)) {
......
...@@ -8,7 +8,8 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2 ...@@ -8,7 +8,8 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2 system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
print ============== step1 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 connect
sql show mnodes sql show mnodes
...@@ -19,7 +20,7 @@ if $data2_1 != master then ...@@ -19,7 +20,7 @@ if $data2_1 != master then
endi endi
print ============== step2 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 sql create dnode $hostname2
$x = 0 $x = 0
...@@ -44,8 +45,12 @@ print ============== step3 ...@@ -44,8 +45,12 @@ print ============== step3
sql_error drop dnode $hostname1 -x error1 sql_error drop dnode $hostname1 -x error1
print should not drop master 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 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 sql_error show mnodes
print error of no master print error of no master
...@@ -78,7 +83,7 @@ if $data2_2 != slave then ...@@ -78,7 +83,7 @@ if $data2_2 != slave then
endi endi
print ============== step7 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 sql create dnode $hostname3
sleep 5000 sleep 5000
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册