diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index f663f4363d7afe7e0c258eadb94554678e2ce0e3..a148c1e36bbdabb249f6dc64dc7c86c6934e641e 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -1485,7 +1485,7 @@ static int tdbBtreeCellSize(const SPage *pPage, SCell *pCell, int dropOfp, TXN * if (dropOfp) { int ret = 0; SPgno pgno = *(SPgno *)(pCell + nLocal - sizeof(SPgno)); - int nLeft = nPayload - nLocal + sizeof(SPgno); + int nLeft = nPayload - nLocal + sizeof(SPgno) + nHeader; SPage *ofp; int bytes; diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py index 371d147efc38735b4b0efdc19dc9288edbca5030..9a94632a12ea7746cc2d2ff9a660f8c83dbdb9c6 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py @@ -132,7 +132,7 @@ class TDTestCase: tdSql.error("create mnode on dnode 2") tdSql.query("select * from information_schema.ins_dnodes;") print(tdSql.queryResult) - clusterComCheck.checkDnodes(dnodeNumbers) + clusterComCheck.checkDnodes(dnodeNumbers, 60) # create database and stable clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) diff --git a/tests/system-test/6-cluster/clusterCommonCheck.py b/tests/system-test/6-cluster/clusterCommonCheck.py index c37e3541d4e7b70d484fd17030b9ce581993bb59..28c481083395c74c02238d380946bd00c0b74c0f 100644 --- a/tests/system-test/6-cluster/clusterCommonCheck.py +++ b/tests/system-test/6-cluster/clusterCommonCheck.py @@ -37,10 +37,10 @@ class ClusterComCheck: tdSql.init(conn.cursor()) # tdSql.init(conn.cursor(), logSql) # output sql.txt file - def checkDnodes(self,dnodeNumbers): + def checkDnodes(self,dnodeNumbers, timeout=30): count=0 # print(tdSql) - while count < 30: + while count < timeout: tdSql.query("select * from information_schema.ins_dnodes") # tdLog.debug(tdSql.queryResult) status=0 @@ -50,14 +50,14 @@ class ClusterComCheck: tdLog.info(status) if status == dnodeNumbers: - tdLog.success("it find cluster with %d dnodes and check that all cluster dnodes are ready within 30s! " %dnodeNumbers) + tdLog.success("it find cluster with %d dnodes and check that all cluster dnodes are ready within %ds! " % (dnodeNumbers, count)) return True count+=1 time.sleep(1) else: tdSql.query("select * from information_schema.ins_dnodes") tdLog.debug(tdSql.queryResult) - tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within 30s ! "%dnodeNumbers) + tdLog.exit("it find cluster with %d dnodes but check that there dnodes are not ready within %ds ! "% (dnodeNumbers, timeout)) def checkDbRows(self,dbNumbers): dbNumbers=int(dbNumbers)