Merge pull request #17830 from taosdata/fix/TD-20095
fix: add dnode status log
This commit is contained in:
commit
801ae02d0a
|
@ -403,6 +403,10 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
|
||||||
bool reboot = (pDnode->rebootTime != statusReq.rebootTime);
|
bool reboot = (pDnode->rebootTime != statusReq.rebootTime);
|
||||||
bool needCheck = !online || dnodeChanged || reboot;
|
bool needCheck = !online || dnodeChanged || reboot;
|
||||||
|
|
||||||
|
pDnode->accessTimes++;
|
||||||
|
mTrace("dnode:%d, status received, access times:%d check:%d online:%d reboot:%d changed:%d", pDnode->id,
|
||||||
|
pDnode->accessTimes, needCheck, online, reboot, dnodeChanged);
|
||||||
|
|
||||||
if (needCheck) {
|
if (needCheck) {
|
||||||
if (statusReq.sver != tsVersion) {
|
if (statusReq.sver != tsVersion) {
|
||||||
if (pDnode != NULL) {
|
if (pDnode != NULL) {
|
||||||
|
@ -424,9 +428,6 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
|
||||||
pMnode->clusterId);
|
pMnode->clusterId);
|
||||||
terrno = TSDB_CODE_MND_INVALID_CLUSTER_ID;
|
terrno = TSDB_CODE_MND_INVALID_CLUSTER_ID;
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
} else {
|
|
||||||
pDnode->accessTimes++;
|
|
||||||
mDebug("dnode:%d, status received, access times %d", pDnode->id, pDnode->accessTimes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,74 +45,9 @@ if $data(4)[4] != ready then
|
||||||
goto step1
|
goto step1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
print =============== step2: create database
|
print =============== step2: create database
|
||||||
sql create database db vgroups 1 replica 3
|
sql create database db vgroups 33 replica 3
|
||||||
sql select * from information_schema.ins_databases
|
|
||||||
if $rows != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(db)[4] != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select * from information_schema.ins_dnodes
|
|
||||||
if $data(2)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(3)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(4)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
# vnodes
|
|
||||||
sql select * from information_schema.ins_dnodes
|
|
||||||
if $data(2)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(3)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(4)[2] != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
# v1_dnode
|
|
||||||
$hasleader = 0
|
|
||||||
$x = 0
|
|
||||||
step2:
|
|
||||||
$x = $x + 1
|
|
||||||
sleep 1000
|
|
||||||
if $x == 20 then
|
|
||||||
print ====> dnode not ready!
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
sql show db.vgroups
|
|
||||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08
|
|
||||||
if $data(2)[3] != 2 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(2)[5] != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(2)[7] != 4 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data(2)[4] == leader then
|
|
||||||
$hasleader = 1
|
|
||||||
endi
|
|
||||||
if $data(2)[6] == leader then
|
|
||||||
$hasleader = 1
|
|
||||||
endi
|
|
||||||
if $data(2)[8] == leader then
|
|
||||||
$hasleader = 1
|
|
||||||
endi
|
|
||||||
if $hasleader != 1 then
|
|
||||||
goto step2
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql use db;
|
sql use db;
|
||||||
sql create table stb (ts timestamp, c int) tags (t int);
|
sql create table stb (ts timestamp, c int) tags (t int);
|
||||||
|
@ -122,6 +57,8 @@ sql select * from information_schema.ins_stables where db_name = 'db';
|
||||||
sql select * from information_schema.ins_tables where db_name = 'db';
|
sql select * from information_schema.ins_tables where db_name = 'db';
|
||||||
sql show db.vgroups;
|
sql show db.vgroups;
|
||||||
|
|
||||||
|
system sh/exec.sh -n dnode2 -s stop
|
||||||
|
|
||||||
return
|
return
|
||||||
print ======== start back
|
print ======== start back
|
||||||
run_back tmp/back.sim
|
run_back tmp/back.sim
|
||||||
|
|
Loading…
Reference in New Issue