diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 78d84c9c257beeb52f423b535629f6de106a6c53..540ca1dc74af5ff1c7d830adf716c11882d91cd7 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -219,12 +219,12 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) { SDB_GET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) taosInitRWLatch(&pDb->lock); - if (pDb->cfg.tsdbPageSize <= TSDB_MIN_TSDB_PAGESIZE) { + if (pDb->cfg.tsdbPageSize != TSDB_MIN_TSDB_PAGESIZE) { mInfo("db:%s, tsdbPageSize set from %d to default %d", pDb->name, pDb->cfg.tsdbPageSize, TSDB_DEFAULT_TSDB_PAGESIZE); } - if (pDb->cfg.sstTrigger <= TSDB_MIN_STT_TRIGGER) { + if (pDb->cfg.sstTrigger != TSDB_MIN_STT_TRIGGER) { mInfo("db:%s, sstTrigger set from %d to default %d", pDb->name, pDb->cfg.sstTrigger, TSDB_DEFAULT_SST_TRIGGER); } diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index b5ddd6f279a04ed5c06ebf7e5f68efef06c5e1d4..2d888d2ff77a842c8b1543a462d286d5d8a2ddb6 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -803,12 +803,12 @@ void mndSetRestored(SMnode *pMnode, bool restored) { taosThreadRwlockWrlock(&pMnode->lock); pMnode->restored = true; taosThreadRwlockUnlock(&pMnode->lock); - mTrace("mnode set restored:%d", restored); + mInfo("mnode set restored:%d", restored); } else { taosThreadRwlockWrlock(&pMnode->lock); pMnode->restored = false; taosThreadRwlockUnlock(&pMnode->lock); - mTrace("mnode set restored:%d", restored); + mInfo("mnode set restored:%d", restored); while (1) { if (pMnode->rpcRef <= 0) break; taosMsleep(3); @@ -822,7 +822,7 @@ void mndSetStop(SMnode *pMnode) { taosThreadRwlockWrlock(&pMnode->lock); pMnode->stopped = true; taosThreadRwlockUnlock(&pMnode->lock); - mTrace("mnode set stopped"); + mInfo("mnode set stopped"); } bool mndGetStop(SMnode *pMnode) { return pMnode->stopped; } diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b549ed1a6869afb56bc3d48531716a8348ab41a9..6f4351f713a5c2ff5d9aa1519e1e5e2834604c4e 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1084,10 +1084,10 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, if (!force) { mInfo("vgId:%d, will add 1 vnode", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, &newVg, pArray) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; for (int32_t i = 0; i < newVg.replica - 1; ++i) { if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; mInfo("vgId:%d, will remove 1 vnode", pVgroup->vgId); @@ -1108,12 +1108,12 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; for (int32_t i = 0; i < newVg.replica; ++i) { if (i != vnIndex) { if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; if (newVg.replica == 1) { @@ -1190,10 +1190,10 @@ static int32_t mndAddIncVgroupReplicaToTrans(SMnode *pMnode, STrans *pTrans, SDb pGid->dnodeId = newDnodeId; pGid->syncState = TAOS_SYNC_STATE_ERROR; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1; for (int32_t i = 0; i < pVgroup->replica - 1; ++i) { if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, pVgroup, pVgroup->vnodeGid[i].dnodeId) != 0) return -1; } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1; return 0; @@ -1589,11 +1589,16 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb pVgroup->vnodeGid[0].dnodeId); if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; - if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + + if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; } else if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { @@ -1603,9 +1608,14 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb SVnodeGid del1 = {0}; SVnodeGid del2 = {0}; if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del1) != 0) return -1; - if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + + if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) return -1; @@ -1662,15 +1672,15 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj if (newVg1.replica == 1) { if (mndAddVnodeToVgroup(pMnode, &newVg1, pArray) != 0) goto _OVER; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[0].dnodeId) != 0) goto _OVER; + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; } else if (newVg1.replica == 3) { SVnodeGid del1 = {0}; if (mndRemoveVnodeFromVgroup(pMnode, &newVg1, pArray, &del1) != 0) goto _OVER; + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[0].dnodeId) != 0) goto _OVER; if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, newVg1.vnodeGid[1].dnodeId) != 0) goto _OVER; - if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; } else { goto _OVER; diff --git a/tests/script/tsim/backup/arbitrator/check_cluster_cfg_para.sim b/tests/script/tsim/backup/arbitrator/check_cluster_cfg_para.sim deleted file mode 100644 index 8ac75c3995a44c57e8b00a605cd553db2b67575c..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/check_cluster_cfg_para.sim +++ /dev/null @@ -1,199 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 -system sh/deploy.sh -n dnode6 -i 6 -system sh/deploy.sh -n dnode7 -i 7 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode1 -c statusInterval -v 3 -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode1 -c timezone -v "" -#system sh/cfg.sh -n dnode1 -c locale -v "" -#system sh/cfg.sh -n dnode1 -c charset -v "" -system sh/cfg.sh -n dnode1 -c balanceInterval -v 3 - -######## dnode 2 the same with dnode1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode2 -c statusInterval -v 3 -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode2 -c timezone -v "" -#system sh/cfg.sh -n dnode2 -c locale -v "" -#system sh/cfg.sh -n dnode2 -c charset -v "" -system sh/cfg.sh -n dnode2 -c balanceInterval -v 3 - -######## dnode 3 one para no same with dnode1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode3 -c statusInterval -v 3 -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode3 -c timezone -v "" -#system sh/cfg.sh -n dnode3 -c locale -v "" -#system sh/cfg.sh -n dnode3 -c charset -v "" -system sh/cfg.sh -n dnode3 -c balanceInterval -v 3 - -######## dnode 4 one para no same with dnode1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 5 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode4 -c statusInterval -v 3 -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode4 -c timezone -v "" -#system sh/cfg.sh -n dnode4 -c locale -v "" -#system sh/cfg.sh -n dnode4 -c charset -v "" -system sh/cfg.sh -n dnode4 -c balanceInterval -v 3 - -######## dnode 5 one para no same with dnode1 -system sh/cfg.sh -n dnode5 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c offlineThreshold -v 7 -system sh/cfg.sh -n dnode5 -c statusInterval -v 3 -system sh/cfg.sh -n dnode5 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode5 -c timezone -v "" -#system sh/cfg.sh -n dnode5 -c locale -v "" -#system sh/cfg.sh -n dnode5 -c charset -v "" -system sh/cfg.sh -n dnode5 -c balanceInterval -v 3 - - -######## dnode 6 one para no same with dnode1 -system sh/cfg.sh -n dnode6 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode6 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode6 -c statusInterval -v 2 -system sh/cfg.sh -n dnode6 -c arbitrator -v $arbitrator -#system sh/cfg.sh -n dnode6 -c timezone -v "" -#system sh/cfg.sh -n dnode6 -c locale -v "" -#system sh/cfg.sh -n dnode6 -c charset -v "" -system sh/cfg.sh -n dnode6 -c balanceInterval -v 3 - - -######## dnode 7 one para no same with dnode1 -system sh/cfg.sh -n dnode7 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode7 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode7 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode7 -c statusInterval -v 3 -system sh/cfg.sh -n dnode7 -c arbitrator -v "plum-VirtualBox:8001" -#system sh/cfg.sh -n dnode7 -c timezone -v "" -#system sh/cfg.sh -n dnode7 -c locale -v "" -#system sh/cfg.sh -n dnode7 -c charset -v "" -system sh/cfg.sh -n dnode7 -c balanceInterval -v 3 - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1 -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2~7 and add into cluster -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -system sh/exec.sh -n dnode5 -s start -system sh/exec.sh -n dnode6 -s start -system sh/exec.sh -n dnode7 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sql create dnode $hostname5 -sql create dnode $hostname6 -sql create dnode $hostname7 -sleep 10000 - -$loopCnt = 0 -wait_dnode_created: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 8 then - sleep 2000 - goto wait_dnode_created -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -$dnode5Status = $data4_5 -$dnode6Status = $data4_6 -$dnode7Status = $data4_7 - -if $dnode1Status != ready then - return -1 -endi -if $dnode2Status != ready then - return -1 -endi -if $dnode3Status != offline then - return -1 -endi -if $dnode4Status != offline then - return -1 -endi -if $dnode5Status != offline then - return -1 -endi -if $dnode6Status != offline then - return -1 -endi -if $dnode7Status != offline then - return -1 -endi - -sleep 10000 - -$loopCnt = 0 -wait_dnode_offline_overtime_dropped: -$loopCnt = $loopCnt + 1 -if $loopCnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7 -if $rows != 3 then - sleep 2000 - goto wait_dnode_offline_overtime_dropped -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -print $data0_7 $data1_7 $data2_7 $data3_7 $data4_7 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -$dnode5Status = $data4_5 -$dnode6Status = $data4_6 -$dnode7Status = $data4_7 - -if $dnode1Status != ready then - return -1 -endi -if $dnode2Status != ready then - return -1 -endi diff --git a/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync.sim b/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync.sim deleted file mode 100644 index cc8130217aed0eaa9343d13439b625647d06eda6..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync.sim +++ /dev/null @@ -1,222 +0,0 @@ -# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode -# step 1: start dnode1 -# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode) -# step 2: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841) -# step 3: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc -# step 4: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2 -# step 5: insert two data rows: now-21d, now-41d -# step 6: restart dnode2, waiting sync end -# expect: in dnode2, the files 1837 and 1839 will be removed - -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 2000 - -$totalTableNum = 1 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 cache 1 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 double) tags(t1 int) -$rowNum = 130000 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -# insert over 2M data in order to falling disc, generate one file -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum -# $ts = $tsStart + $x - sql insert into $tb values ( now + 0s , $x ) ( now + 1s , $x ) ( now + 2s , $x ) ( now + 3s , $x ) ( now + 4s , $x ) ( now + 5s , $x ) ( now + 6s , $x ) ( now + 7s , $x ) ( now + 8s , $x ) ( now + 9s , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print rows:$rows data00:$data00 -if $rows != 1 then - return -1 -endi - -if $data00 == 0 then - return -1 -endi - -$totalRows = $data00 - -print ============== step3: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc -sql insert into $tb values ( now - 20d , -20 ) -sql insert into $tb values ( now - 40d , -40 ) -$totalRows = $totalRows + 2 - -print ============== step4: stop dnode3, so date rows falling disc, generate two new files in dnode3 -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode3_offline -endi - -sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3 -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ---->dnode3 data files: $system_content expect: 9 -if $system_content != 9 then - return -1 -endi - -print ============== step5: insert two data rows: now-16d, now+16d, -sql insert into $tb values ( now - 21d , -21 ) -sql insert into $tb values ( now - 41d , -41 ) -$totalRows = $totalRows + 2 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ---->dnode2 data files: $system_content expect: 3 -if $system_content != 3 then - return -1 -endi - -print ============== step7: restart dnode3, waiting sync end -system sh/exec.sh -n dnode3 -s start -sleep 2000 - -$loopCnt = 0 -wait_dnode3_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_ready -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ---->dnode2 data files: $system_content expect: 3 -if $system_content != 3 then - return -1 -endi -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ---->dnode3 data files: $system_content expect: 3 -if $system_content != 3 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync_second.sim b/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync_second.sim deleted file mode 100644 index 9395beb0efcd1e6ffbb20f3fae2b1720332726f0..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync_second.sim +++ /dev/null @@ -1,52 +0,0 @@ -# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode -# step 1: start dnode1 -# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode) -# step 3: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841) -# step 4: insert old data(now-20d) and new data(now-40d), control data rows in order to save in cache, not falling disc -# step 5: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2 -# step 6: insert two data rows: now-21d, now-41d -# step 7: restart dnode2, waiting sync end -# expect: in dnode2, the files 1837 and 1839 will be removed - -sql connect -sleep 2000 - -print ============== step7: restart dnode2, waiting sync end -system sh/exec.sh -n dnode2 -s start -sleep 2000 - -wait_dnode2_ready: -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode2_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode2_ready -endi - -sleep 1000 -# check using select -$db = db -$stb = stb -sql use $db -sql select count(*) from $stb -print data00 $data00, should equal to dn2_mn1_cache_file_sync.sim output -#if $data00 != $totalRows then -# return -1 -#endi - -print ============== step8: please check there should be 1 file in sim/dnode2/data/vnode/vnode2/tsdb/data/, and 1 file sim/dnode3/data/vnode/vnode2/tsdb/data/ diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_full_createTableFail.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_full_createTableFail.sim deleted file mode 100644 index 057654abb47be64bcba726df8b689b8db4d97f58..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_full_createTableFail.sim +++ /dev/null @@ -1,101 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table to max tables -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 16 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 10 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step3: create one table, should return error for not more vnode -sql_error create table tbm using $stb tags( 10000 ) - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_full_dropDnodeFail.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_full_dropDnodeFail.sim deleted file mode 100644 index c597c576e2994725035f83268c6b1f99392627da..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_full_dropDnodeFail.sim +++ /dev/null @@ -1,102 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table to max tables -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 16 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 10 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step3: drop dnode4, should return error for not more dnode -sql_error drop dnode $hostname4 - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_multiCreateDropTable.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_multiCreateDropTable.sim deleted file mode 100644 index 49e1dba06719a3375b221854ccb3a35d1bd03dfe..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_multiCreateDropTable.sim +++ /dev/null @@ -1,310 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 10 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: drop the middle table 5 -sql drop table tb5 -$totalRows = $totalRows - 10 -sleep 6000 - -print ============== step4: insert data into other tables -$tsStart = 1420041610000 -$i = 0 -$tblNum = 5 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -$i = 6 -$tblNum = 10 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step5: create the middle table 5 and insert data -sql create table tb5 using $stb tags( 5 ) -sleep 2000 - -$tsStart = 1420041620000 -$i = 5 -$tblNum = 6 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from tb5 -print data00 $data00 -if $data00 != 10 then - return -1 -endi - -print ============== step6: drop the first table 0 -sql drop table tb0 -$totalRows = $totalRows - 20 -sleep 6000 - -print ============== step7: insert data into other tables -$tsStart = 1420041630000 -$i = 1 -$tblNum = 10 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi -sql select count(*) from tb5 -print data00 $data00 -if $data00 != 20 then - return -1 -endi - -print ============== step8: create the first table 0 and insert data -sql create table tb0 using $stb tags( 0 ) -sleep 2000 - -$tsStart = 1420041640000 -$i = 0 -$tblNum = 10 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from tb0 -print data00 $data00 -if $data00 != 10 then - return -1 -endi - -print ============== step9: drop the last table 9 -sql drop table tb9 -$totalRows = $totalRows - 40 -sleep 6000 - -print ============== step10: insert data into other tables -$tsStart = 1420041650000 -$i = 0 -$tblNum = 9 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step11: create the last table 9 and insert data -sql create table tb9 using $stb tags( 9 ) -sleep 2000 - -$tsStart = 1420041660000 -$i = 0 -$tblNum = 10 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from tb9 -print data00 $data00 -if $data00 != 10 then - return -1 -endi diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim deleted file mode 100644 index a2c1bf9883108a417cb07364922e9692f7a13ec4..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim +++ /dev/null @@ -1,160 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode2 -c walLevel -v 1 -system sh/cfg.sh -n dnode3 -c walLevel -v 1 -system sh/cfg.sh -n dnode4 -c walLevel -v 1 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 10 - -system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1 - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$rowNum = 10 -$tblNum = 16 -$totalRows = 0 -$tsStart = 1420041600000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) - - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -print info: select count(*) from $stb -sleep 1000 -sql reset query cache -sleep 1000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - return -1 -endi - -print ============== step3: stop dnode4, after timerout dnode4 will be auto-dropped. -### The script using down port to stop the network is invalid, so temp it stops the service instead -system sh/exec.sh -n dnode4 -s stop -#system sh/port.sh -p 7400 -s down -sleep 12000 - -$loopCnt = 0 -wait_dnode4_dropped: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode4_dropped -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode4, but there no dnode4 in cluster -system sh/exec.sh -n dnode4 -s start -sql select * from information_schema.ins_dnodes -if $rows != 3 then - return -1 -endi - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_r2_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_r2_vnode_delDir.sim deleted file mode 100644 index 560aef5c17de336fc9065a21e9a45b39d2a5baa5..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_r2_vnode_delDir.sim +++ /dev/null @@ -1,358 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 3000 - -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode3, and remove its vnodeX subdirector -system sh/exec.sh -n dnode3 -s stop -x SIGINT -#sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_2 -$dnode2Vtatus = $data7_2 - -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi - -system rm -rf ../../../sim/dnode3/data -#system rm -rf ../../../sim/dnode3/data/vnode/* - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode3, waiting sync end -system sh/exec.sh -n dnode3 -s start -#sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi - -$loopCnt = 0 -wait_dnode3_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_2 -$dnode2Vtatus = $data7_2 - -print dnode2Vtatus: $dnode3Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode2, and remove its vnode -sleep 3000 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode2_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi - -system rm -rf ../../../sim/dnode2/data -#system rm -rf ../../../sim/dnode2/data/vnode/* -#system rm -rf ../../../sim/dnode3/data/vnode/* - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step6: restart dnode2, and check rows -system sh/exec.sh -n dnode2 -s start -#sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode2_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode2_reready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode2_reready -endi - -$loopCnt = 0 -wait_dnode2_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_2 -$dnode2Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi -if $dnode2Vtatus != slave then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi \ No newline at end of file diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_r3_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_r3_vnode_delDir.sim deleted file mode 100644 index d8a410283e31d9322834a379e226385c4b0efc06..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_r3_vnode_delDir.sim +++ /dev/null @@ -1,409 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4, and remove its vnodeX subdirector -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$loopCnt = 0 -wait_dnode4_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -system rm -rf ../../../sim/dnode4/data -#system rm -rf ../../../sim/dnode4/data/vnode/* - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start -#sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_reready -endi - -$loopCnt = 0 -wait_dnode4_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode3/dnode2, and remove its vnode -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode23_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode23_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode23_offline -endi -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode23_offline -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode23_offline -endi - -system rm -rf ../../../sim/dnode2/data -system rm -rf ../../../sim/dnode3/data -#system rm -rf ../../../sim/dnode2/data/vnode/* -#system rm -rf ../../../sim/dnode3/data/vnode/* - -print ============== step6: restart dnode2/dnode3, and check rows -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode23_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode23_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode23_reready -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode23_reready -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode23_reready -endi - -$loopCnt = 0 -wait_dnode4_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_master -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step7: stop dnode3/dnode2, and cluster unable to provide services -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep 2000 -sql select count(*) from $stb -x s71 -s71: - -print ============== step8: restart dnode2, and cluster Still unable to provide services -system sh/exec.sh -n dnode2 -s start -sleep 2000 -sql select count(*) from $stb -x s81 -s81: - -print ============== step9: restart dnode3, and cluster Resume service delivery -system sh/exec.sh -n dnode3 -s start - -$loopCnt = 0 -wait_dnode4_vgroup_master_2: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master_2 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master_2 -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_master_2 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim deleted file mode 100644 index ab144212e47ee5f494fbf911ecb1d530efa906cf..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim +++ /dev/null @@ -1,367 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode5 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode2 -c walLevel -v 1 -system sh/cfg.sh -n dnode3 -c walLevel -v 1 -system sh/cfg.sh -n dnode4 -c walLevel -v 1 -system sh/cfg.sh -n dnode5 -c walLevel -v 1 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 16 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 16 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 16 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 16 -system sh/cfg.sh -n dnode5 -c maxVgroupsPerDb -v 16 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 200 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 -system sh/cfg.sh -n dnode5 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode5 -c arbitrator -v $arbitrator - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode5 -c offlineThreshold -v 10 - -system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode5 -c enableCoreFile -v 1 - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster, then create database replica 2, create table , and insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 2000 - -$rowNum = 100 -$tblNum = 16 -$totalRows = 0 -$tsStart = 1420041600000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) - - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -print info: select count(*) from $stb -sleep 1000 -sql reset query cache -sleep 1000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: add one new dnode4 expect auto balancing -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname4 -sleep 10000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step4: stop dnode3, after offlineThreshold, dnode3 will be dropped for cluster -system sh/exec.sh -n dnode3 -s stop -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -#sleep 2000 -#sql select * from information_schema.ins_dnodes -#print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -#print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -# -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -# -#if $dnode1Status != ready then -# return -1 -#endi -#if $dnode2Status != ready then -# return -1 -#endi -#if $dnode3Status != offline then -# return -1 -#endi -#if $dnode4Status != ready then -# return -1 -#endi - -sleep 15000 - -$loopCnt = 0 -wait_drop: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_drop -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode1Status != ready then - return -1 -endi -if $dnode2Status != ready then - return -1 -endi -if $dnode3Status != null then - return -1 -endi -if $dnode4Status != ready then - return -1 -endi - -print ============== step4-1: restart dnode3, adn add into cluster -system rm -rf ../../../sim/dnode3 -sleep 1000 - -system sh/deploy.sh -n dnode3 -i 3 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c walLevel -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 200 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 16 - -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname3 -sleep 2000 - -$loopCnt = 0 -wait_dnode3_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -print rows: $rows -if $rows != 4 then - sleep 2000 - goto wait_dnode3_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -$dnode5Status = $data4_5 - -if $dnode1Status != ready then - goto wait_dnode3_ready -endi -if $dnode2Status != ready then - goto wait_dnode3_ready -endi -if $dnode3Status != null then - goto wait_dnode3_ready -endi -if $dnode4Status != ready then - goto wait_dnode3_ready -endi -if $dnode5Status != ready then - goto wait_dnode3_ready -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: start dnode5 and add into cluster , drop database -sql drop database $db -sleep 1000 -system sh/exec.sh -n dnode5 -s start -sql create dnode $hostname5 -sleep 2000 -$loopCnt = 0 -wait_dnode5: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode5 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode4Status = $data4_4 -$dnode5Status = $data4_5 -$dnode6Status = $data4_6 - -if $dnode1Status != ready then - goto wait_dnode5 -endi -if $dnode2Status != ready then - goto wait_dnode5 -endi -if $dnode3Status != null then - goto wait_dnode5 -endi -if $dnode4Status != ready then - goto wait_dnode5 -endi -if $dnode5Status != ready then - goto wait_dnode5 -endi -if $dnode6Status != ready then - goto wait_dnode5 -endi - -print ============== step6: create database and table until not free vnodes -$rowNum = 100 -$tblNum = 32 -$totalRows = 0 -$tsStart = 1420041600000 - -$db = db1 -sql create database $db replica 2 -sql use $db -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) - - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) - - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -print info: select count(*) from $stb -sleep 2000 -sql reset query cache -sleep 2000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step7: drop dnode $hostname5, system should prompt "DB error: no enough dnodes" -sql_error drop dnode $hostname5 -print error: $error -print ============== step8: create table tb_more using $stb tags( 1000 ), system should prompt 'DB error: no enough dnodes' -sql_error create table tb_more using $stb tags( 1000 ) -print error: $error diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change.sim deleted file mode 100644 index 7ebba544185902d07ac58afbcec9bebddf8cb329..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change.sim +++ /dev/null @@ -1,358 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sql connect - -print ============== step2: start dnode2 and add into cluster , then create database with replica 1, and create table, insert data -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname2 - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql select * from information_schema.ins_dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi - -$db = db -sql create database $db replica 1 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step2-1: stop dnode2 for falling disc, then restart dnode2, and check rows -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s start - -$x = 0 -a0: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a0 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: start dnode3 and add into cluster , then alter replica from 1 to 2, and waiting sync -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname3 - -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql select * from information_schema.ins_dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_3 != ready then - goto step2 -endi - -sql alter database $db replica 2 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: stop dnode2 for checking if sync ok -system sh/exec.sh -n dnode2 -s stop -$x = 0 -a2: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a2 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode2 -system sh/exec.sh -n dnode2 -s start -$x = 0 -a3: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a3 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step6: start dnode4 and add into cluster , then alter replica from 2 to 3, and waiting sync -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname4 -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql select * from information_schema.ins_dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_4 != ready then - goto step6 -endi - -sql alter database $db replica 3 -$x = 0 -a4: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a4 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step7: alter replica from 3 to 2, and waiting sync -sql alter database $db replica 2 -$x = 0 -a5: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a5 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step8: alter replica from 2 to 1, and waiting sync -sql alter database $db replica 1 -$x = 0 -a6: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a6 -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step9: drop dnode2/dnode3 -sql drop dnode $hostname2 -sql drop dnode $hostname3 -sleep $sleepTimer - -$x = 0 -step9: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - goto step9 -endi - -$x = 0 -a7: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a7 -endi - -sleep $sleepTimer #waiting move vnode from dnode3/dnode3 to dnode4 -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change_dropDnod.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change_dropDnod.sim deleted file mode 100644 index 31040ef0a15041f4e715c0a20df39daf23707e2f..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change_dropDnod.sim +++ /dev/null @@ -1,150 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 10000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: drop dnode4, then check rows -#system sh/exec.sh -n dnode4 -s stop -x SIGINT -sql drop dnode $hostname4 -sleep $sleepTimer -$loopCnt = 0 -wait_dnode4_dropped: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_dropped -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi - -sql reset query cache -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_stopDnode_timeout.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_stopDnode_timeout.sim deleted file mode 100644 index b9e92563fff6de18433f2b3a0540b4a949d4f0cb..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_stopDnode_timeout.sim +++ /dev/null @@ -1,222 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode2 -c walLevel -v 1 -system sh/cfg.sh -n dnode3 -c walLevel -v 1 -system sh/cfg.sh -n dnode4 -c walLevel -v 1 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 5 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 5 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 5 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 5 - -system sh/cfg.sh -n dnode1 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode2 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode3 -c enableCoreFile -v 1 -system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1 - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$rowNum = 10 -$tblNum = 16 -$totalRows = 0 -$tsStart = 1420041600000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) - - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -print info: select count(*) from $stb -sleep 1000 -sql reset query cache -sleep 1000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - return -1 -endi - -print ============== step3: stop dnode4, after timerout dnode4 will be auto-dropped. -system sh/exec.sh -n dnode4 -s stop -sleep 12000 - -$loopCnt = 0 -wait_dnode4_dropped: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode4_dropped -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode4_dropped -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode4, but there are not dnode4 in cluster -system sh/exec.sh -n dnode4 -s start -sleep 2000 -sql select * from information_schema.ins_dnodes -if $rows != 3 then - return -1 -endi - -print ============== step5: recreate dnode4 into cluster, result should fail -sql create dnode $hostname4 -sleep 12000 -sql select * from information_schema.ins_dnodes -if $rows != 3 then - return -1 -endi - -print ============== step5: remove dnode4 director, then recreate dnode4 into cluster, result should ok -system sh/exec.sh -n dnode4 -s stop -system rm -rf ../../../sim/dnode4 - -system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c walLevel -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c role -v 2 -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 5 -system sh/cfg.sh -n dnode4 -c enableCoreFile -v 1 - -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname4 -sleep 6000 - -$loopCnt = 0 -wait_dnode4_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_6 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_change.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_change.sim deleted file mode 100644 index 5477ef358039d33da2ad403d9fd2ca2e3faa495e..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_change.sim +++ /dev/null @@ -1,319 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select * from information_schema.ins_dnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 - -print ============== step3: stop dnode4, then destroy the contents of its data file -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$loopCnt = 0 -wait_dnode4_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -wait_dnode4_vgroup_offline: -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -system echo "haha, nothing......" > ../../../sim/dnode4/data/vnode/vnode2/tsdb/data/v2f1643.data -#system rm -rf ../../../sim/dnode4/data/vnode/* -sleep 1000 - -print ============== step3-1: insert new data -sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_reready -endi - -$loopCnt = 0 -wait_dnode4_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode3/dnode2, and check rows -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode23_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode23_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode23_offline -endi -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode23_offline -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode23_offline -endi - -$loopCnt = 0 -wait_dnode4_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master -endi -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_master -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim deleted file mode 100644 index 07475adad6a05a6ef3c2c46c2b302896d8a554e8..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim +++ /dev/null @@ -1,435 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -#system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -#sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode3 for falling disc, then corrupt vnode data file in dnode3 -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_2 -$dnode2Vtatus = $data7_2 - -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi - -#$expectCnt = 3 . : -#print expectCnt: [ $expectCnt ] -#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':' -#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':' -#print --2-->dnode3 data files: [ $system_content ] - - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n' -print ---->dnode2 data files: $system_content expect: 0 -if $system_content != 0 then - return -1 -endi - -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n' -print ---->dnode3 data files: $system_content expect: 3 -if $system_content != 3 then - return -1 -endi - -system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data - -print ============== step3-1: insert some news data for let version changed -sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x ) -sql insert into $tb values ( now + 10a , $x ) ( now + 11a , $x ) ( now + 12a , $x ) -$totalRows = $totalRows + 6 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode3, and run query -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi -$loopCnt = 0 -wait_dnode3_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ----> dnode2 data files: $system_content expect: 0 -if $system_content != 0 then - return -1 -endi - -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ----> dnode3 data files: $system_content expect: 0 -if $system_content != 0 then - print there should be no data file in dnode3 after sync - return -1 -endi - -print ============== step5: stop dnode2, and check if dnode3 sync ok -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode2_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step6: stop dnode3 for falling disck -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer -sql select * from information_schema.ins_dnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 - -sql show vgroups -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 - - -print ============== step7: restart dnode3, and run query -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode23_reready_2: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode23_reready_2 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode23_reready_2 -endi - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode23_reready_2 -endi - -$loopCnt = 0 -wait_dnode23_vgroup_ok: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus == offline then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi -if $dnode3Vtatus == offline then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_online.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_online.sim deleted file mode 100644 index e3dfccf700e5328fdf32174af259fe648a2f63b0..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_online.sim +++ /dev/null @@ -1,354 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data to can fall disc -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -#system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -#sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 4 -$sleepTimer = 3000 - -$db = db -sql create database $db cache 1 replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 128 * 1024 -$tblNum = 1 -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - $tsLast = $ts + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: corrupt vnode data file in dnode3, not stop dnode3 -system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data -sleep 1000 - -print ============== step4: insert new data, and run query -sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print select * from information_schema.ins_dnodes -sql select * from information_schema.ins_dnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 - -print show vgroups -sql show vgroups -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 - - -$tsStart = $tsLast + 1 -$i = 0 -while $i < $tblNum - $tb = tb . $i - #sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - $tsLast = $ts + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode2, and check if dnode3 sync ok -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode2_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step6: stop dnode3 for falling disc -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - - -$loopCnt = 0 -wait_dnode3_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi - -print ============== step7: restart dnode2/dnode3, and run query -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master_1: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_createErrData_online.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_createErrData_online.sim deleted file mode 100644 index 677e9bbacb0c7f1452d6ad3de8462f48a9d3d3a9..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_createErrData_online.sim +++ /dev/null @@ -1,316 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -#system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -#sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: corrupt vnode data file in dnode3, not stop dnode3 -system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/v2f1643.data -sleep 1000 - -print ============== step4: insert new data, and run query -sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode2, and check if dnode3 sync ok -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode2_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step6: stop dnode3 for falling disc -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - - -$loopCnt = 0 -wait_dnode3_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi - -print ============== step7: restart dnode2/dnode3, and run query -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master_1: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master_1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_delDir.sim deleted file mode 100644 index 0ac8f56d9134d401231193609d6b7f45265a452a..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_delDir.sim +++ /dev/null @@ -1,458 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4, and remove its vnodeX subdirector -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - - -$loopCnt = 0 -wait_dnode4_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -system rm -rf ../../../sim/dnode4/data/vnode/* - -print ============== step4: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_reready -endi - -$loopCnt = 0 -wait_dnode4_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi - -print ============== step5: stop dnode3, and remove its vnodeX subdirector -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode3_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode3_offline -endi -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode3_offline -endi - -system rm -rf ../../../sim/dnode3/data/vnode/* - -print ============== step6: restart dnode3, and check rows -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi - -$loopCnt = 0 -wait_dnode3_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step7: stop dnode2, and remove its vnodeX subdirector -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode2_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi - -system rm -rf ../../../sim/dnode2/data/vnode/* - -print ============== step8: restart dnode2, and check rows -system sh/exec.sh -n dnode2 -s start -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode2_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode2_reready -endi - -$loopCnt = 0 -wait_dnode2_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -print dnode4Vtatus: $dnode4Vtatus -print dnode3Vtatus: $dnode3Vtatus -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode2_vgroup_slave -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql insert into $tb values ( now , 20000 ) ( now + 1a, 20001 ) ( now + 2a, 20002 ) -$totalRows = $totalRows + 3 - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim deleted file mode 100644 index 6448cc02b8d3f23291cf88f213a1d74e8668fbb4..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim +++ /dev/null @@ -1,434 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -#system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -#sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -sleep 1000 -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode3 for falling disc, then corrupt vnode data file in dnode3 -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_2 -$dnode2Vtatus = $data7_2 - -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_offline -endi - -#$expectCnt = 3 . : -#print expectCnt: [ $expectCnt ] -#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':' -#system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr '\n' ':' -#print --2-->dnode3 data files: [ $system_content ] - - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n' -print ---->dnode2 data files: $system_content expect: 0 -if $system_content != 0 then - return -1 -endi - -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l | grep "^-" | wc -l | tr -d '\n' -print ---->dnode3 data files: $system_content expect: 3 -if $system_content != 3 then - return -1 -endi - -#system echo "haha, nothing......" > ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/f1643.data - -print ============== step3-1: insert some news data for let version changed -sql insert into $tb values ( now + 0a , $x ) ( now + 1a , $x ) ( now + 2a , $x ) -sql insert into $tb values ( now + 10a , $x ) ( now + 11a , $x ) ( now + 12a , $x ) -$totalRows = $totalRows + 6 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step4: restart dnode3, and run query -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode3_reready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode3_reready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode3_reready -endi -$loopCnt = 0 -wait_dnode3_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi -if $dnode3Vtatus != slave then - sleep 2000 - goto wait_dnode3_vgroup_slave -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ----> dnode2 data files: $system_content expect: 0 -if $system_content != 0 then - return -1 -endi - -system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n' -print ----> dnode3 data files: $system_content expect: 0 -if $system_content != 0 then - print there should be no data file in dnode3 after sync - return -1 -endi - -print ============== step5: stop dnode2, and check if dnode3 sync ok -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode2_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline_0 -endi - -$loopCnt = 0 -wait_dnode3_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus != offline then - sleep 2000 - goto wait_dnode3_vgroup_master -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode3_vgroup_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step6: stop dnode3 for falling disck -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer -sql select * from information_schema.ins_dnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 - -sql show vgroups -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 - - -print ============== step7: restart dnode2/dnode3, and run query -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sleep $sleepTimer -$loopCnt = 0 -wait_dnode23_reready_2: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode23_reready_2 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode23_reready_2 -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode23_reready_2 -endi - -$loopCnt = 0 -wait_dnode23_vgroup_ok: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode2Vtatus = $data7_2 -$dnode3Vtatus = $data5_2 - -if $dnode2Vtatus == offline then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi -if $dnode3Vtatus == offline then - sleep 2000 - goto wait_dnode23_vgroup_ok -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_nomaster.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_nomaster.sim deleted file mode 100644 index f8ca114437e2674064f1a6ca9c612fdf0263e6ff..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_nomaster.sim +++ /dev/null @@ -1,299 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20 - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4/dnode2 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$loopCnt = 0 -wait_dnode4_vgroup_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != unsynced then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -sql select count(*) from $stb -x s31 -s31: -#sql_error insert into $tb values (now, 9988) -x s32 -#s32: - -print ============== step4: restart dnode2, then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db1 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 100 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode3 -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep $sleepTimer -$loopCnt = 0 -wait_dnode3_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode3_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 - -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -print dnode1Status $dnode1Status -print dnode2Status $dnode2Status -print dnode3Status $dnode3Status -print dnode4Status $dnode4Status - -if $dnode3Status != offline then - sleep 2000 - goto wait_dnode3_offline_0 -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode3_offline_0 -endi - -$loopCnt = 0 -wait_dnode2_vgroup_master: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode2_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode3Vtatus = $data5_3 -$dnode2Vtatus = $data7_3 - -if $dnode3Vtatus != offline then - sleep 2000 - goto wait_dnode2_vgroup_master -endi -if $dnode2Vtatus != master then - sleep 2000 - goto wait_dnode2_vgroup_master -endi - -sql insert into $tb values (now, 9000) (now + 1s, 9001) (now + 2s, 9002) -$totalRows = $totalRows + 3 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - - - - - - - - - - - - - - - - diff --git a/tests/script/tsim/backup/arbitrator/dn3_mn2_killDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn2_killDnode.sim deleted file mode 100644 index 92731c22029bdc7920cf0431ea6ee551590c41dc..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/dn3_mn2_killDnode.sim +++ /dev/null @@ -1,122 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -#system sh/cfg.sh -n dnode1 -c role -v 2 -#system sh/cfg.sh -n dnode2 -c role -v 2 -#system sh/cfg.sh -n dnode3 -c role -v 2 -#system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 3, and create table to max tables -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -#system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sleep 2000 -sql create dnode $hostname3 -#sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 4 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 10 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - - -print ============== step3: stop dnode2 -system sh/exec.sh -n dnode2 -s stop -sleep 2000 - -sql select * from information_schema.ins_mnodes -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$mnode1Status = $data2_1 -$mnode2Status = $data2_2 -$mnode3Status = $data2_3 -#$mnode4Status = $data2_4 - -if $mnode1Status != master then - return -1 -endi - -if $mnode2Status != offline then - return -1 -endi - -sql reset query cache -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - - diff --git a/tests/script/tsim/backup/arbitrator/insert_duplicationTs.sim b/tests/script/tsim/backup/arbitrator/insert_duplicationTs.sim deleted file mode 100644 index 1e439f160578d65f2030586e36cf0321a896cd61..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/insert_duplicationTs.sim +++ /dev/null @@ -1,293 +0,0 @@ -# Test case describe: dnode1 is only mnode, dnode2/dnode3 are only vnode -# step 1: start dnode1 -# step 2: start dnode2 and dnode3, and all added into cluster (Suppose dnode2 is master-vnode) -# step 3: create db, table, insert data, and Falling disc into file (control only one file, e.g. 1841) -# step 4: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc -# step 5: stop dnode2, so date rows falling disc, generate two new files 1840, 1842 in dnode2 -# step 6: insert two data rows: now-16d, now+16d -# step 7: restart dnode2, waiting sync end -# expect: in dnode2, the files 1840 and 1842 will be removed - -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 2000 - -$totalTableNum = 1 -$sleepTimer = 3000 - -$db = db -sql create database $db replica 2 cache 1 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 double) tags(t1 int) -$rowNum = 130000 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -# insert over 2M data in order to falling disc, generate one file -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum -# $ts = $tsStart + $x - sql insert into $tb values ( now + 0s , $x ) ( now + 1s , $x ) ( now + 2s , $x ) ( now + 3s , $x ) ( now + 4s , $x ) ( now + 5s , $x ) ( now + 6s , $x ) ( now + 7s , $x ) ( now + 8s , $x ) ( now + 9s , $x ) - $x = $x + 10 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql show db.vgroups; -print d1: $data04 $data05 , d2: $data06 $data07 - -sql select count(*) from $stb -print rtest1==> rows:$rows data00:$data00 -if $rows != 1 then - return -1 -endi - -if $data00 == 0 then - return -1 -endi - -$totalRows = $data00 - -sql select count(*) from $stb -print test2==> rows:$rows data00:$data00 -sql select count(*) from $stb -print test3==> rows:$rows data00:$data00 -sql select count(*) from $stb -print test4==> rows:$rows data00:$data00 -sql select count(*) from $stb -print test5==> rows:$rows data00:$data00 - -print ============== step3: insert old data(now-15d) and new data(now+15d), control data rows in order to save in cache, not falling disc -sql insert into $tb values ( now - 20d , -20 ) -sql insert into $tb values ( now - 40d , -40 ) -$totalRows = $totalRows + 2 - -print ============== step4: stop dnode2, so date rows falling disc, generate two new files in dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode2_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode3Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi - -sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3 -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -sql select count(*) from $stb -print data00 $data00 -sql select count(*) from $stb -print data00 $data00 -sql select count(*) from $stb -print data00 $data00 - -print ============== step5: insert two data rows: now-16d, now+16d, -sql insert into $tb values ( now - 21d , -21 ) -sql insert into $tb values ( now - 41d , -41 ) -$totalRows = $totalRows + 2 - -print ============== step6: restart dnode2, waiting sync end -system sh/exec.sh -n dnode2 -s start -sleep 2000 -$loopCnt = 0 -wait_dnode2_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode2_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode2_ready -endi - -sleep $sleepTimer -# check using select -sleep 3000 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi diff --git a/tests/script/tsim/backup/arbitrator/offline_replica2_alterTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_alterTable_online.sim deleted file mode 100644 index f93332a21a89dd5afebe529fb6f28466db3b2c21..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica2_alterTable_online.sim +++ /dev/null @@ -1,217 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer - -$loopCnt = 0 -wait_dnode4_offline_0: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -wait_dnode4_vgroup_offline: -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: alter table and insert more data rows -sql alter table $stb drop column c1 -sql alter table $stb add column f1 double - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql insert into $tb values (now, 10001, 1.0001) (now + 1s, 10002, 1.0002) (now + 2s, 10003, 1.0003) (now + 3s, 10004, 1.0004) - $i = $i + 1 -endw -$addRows = 4 * $tblNum -$totalRows = $totalRows + $addRows - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$loopCnt = 0 -wait_dnode4_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 totalRows: $totalRows - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica2_alterTag_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_alterTag_online.sim deleted file mode 100644 index 873005daf5b76ea7c2ffd139b2d8d6dd9a175789..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica2_alterTag_online.sim +++ /dev/null @@ -1,247 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -#system sh/cfg.sh -n dnode1 -c role -v 1 -#system sh/cfg.sh -n dnode2 -c role -v 2 -#system sh/cfg.sh -n dnode3 -c role -v 2 -#system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i , $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: alter table and tag, then drop all sub tables, recreate som subtable and insert more data rows -sql alter table $stb drop column c1 -sql alter table $stb add column f1 double - -sql alter table $stb add tag t2 int -sql alter table $stb add tag t3 int -sql alter table $stb drop tag t1 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql drop table $tb - $i = $i + 1 -endw - -$totalRows = 0 -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i , $i , $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 totalRows: $totalRows - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica2_createTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_createTable_online.sim deleted file mode 100644 index 02625ba49016e4c03e3133fa07d4bfedeff2c292..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica2_createTable_online.sim +++ /dev/null @@ -1,233 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20 - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: create more tables and insert data rows -$tsStart = $tsEnd + 1000 -$i = $tblNum -$tblNum = $tblNum * 2 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 - sleep 2000 - goto wait_table_altered -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica2_dropDb_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_dropDb_online.sim deleted file mode 100644 index 3b8dbeb637775189c861cb26e88413d38b5805d5..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica2_dropDb_online.sim +++ /dev/null @@ -1,180 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: drop db -sql drop database $db - -print ============== step5: restart dnode4 -system sh/exec.sh -n dnode4 -s start - -print ============== step6: check result -sql reset query cache -$cnt = 0 -wait_database_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_databases -if $rows != 0 then - sleep 2000 - goto wait_database_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica2_dropTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_dropTable_online.sim deleted file mode 100644 index a6d84da45a37be8dc5a8ed32e82d36011da4bdf8..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica2_dropTable_online.sim +++ /dev/null @@ -1,219 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: drop some tables -$i = 1 -$dropTblNum = 6 - -while $i < $dropTblNum - $tb = tb . $i - sql drop table if exists $tb - $i = $i + 1 -endw -$tblNum = $tblNum - 5 - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(tbname) from $stb -if $data00 != $tblNum then - print data00: $data00 tblNum: $tblNum - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica3_alterTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_alterTable_online.sim deleted file mode 100644 index 42be85bf4b490221ad09723678ac13fcbb3f65a7..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica3_alterTable_online.sim +++ /dev/null @@ -1,221 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int, c2 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: alter table and insert more data rows -sql alter table $stb drop column c1 -sql alter table $stb add column f1 double - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql insert into $tb values (now, 10001, 1.0001) (now + 1s, 10002, 1.0002) (now + 2s, 10003, 1.0003) (now + 3s, 10004, 1.0004) - $i = $i + 1 -endw -$addRows = 4 * $tblNum -$totalRows = $totalRows + $addRows - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 totalRows: $totalRows - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica3_alterTag_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_alterTag_online.sim deleted file mode 100644 index 212c9130df6d97d6dcf44c06a60077d1d0d04d77..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica3_alterTag_online.sim +++ /dev/null @@ -1,247 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -#system sh/cfg.sh -n dnode1 -c role -v 1 -#system sh/cfg.sh -n dnode2 -c role -v 2 -#system sh/cfg.sh -n dnode3 -c role -v 2 -#system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20 - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int, c2 int) tags(t0 int, t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i , $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: alter table and tag, then drop all sub tables, recreate som subtable and insert more data rows -sql alter table $stb drop column c1 -sql alter table $stb add column f1 double - -sql alter table $stb add tag t2 int -sql alter table $stb add tag t3 int -sql alter table $stb drop tag t1 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql drop table $tb - $i = $i + 1 -endw - -$totalRows = 0 -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i , $i , $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x , $x ) ( $ts + 1a , $x , $x ) ( $ts + 2a , $x , $x ) ( $ts + 3a , $x , $x ) ( $ts + 4a , $x , $x ) ( $ts + 5a , $x , $x ) ( $ts + 6a , $x , $x ) ( $ts + 7a , $x , $x ) ( $ts + 8a , $x , $x ) ( $ts + 9a , $x , $x ) ( $ts + 10a , $x , $x ) ( $ts + 11a , $x , $x ) ( $ts + 12a , $x , $x ) ( $ts + 13a , $x , $x ) ( $ts + 14a , $x , $x ) ( $ts + 15a , $x , $x ) ( $ts + 16a , $x , $x ) ( $ts + 17a , $x , $x ) ( $ts + 18a , $x , $x ) ( $ts + 19a , $x , $x ) - $x = $x + 20 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 totalRows: $totalRows - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica3_createTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_createTable_online.sim deleted file mode 100644 index ae26952b6bc60729b7c274785953b0045b5f238b..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica3_createTable_online.sim +++ /dev/null @@ -1,234 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 20 -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 20 - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 -$maxTables = $totalTableNum * 2 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: create more tables and insert data rows -$tsStart = $tsEnd + 1000 -$i = $tblNum -$tblNum = $tblNum * 2 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 - sleep 2000 - goto wait_table_altered -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica3_dropDb_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_dropDb_online.sim deleted file mode 100644 index a8143b2c75c32ba515b0d200acc062d60fd2b804..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica3_dropDb_online.sim +++ /dev/null @@ -1,180 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: drop db -sql drop database $db - -print ============== step5: restart dnode4 -system sh/exec.sh -n dnode4 -s start - -print ============== step6: check result -sql reset query cache -$cnt = 0 -wait_database_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_databases -if $rows != 0 then - sleep 2000 - goto wait_database_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/offline_replica3_dropTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_dropTable_online.sim deleted file mode 100644 index c606d2a38f8beaf3f9d5f66787695bd3bc3a930e..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/offline_replica3_dropTable_online.sim +++ /dev/null @@ -1,219 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: drop some tables -$i = 1 -$dropTblNum = 6 - -while $i < $dropTblNum - $tb = tb . $i - sql drop table if exists $tb - $i = $i + 1 -endw -$tblNum = $tblNum - 5 - -print ============== step5: restart dnode4, waiting dnode4 synced -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -#$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -print ============== step6: check result - -sql reset query cache - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(tbname) from $stb -if $data00 != $tblNum then - print data00: $data00 tblNum: $tblNum - sleep 2000 - goto wait_table_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/replica_changeWithArbitrator.sim b/tests/script/tsim/backup/arbitrator/replica_changeWithArbitrator.sim deleted file mode 100644 index b34f1c8304ef151671e9f41482a5b5d786a03f2e..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/replica_changeWithArbitrator.sim +++ /dev/null @@ -1,238 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c role -v 0 -system sh/cfg.sh -n dnode2 -c role -v 0 -system sh/cfg.sh -n dnode3 -c role -v 0 -system sh/cfg.sh -n dnode4 -c role -v 0 - -$totalTableNum = 12 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 8 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 8 - -system sh/cfg.sh -n dnode1 -c statusInterval -v 3 -system sh/cfg.sh -n dnode2 -c statusInterval -v 3 -system sh/cfg.sh -n dnode3 -c statusInterval -v 3 -system sh/cfg.sh -n dnode4 -c statusInterval -v 3 - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: replica is 1, and start 1 dnode, then create tables and insert data -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -$totalTableNum = 12 - -$db = db -sql create database $db replica 1 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 10 -$tblNum = $totalTableNum -$totalRows = $rowNum * $tblNum - -$ts0 = 1420041600000 -$ts = $ts0 -$delta = 1 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $xs = $x * $delta - $ts = $ts0 + $xs - sql insert into $tb values ( $ts , $x ) - $x = $x + 1 - endw - $i = $i + 1 - print $tb inserted rows: $x -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step2: add 1 new dnode, expect balanced -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname2 -sleep 2000 - -# expect after balanced, 2 vondes in dnode1, 1 vonde in dnode2 -$cnt = 0 -wait_dnode2_ready: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode2_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode2_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode2_ready -endi - -print ============== step3: stop dnode1/dnode2, modify cfg numOfMnodes to 2, and restart dnode1/dnode2 -system sh/exec.sh -n dnode1 -s stop -system sh/exec.sh -n dnode2 -s stop -sleep 2000 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 2 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 0 - -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 3000 - - -print ============= step4: wait dnode ready -$cnt = 0 -wait_dnode_ready: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode_ready -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: stop dnode1 -sleep 3000 -system sh/exec.sh -n dnode1 -s stop -sleep 2000 - -$cnt = 0 -wait_dnode2_master: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_mnodes -if $rows != 2 then - sleep 2000 - goto wait_dnode2_master -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -#print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $data2_1 != offline then - sleep 2000 - goto wait_dnode2_master -endi -if $data2_2 != master then - sleep 2000 - goto wait_dnode2_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_add.sim deleted file mode 100644 index 23d22e4f7f60a802c4b57c79553b930c64bfb879..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_add.sim +++ /dev/null @@ -1,204 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_alterTable_background_add.sim - -print ============== step6: check result -#in background.sim, add one column and insert 36 rows -$totalRows = $totalRows + 36 - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00:$data00 totalRows:$totalRows - sleep 2000 - goto wait_table_altered -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_drop.sim deleted file mode 100644 index 3fc28f4d8127ff9af76d8093627de949a6c625c6..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_drop.sim +++ /dev/null @@ -1,204 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_alterTable_background_drop.sim - -print ============== step6: check result -#in background.sim, drop one column and add one new column, then insert 36 rows -$totalRows = $totalRows + 36 - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 - sleep 2000 - goto wait_table_altered -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica2_dropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_dropDb.sim deleted file mode 100644 index 808bc1109ebaf8b4533aaafb58c36e95812d9000..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica2_dropDb.sim +++ /dev/null @@ -1,200 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -#$dnode3Status = $data4_3 -$dnode4Status = $data4_3 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while drop database in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_dropDb_background.sim - -print ============== step6: check result -$cnt = 0 -wait_database_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_databases -if $rows != 0 then - sleep 2000 - goto wait_database_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica2_dropTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_dropTable.sim deleted file mode 100644 index 710c72fbd3e506faa34a972a312d0bf098ac0e8e..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica2_dropTable.sim +++ /dev/null @@ -1,210 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -#system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -#sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 2 -sql create database $db replica 2 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode4Status = $data4_3 -#$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while drop some tables in other thread when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_dropTable_background.sim - -print ============== step6: check result -#in background.sim, drop 5 tables -$totalRows = $totalRows - 5400 - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00:$data00 totalRows:$totalRows - sleep 2000 - goto wait_table_dropped -endi - -$tblNum = $tblNum - 5 -sql select count(tbname) from $stb -if $data00 != $tblNum then - print data00: $data00 tblNum: $tblNum - sleep 2000 - goto wait_table_dropped -endi - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_add.sim deleted file mode 100644 index 024d38da06489fec65a573cd6c94629f5c9d79f7..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_add.sim +++ /dev/null @@ -1,198 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -$dnode4Vtatus = $data05 -$dnode3Vtatus = $data07 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_alterTable_background_add.sim - -print ============== step6: check result -#in background.sim, add one column and insert 36 rows -$totalRows = $totalRows + 36 - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00:$data00 totalRows:$totalRows - sleep 2000 - goto wait_table_altered -endi diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_drop.sim deleted file mode 100644 index 5dd716ce971bee71a696e29946cf411123e01101..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_drop.sim +++ /dev/null @@ -1,204 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_alterTable_background_drop.sim - -print ============== step6: check result -#in background.sim, drop one column and add one new column, then insert 36 rows -$totalRows = $totalRows + 36 - -$cnt = 0 -wait_table_altered: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00: $data00 - sleep 2000 - goto wait_table_altered -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_createTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_createTable.sim deleted file mode 100644 index f085ab4340c99271d47af5177c37c157fc1ef353..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_createTable.sim +++ /dev/null @@ -1,212 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 20 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = 10 -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while alter table and insert data in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_createTable_background_add.sim - -print ============== step6: check result -#in background.sim, add 10 tables and insert 100 rows -$totalRows = $totalRows + 100 - -$cnt = 0 -wait_table_created: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi - -sql show tables -if $rows != $totalTableNum then - print rows:$rows totalTableNum:$totalTableNum - sleep 2000 - goto wait_table_created -endi - -sql select count(*) from $stb -if $data00 != $totalRows then - print data00:$data00 totalRows:$totalRows - sleep 2000 - goto wait_table_created -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim deleted file mode 100644 index ed2dc120afeeedef2a4ea1f6f21c9d02e4de0813..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim +++ /dev/null @@ -1,485 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 40 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 20 -$sleepTimer = 3000 - -$maxTables = $totalTableNum * 2 -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = 10 -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - $x = $x + 10 - - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: drop some tables -sql drop table tb0 -sql drop table tb9 -sql drop table tb1 -sql drop table tb8 - -$totalRows = $totalRows - 40 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready -endi - -$cnt = 0 -wait_dnode4_vgroup_slave: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave -endi - -print ============== step6: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep 1000 -system rm -rf ../../../sim/dnode2/data -system rm -rf ../../../sim/dnode3/data - -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$cnt = 0 -wait_dnode4_vgroup_master: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step7: stop dnode4 and create some new tables -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -$ts = $tsStart -sql insert into tb10 using stb tags(10) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) -sql insert into tb11 using stb tags(11) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) -sql insert into tb12 using stb tags(12) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) -sql insert into tb13 using stb tags(13) values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - -$totalRows = $totalRows + 40 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step8: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready_2: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready_2 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready_2 -endi - -$cnt = 0 -wait_dnode4_vgroup_slave_2: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave_2 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave_2 -endi - -print ============== step9: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep 1000 -system rm -rf ../../../sim/dnode2/data -system rm -rf ../../../sim/dnode3/data - -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$cnt = 0 -wait_dnode4_vgroup_master_2: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master_2 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master_2 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - - -print ============== step10: stop dnode4 and alter table column -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -sql alter table stb add column c2 int -sql alter table stb add column c3 int -sql alter table stb add column c4 int -sql alter table stb drop column c1 - -sql alter table stb add tag t2 int -sql alter table stb add tag t3 int -sql_error alter table stb drop tag t1 - -$ts = $tsEnd + 10000 -sql insert into tb2 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb3 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb4 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb5 values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) - - -$ts = $tsStart -sql insert into tb14 using stb tags(14, 14, 14) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb15 using stb tags(15, 15, 15) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb16 using stb tags(16, 16, 16) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) -sql insert into tb17 using stb tags(17, 17, 17) values ( $ts + 0a , $x , $x , $x ) ( $ts + 1a , $x , $x , $x ) ( $ts + 2a , $x , $x , $x ) ( $ts + 3a , $x , $x , $x ) ( $ts + 4a , $x , $x , $x ) ( $ts + 5a , $x , $x , $x ) ( $ts + 6a , $x , $x , $x ) ( $ts + 7a , $x , $x , $x ) ( $ts + 8a , $x , $x , $x ) ( $ts + 9a , $x , $x , $x ) - -$totalRows = $totalRows + 80 -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step11: restart dnode4, waiting sync end -system sh/exec.sh -n dnode4 -s start - -$cnt = 0 -wait_dnode4_ready_3: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 4 then - sleep 2000 - goto wait_dnode4_ready_3 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 - -if $dnode4Status != ready then - sleep 2000 - goto wait_dnode4_ready_3 -endi - -$cnt = 0 -wait_dnode4_vgroup_slave_3: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_slave_3 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != slave then - sleep 2000 - goto wait_dnode4_vgroup_slave_3 -endi - -print ============== step12: stop dnode2/dnode3 and remove their data dir, and restart dnode2/dnode3 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sleep 1000 -system rm -rf ../../../sim/dnode2/data -system rm -rf ../../../sim/dnode3/data - -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$cnt = 0 -wait_dnode4_vgroup_master_3: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_master_3 -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_master_3 -endi - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_dropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dropDb.sim deleted file mode 100644 index a3d0d84f71248ca201850ff070ed75625c881af9..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_dropDb.sim +++ /dev/null @@ -1,200 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while drop database in other thead when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_dropDb_background.sim - -print ============== step6: check result -$cnt = 0 -wait_database_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select * from information_schema.ins_databases -if $rows != 0 then - sleep 2000 - goto wait_database_dropped -endi - - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica3_dropTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dropTable.sim deleted file mode 100644 index a214fdeb22e6e0e2afe28d6f0fd23f9bae5aa8d8..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica3_dropTable.sim +++ /dev/null @@ -1,210 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 -system sh/cfg.sh -n dnode4 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -$totalTableNum = 10 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v $totalTableNum -system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v $totalTableNum - -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 1 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 1 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3/dnode4 and add into cluster , then create database with replica 3, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sleep 2000 - -$totalTableNum = 10 -$sleepTimer = 3000 - -$db = db -print create database $db replica 3 -sql create database $db replica 3 -sql use $db - -# create table , insert data -$stb = stb -sql create table $stb (ts timestamp, c1 int) tags(t1 int) -$rowNum = 500 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1420041600000 -$tsEnd = 0 - -$i = 0 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw -$tsEnd = $tsStart + $totalRows / $tblNum - -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -print ============== step3: stop dnode4 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -sleep $sleepTimer -$cnt = 0 -wait_dnode4_offline_0: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql select * from information_schema.ins_dnodes -if $rows != 5 then - sleep 2000 - goto wait_dnode4_offline_0 -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 -#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 -#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5 -#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6 -#$dnode1Status = $data4_1 -$dnode2Status = $data4_2 -$dnode3Status = $data4_3 -$dnode4Status = $data4_4 -#$dnode5Status = $data4_5 - -if $dnode4Status != offline then - sleep 2000 - goto wait_dnode4_offline_0 -endi - -$cnt = 0 -wait_dnode4_vgroup_offline: -$cnt = $cnt + 1 -if $cnt == 10 then - return -1 -endi -sql show vgroups -if $rows != 1 then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -print show vgroups: -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 -print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 -$dnode4Vtatus = $data5_2 -$dnode3Vtatus = $data7_2 - -if $dnode4Vtatus != offline then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi -if $dnode3Vtatus != master then - sleep 2000 - goto wait_dnode4_vgroup_offline -endi - -print ============== step4: insert more data rows -$tsStart = $tsEnd + 1000 -$i = 0 -while $i < $tblNum - $tb = tb . $i - - $x = 0 - while $x < $rowNum - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) ( $ts + 10a , $x ) ( $ts + 11a , $x ) ( $ts + 12a , $x ) ( $ts + 13a , $x ) ( $ts + 14a , $x ) ( $ts + 15a , $x ) ( $ts + 16a , $x ) ( $ts + 17a , $x ) ( $ts + 18a , $x ) ( $ts + 19a , $x ) ( $ts + 20a , $x ) ( $ts + 21a , $x ) ( $ts + 22a , $x ) ( $ts + 23a , $x ) ( $ts + 24a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 25a , $x ) ( $ts + 26a , $x ) ( $ts + 27a , $x ) ( $ts + 28a , $x ) ( $ts + 29a , $x ) ( $ts + 30a , $x ) ( $ts + 31a , $x ) ( $ts + 32a , $x ) ( $ts + 33a , $x ) ( $ts + 34a , $x ) ( $ts + 35a , $x ) ( $ts + 36a , $x ) ( $ts + 37a , $x ) ( $ts + 38a , $x ) ( $ts + 39a , $x ) ( $ts + 40a , $x ) ( $ts + 41a , $x ) ( $ts + 42a , $x ) ( $ts + 43a , $x ) ( $ts + 44a , $x ) ( $ts + 45a , $x ) ( $ts + 46a , $x ) ( $ts + 47a , $x ) ( $ts + 48a , $x ) ( $ts + 49a , $x ) ( $ts + 50a , $x ) ( $ts + 51a , $x ) ( $ts + 52a , $x ) ( $ts + 53a , $x ) ( $ts + 54a , $x ) ( $ts + 55a , $x ) ( $ts + 56a , $x ) ( $ts + 57a , $x ) ( $ts + 58a , $x ) ( $ts + 59a , $x ) - $x = $x + 60 - endw - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - -sql select count(*) from $stb -print data00:$data00 totalRows:$totalRows -if $data00 != $totalRows then - return -1 -endi - -print ============== step5: restart dnode4, while drop some tables in other thread when dnode4 is syncing -system sh/exec.sh -n dnode4 -s start -run_back unique/arbitrator/sync_replica_dropTable_background.sim - -print ============== step6: check result -#in background.sim, drop 5 tables -$totalRows = $totalRows - 5400 - -$cnt = 0 -wait_table_dropped: -$cnt = $cnt + 1 -if $cnt == 20 then - return -1 -endi -sql select count(*) from $stb -if $data00 != $totalRows then - print data00:$data00 totalRows:$totalRows - sleep 2000 - goto wait_table_dropped -endi - -$tblNum = $tblNum - 5 -sql select count(tbname) from $stb -if $data00 != $tblNum then - print data00: $data00 tblNum: $tblNum - sleep 2000 - goto wait_table_dropped -endi - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_add.sim deleted file mode 100644 index 46d5e34fcbf8d70b4f678fc8e5abf311c9363ce8..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_add.sim +++ /dev/null @@ -1,28 +0,0 @@ -sql connect - -$db = db -$stb = stb -print =============== sync_replica_alterTable_background_add.sim step0: alter table and insert data -$totalTableNum = 10 - -sql use $db - -#sql create table $stb (ts timestamp, c1 int) tags(t1 int) -print alter table $stb add column f1 float -sql alter table $stb add column f1 float - -$tblNum = $totalTableNum -$alterTblNum = 10 - -sql reset query cache -sleep 100 - -$i = 1 -while $i < $alterTblNum - $tb = tb . $i - sql insert into $tb values (now, 10001, 10001) (now + 1s, 10002, 10002) (now + 2s, 10003, 10003) (now + 3s, 10004, 10004) - $i = $i + 1 -endw - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_drop.sim deleted file mode 100644 index fb8bc60972e7ac5a2d5f1393fd5760168c3d843d..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_drop.sim +++ /dev/null @@ -1,25 +0,0 @@ -sql connect - -$db = db -$stb = stb -print =============== sync_replica_alterTable_background_drop.sim step0: alter table and insert data -$totalTableNum = 100 - -sql use $db - -#sql create table $stb (ts timestamp, c1 int) tags(t1 int) -sql alter table $stb add column f1 double -sql alter table $stb drop column c1 - -$tblNum = $totalTableNum -$alterTblNum = 10 - -$i = 1 -while $i < $alterTblNum - $tb = tb . $i - sql insert into $tb values (now, 10001) (now + 1s, 10002) (now + 2s, 10003) (now + 3s, 10004) - $i = $i + 1 -endw - - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica_createTable_background_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica_createTable_background_add.sim deleted file mode 100644 index 50893b58a6125cfa3ae15e0472b78538f2c9256e..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica_createTable_background_add.sim +++ /dev/null @@ -1,32 +0,0 @@ -sql connect - -$db = db -$stb = stb -print =============== sync_replica_createTable_background_add.sim step0: create table and insert data -$totalTableNum = 10 - -sql use $db - -#sql create table $stb (ts timestamp, c1 int) tags(t1 int) -# create table , insert data -#$rowNum = 500 -$tblNum = 20 -$totalRows = 100 -$tsStart = 1420141600000 -$tsEnd = 0 - -$i = 10 -while $i < $tblNum - $tb = tb . $i - sql create table $tb using $stb tags( $i ) - - $x = 10 - $ts = $tsStart + $x - sql insert into $tb values ( $ts + 0a , $x ) ( $ts + 1a , $x ) ( $ts + 2a , $x ) ( $ts + 3a , $x ) ( $ts + 4a , $x ) ( $ts + 5a , $x ) ( $ts + 6a , $x ) ( $ts + 7a , $x ) ( $ts + 8a , $x ) ( $ts + 9a , $x ) - - $totalRows = $totalRows + $x - print info: inserted $x rows into $tb and totalRows: $totalRows - $i = $i + 1 -endw - - diff --git a/tests/script/tsim/backup/arbitrator/sync_replica_dropDb_background.sim b/tests/script/tsim/backup/arbitrator/sync_replica_dropDb_background.sim deleted file mode 100644 index 440b525bd7b8b5a1beebc4b10aa89f410d597d77..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica_dropDb_background.sim +++ /dev/null @@ -1,6 +0,0 @@ -sql connect - -$db = db -$stb = stb -print =============== sync_replica_dropDb_background.sim step0: drop db -sql drop database if exists $db diff --git a/tests/script/tsim/backup/arbitrator/sync_replica_dropTable_background.sim b/tests/script/tsim/backup/arbitrator/sync_replica_dropTable_background.sim deleted file mode 100644 index 485253027a5d4521aac63ab8ad6f5f7ffba726e9..0000000000000000000000000000000000000000 --- a/tests/script/tsim/backup/arbitrator/sync_replica_dropTable_background.sim +++ /dev/null @@ -1,18 +0,0 @@ -sql connect - -$db = db -$stb = stb -print =============== sync_replica_dropTable_background.sim step0: drop table -$totalTableNum = 6 - -sql use $db - -$tblNum = $totalTableNum -$dropTblNum = 6 - -$i = 1 -while $i < $dropTblNum - $tb = tb . $i - sql drop table if exists $tb - $i = $i + 1 -endw diff --git a/tests/script/tsim/db/alter_replica_13.sim b/tests/script/tsim/db/alter_replica_13.sim index b3231cc24b57cf3ce3e5eea205ccb06fa11df853..4eafb8619857c1ca50d64f642e681ec4d956d15d 100644 --- a/tests/script/tsim/db/alter_replica_13.sim +++ b/tests/script/tsim/db/alter_replica_13.sim @@ -3,6 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 0 system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start @@ -34,7 +35,7 @@ if $data(2)[4] != ready then endi print =============== step2: create database -sql create database db vgroups 1 +sql create database db vgroups 4 sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -43,14 +44,9 @@ if $data(db)[4] != 1 then return -1 endi -sql select * from information_schema.ins_dnodes -if $data(2)[2] != 1 then - return -1 -endi - # vnodes sql select * from information_schema.ins_dnodes -if $data(2)[2] != 1 then +if $data(2)[2] != 4 then return -1 endi @@ -61,13 +57,28 @@ if $data(2)[3] != 2 then endi sql_error alter database db replica 3 + sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 binary(16)) comment "abd" -sql create table db.ctb using db.stb tags(101, "102") -sql insert into db.ctb values(now, 1, "2") -sql select * from db.stb -if $rows != 1 then - return -1 -endi +sql create table db.ctb0 using db.stb tags(100, "100") +sql create table db.ctb1 using db.stb tags(101, "101") +sql create table db.ctb2 using db.stb tags(102, "102") +sql create table db.ctb3 using db.stb tags(103, "103") +sql create table db.ctb4 using db.stb tags(104, "104") +sql create table db.ctb5 using db.stb tags(105, "105") +sql create table db.ctb6 using db.stb tags(106, "106") +sql create table db.ctb7 using db.stb tags(107, "107") +sql create table db.ctb8 using db.stb tags(108, "108") +sql create table db.ctb9 using db.stb tags(109, "109") +sql insert into db.ctb0 values(now, 0, "0") +sql insert into db.ctb1 values(now, 1, "1") +sql insert into db.ctb2 values(now, 2, "2") +sql insert into db.ctb3 values(now, 3, "3") +sql insert into db.ctb4 values(now, 4, "4") +sql insert into db.ctb5 values(now, 5, "5") +sql insert into db.ctb6 values(now, 6, "6") +sql insert into db.ctb7 values(now, 7, "7") +sql insert into db.ctb8 values(now, 8, "8") +sql insert into db.ctb9 values(now, 9, "9") print =============== step3: create dnodes sql create dnode $hostname port 7300 @@ -106,6 +117,8 @@ endi print ============= step4: alter database sql alter database db replica 3 +$leaderIndex = 0 + $x = 0 step4: $x = $x + 1 @@ -114,46 +127,73 @@ step4: print ====> dnode not ready! return -1 endi + sql show db.vgroups print ===> rows: $rows print ===> $data00 $data01 $data02 $data03 $data04 $data05 -if $data[0][4] != leader then - goto step4 +if $data[0][4] == leader then + $leaderIndex = 1 endi -if $data[0][6] != follower then - goto step4 +if $data[0][6] == leader then + $leaderIndex = 2 endi -if $data[0][8] != follower then +if $data[0][8] == leader then + $leaderIndex = 3 +endi + +if $$leaderIndex == 0 then goto step4 endi +print leaderIndex ==> $leaderIndex + print ============= step5: result $i = 0 while $i < 10 $i = $i + 1 sleep 1000 + $leaderIndex2 = 0 sql show db.vgroups print ===> loop: $i | v0: $data03 $data04 | v1: $data05 $data06 | v2: $data07 $data08 - if $data[0][4] != leader then - return -1 + if $data[0][4] == leader then + $leaderIndex2 = 1 endi if $data[0][6] == leader then - return -1 + $leaderIndex2 = 2 endi if $data[0][8] == leader then + $leaderIndex2 = 3 + endi + + print leaderIndex2 ==> $leaderIndex2 + if $leaderIndex2 != $leaderIndex then return -1 endi + endw +print ============= step5: check data +sql select * from db.ctb0 +if $rows != 1 then + return -1 +endi -print ============= step5: stop dnode 2 -sql select * from db.stb +sql select * from db.ctb1 if $rows != 1 then return -1 endi -return +sql select * from db.ctb2 +if $rows != 1 then + return -1 +endi + +sql select * from db.stb +if $rows != 10 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode2 -s stop -x SIGINT system sh/exec.sh -n dnode3 -s stop -x SIGINT diff --git a/tests/script/tsim/db/alter_replica_31.sim b/tests/script/tsim/db/alter_replica_31.sim index 4ab6783d0702197fe32f34830a67c3cc64a7b4a7..47e1fda79feaa221d0f8ee863214aa52160c6a38 100644 --- a/tests/script/tsim/db/alter_replica_31.sim +++ b/tests/script/tsim/db/alter_replica_31.sim @@ -3,6 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 0 system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start @@ -45,7 +46,7 @@ if $data(4)[4] != ready then endi print =============== step2: create database -sql create database db vgroups 1 replica 3 +sql create database db vgroups 4 replica 3 sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -54,26 +55,15 @@ 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 +if $data(2)[2] != 4 then return -1 endi -if $data(3)[2] != 1 then +if $data(3)[2] != 4 then return -1 endi -if $data(4)[2] != 1 then +if $data(4)[2] != 4 then return -1 endi @@ -112,20 +102,50 @@ if $hasleader != 1 then endi sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 binary(16)) comment "abd" -sql create table db.ctb using db.stb tags(101, "102") -sql insert into db.ctb values(now, 1, "2") +sql create table db.ctb0 using db.stb tags(100, "100") +sql create table db.ctb1 using db.stb tags(101, "101") +sql create table db.ctb2 using db.stb tags(102, "102") +sql create table db.ctb3 using db.stb tags(103, "103") +sql create table db.ctb4 using db.stb tags(104, "104") +sql create table db.ctb5 using db.stb tags(105, "105") +sql create table db.ctb6 using db.stb tags(106, "106") +sql create table db.ctb7 using db.stb tags(107, "107") +sql create table db.ctb8 using db.stb tags(108, "108") +sql create table db.ctb9 using db.stb tags(109, "109") +sql insert into db.ctb0 values(now, 0, "0") +sql insert into db.ctb1 values(now, 1, "1") +sql insert into db.ctb2 values(now, 2, "2") +sql insert into db.ctb3 values(now, 3, "3") +sql insert into db.ctb4 values(now, 4, "4") +sql insert into db.ctb5 values(now, 5, "5") +sql insert into db.ctb6 values(now, 6, "6") +sql insert into db.ctb7 values(now, 7, "7") +sql insert into db.ctb8 values(now, 8, "8") +sql insert into db.ctb9 values(now, 9, "9") sql show db.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 -sleep 100 -sql select * from db.ctb -print ===> $data00 $data01 $data02 $data03 $data04 $data05 +sql select * from db.ctb0 +if $rows != 1 then + return -1 +endi +sql select * from db.ctb1 if $rows != 1 then return -1 endi +sql select * from db.ctb2 +if $rows != 1 then + return -1 +endi + +sql select * from db.stb +if $rows != 10 then + return -1 +endi + print ============= step3: alter database sql alter database db replica 1 $hasleader = 0 @@ -140,7 +160,7 @@ step3: endi sql show db.vgroups print ===> rows: $rows -if $rows != 1 then +if $rows != 4 then goto step3 endi if $data(2)[4] == leader then @@ -157,11 +177,26 @@ if $hasleader != 1 then endi print ============= step5: stop dnode 2 -sql select * from db.stb +sql select * from db.ctb0 +if $rows != 1 then + return -1 +endi + +sql select * from db.ctb1 if $rows != 1 then return -1 endi +sql select * from db.ctb2 +if $rows != 1 then + return -1 +endi + +sql select * from db.stb +if $rows != 10 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode2 -s stop -x SIGINT system sh/exec.sh -n dnode3 -s stop -x SIGINT