未验证 提交 1439bdcd 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #20306 from taosdata/feat/add-reboot-time

feat/add-reboot-time
...@@ -33,6 +33,7 @@ static const SSysDbTableSchema dnodesSchema[] = { ...@@ -33,6 +33,7 @@ static const SSysDbTableSchema dnodesSchema[] = {
{.name = "support_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, {.name = "support_vnodes", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "reboot_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "note", .bytes = 256 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
}; };
...@@ -42,6 +43,7 @@ static const SSysDbTableSchema mnodesSchema[] = { ...@@ -42,6 +43,7 @@ static const SSysDbTableSchema mnodesSchema[] = {
{.name = "role", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "role", .bytes = 12 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "reboot_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
}; };
static const SSysDbTableSchema modulesSchema[] = { static const SSysDbTableSchema modulesSchema[] = {
......
...@@ -1074,6 +1074,9 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -1074,6 +1074,9 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->createdTime, false); colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->createdTime, false);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pDnode->rebootTime, false);
char *b = taosMemoryCalloc(VARSTR_HEADER_SIZE + strlen(offlineReason[pDnode->offlineReason]) + 1, 1); char *b = taosMemoryCalloc(VARSTR_HEADER_SIZE + strlen(offlineReason[pDnode->offlineReason]) + 1, 1);
STR_TO_VARSTR(b, online ? "" : offlineReason[pDnode->offlineReason]); STR_TO_VARSTR(b, online ? "" : offlineReason[pDnode->offlineReason]);
......
...@@ -644,6 +644,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -644,6 +644,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->createdTime, false); colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->createdTime, false);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pObj->stateStartTime, false);
numOfRows++; numOfRows++;
sdbRelease(pSdb, pObj); sdbRelease(pSdb, pObj);
} }
......
...@@ -8,10 +8,10 @@ sql connect ...@@ -8,10 +8,10 @@ sql connect
sql create dnode $hostname port 7200 sql create dnode $hostname port 7200
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode2 off: $data(2)[6] print dnode2 off: $data(2)[7]
if $data(2)[6] != @status not received@ then if $data(2)[7] != @status not received@ then
return -1 return -1
endi endi
...@@ -50,9 +50,9 @@ step3: ...@@ -50,9 +50,9 @@ step3:
return -1 return -1
endi endi
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode2 off: $data(2)[6] print dnode2 off: $data(2)[7]
if $data(2)[6] != @status msg timeout@ then if $data(2)[7] != @status msg timeout@ then
goto step3 goto step3
endi endi
...@@ -77,9 +77,9 @@ step5: ...@@ -77,9 +77,9 @@ step5:
endi endi
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode2 off: $data(3)[6] print dnode2 off: $data(3)[7]
if $data(3)[6] != @dnodeId not match@ then if $data(3)[7] != @dnodeId not match@ then
goto step5 goto step5
endi endi
...@@ -98,10 +98,10 @@ step6: ...@@ -98,10 +98,10 @@ step6:
endi endi
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode2 off: $data(3)[6] print dnode2 off: $data(3)[7]
print dnode3 off: $data(4)[6] print dnode3 off: $data(4)[67
if $data(4)[6] != @interval not match@ then if $data(4)[7] != @interval not match@ then
goto step6 goto step6
endi endi
...@@ -120,11 +120,11 @@ step7: ...@@ -120,11 +120,11 @@ step7:
endi endi
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode3 off: $data(3)[6] print dnode3 off: $data(3)[7]
print dnode4 off: $data(4)[6] print dnode4 off: $data(4)[7]
print dnode5 off: $data(5)[6] print dnode5 off: $data(5)[7]
if $data(5)[6] != @locale not match@ then if $data(5)[7] != @locale not match@ then
goto step7 goto step7
endi endi
...@@ -143,12 +143,12 @@ step8: ...@@ -143,12 +143,12 @@ step8:
endi endi
sql select * from information_schema.ins_dnodes sql select * from information_schema.ins_dnodes
print dnode1 off: $data(1)[6] print dnode1 off: $data(1)[7]
print dnode3 off: $data(3)[6] print dnode3 off: $data(3)[7]
print dnode4 off: $data(4)[6] print dnode4 off: $data(4)[7]
print dnode5 off: $data(5)[6] print dnode5 off: $data(5)[7]
print dnode6 off: $data(6)[6] print dnode6 off: $data(6)[7]
if $data(6)[6] != @charset not match@ then if $data(6)[7] != @charset not match@ then
goto step8 goto step8
endi endi
......
...@@ -22,7 +22,7 @@ class TDTestCase: ...@@ -22,7 +22,7 @@ class TDTestCase:
tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)") tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)")
tdSql.query("select count(*) from information_schema.ins_columns") tdSql.query("select count(*) from information_schema.ins_columns")
tdSql.checkData(0, 0, 269) tdSql.checkData(0, 0, 271)
tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'")
tdSql.checkRows(14) tdSql.checkRows(14)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册