add inc Snapshot copy case

This commit is contained in:
menshibin 2024-01-15 14:59:09 +08:00
parent 8614d2b7fb
commit 2be6098a2e
1 changed files with 29 additions and 29 deletions

View File

@ -31,45 +31,45 @@ class TDTestCase(TBase):
autoGen.create_db(self.db, 2, 3) autoGen.create_db(self.db, 2, 3)
autoGen.create_stable(self.stb, 5, 10, 8, 8) autoGen.create_stable(self.stb, 5, 10, 8, 8)
autoGen.create_child(self.stb, "d", self.childtable_count) autoGen.create_child(self.stb, "d", self.childtable_count)
autoGen.insert_data(1) autoGen.insert_data(1000)
tdSql.execute(f"flush database {self.db}") tdSql.execute(f"flush database {self.db}")
clusterDnodes.stoptaosd(3) clusterDnodes.stoptaosd(3)
clusterDnodes.stoptaosd(1) # clusterDnodes.stoptaosd(1)
clusterDnodes.starttaosd(3) # clusterDnodes.starttaosd(3)
time.sleep(5) # time.sleep(5)
clusterDnodes.stoptaosd(2) # clusterDnodes.stoptaosd(2)
clusterDnodes.starttaosd(1) # clusterDnodes.starttaosd(1)
time.sleep(5) # time.sleep(5)
autoGen.insert_data(10, 1600000000001) autoGen.insert_data(5000, 1600000000001)
# tdSql.execute(f"flush database {self.db}") tdSql.execute(f"flush database {self.db}")
sql = 'show vnodes;' # sql = 'show vnodes;'
while True: # while True:
bFinish = True # bFinish = True
param_list = tdSql.query(sql, row_tag=True) # param_list = tdSql.query(sql, row_tag=True)
for param in param_list: # for param in param_list:
if param[3] == 'leading' or param[3] == 'following': # if param[3] == 'leading' or param[3] == 'following':
bFinish = False # bFinish = False
break # break
if bFinish: # if bFinish:
break # break
self.snapshotAgg() self.snapshotAgg()
time.sleep(10)
clusterDnodes.stopAll() clusterDnodes.stopAll()
# for i in range(1, 4): for i in range(1, 4):
# path = clusterDnodes.getDnodeDir(i) path = clusterDnodes.getDnodeDir(i)
# dnodesRootDir = os.path.join(path,"data","vnode", "vnode*") dnodesRootDir = os.path.join(path,"data","vnode", "vnode*")
# dirs = glob.glob(dnodesRootDir) dirs = glob.glob(dnodesRootDir)
# for dir in dirs: for dir in dirs:
# if os.path.isdir(dir): if os.path.isdir(dir):
# tdLog.debug("delete dir: %s " % (dnodesRootDir)) tdLog.debug("delete dir: %s " % (dnodesRootDir))
# self.remove_directory(os.path.join(dir, "wal")) self.remove_directory(os.path.join(dir, "wal"))
clusterDnodes.starttaosd(1) clusterDnodes.starttaosd(1)
clusterDnodes.starttaosd(2) clusterDnodes.starttaosd(2)
clusterDnodes.starttaosd(3) clusterDnodes.starttaosd(3)
time.sleep(3) time.sleep(10)
while True: while True:
bFinish = True bFinish = True
param_list = tdSql.query(sql, row_tag=True) param_list = tdSql.query(sql, row_tag=True)