diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 8565eea63b..967b5796ec 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -615,6 +615,7 @@ int32_t* taosGetErrno(); //rsma #define TSDB_CODE_RSMA_INVALID_ENV TAOS_DEF_ERROR_CODE(0, 0x3150) #define TSDB_CODE_RSMA_INVALID_STAT TAOS_DEF_ERROR_CODE(0, 0x3151) +#define TSDB_CODE_RSMA_QTASKINFO_CREATE TAOS_DEF_ERROR_CODE(0, 0x3152) //index #define TSDB_CODE_INDEX_REBUILDING TAOS_DEF_ERROR_CODE(0, 0x3200) diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 34c3ef8fca..4402f37c34 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -40,6 +40,10 @@ static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskInfoIter *pIter, bool *isF static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter); static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *infoItem); +static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma); +static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma); +static int32_t tdRSmaRestoreTSDataReload(SSma *pSma); + struct SRSmaInfoItem { SRSmaInfo *pRsmaInfo; void *taskInfo; // qTaskInfo_t @@ -246,6 +250,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaInfo pItem->pRsmaInfo = pRSmaInfo; pItem->taskInfo = qCreateStreamExecTaskInfo(param->qmsg[idx], pReadHandle); if (!pItem->taskInfo) { + terrno = TSDB_CODE_RSMA_QTASKINFO_CREATE; goto _err; } pItem->triggerStat = TASK_TRIGGER_STAT_INACTIVE; @@ -696,10 +701,9 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pMsg, int32_t inputType) { return TSDB_CODE_SUCCESS; } -int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { +static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma) { SVnode *pVnode = pSma->pVnode; - // step 1: iterate all stables to restore the rsma env SArray *suidList = taosArrayInit(1, sizeof(tb_uid_t)); if (tsdbGetStbIdList(SMA_META(pSma), 0, suidList) < 0) { taosArrayDestroy(suidList); @@ -741,42 +745,88 @@ int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { } } - // step 2: retrieve qtaskinfo items from the persistence file(rsma/qtaskinfo) and restore - STFile tFile = {0}; - char qTaskInfoFName[TSDB_FILENAME_LEN]; + metaReaderClear(&mr); + taosArrayDestroy(suidList); + + return TSDB_CODE_SUCCESS; +_err: + metaReaderClear(&mr); + taosArrayDestroy(suidList); + + return TSDB_CODE_FAILED; +} + +static int32_t tdRSmaRestoreQTaskInfoReload(SSma *pSma) { + SVnode *pVnode = pSma->pVnode; + STFile tFile = {0}; + char qTaskInfoFName[TSDB_FILENAME_LEN]; tdRSmaQTaskInfoGetFName(TD_VID(pVnode), TD_QTASK_CUR_FILE, qTaskInfoFName); if (tdInitTFile(&tFile, pVnode->pTfs, qTaskInfoFName) < 0) { goto _err; } - - if(!taosCheckExistFile(TD_TFILE_FULL_NAME(&tFile))) { - metaReaderClear(&mr); - taosArrayDestroy(suidList); + + if (!taosCheckExistFile(TD_TFILE_FULL_NAME(&tFile))) { return TSDB_CODE_SUCCESS; } if (tdOpenTFile(&tFile, TD_FILE_READ) < 0) { goto _err; } - + SRSmaQTaskInfoIter fIter = {0}; if (tdRSmaQTaskInfoIterInit(&fIter, &tFile) < 0) { + tdRSmaQTaskInfoIterDestroy(&fIter); + tdCloseTFile(&tFile); goto _err; } - SRSmaQTaskInfoItem infoItem = {0}; + if (tdRSmaQTaskInfoRestore(pSma, &fIter) < 0) { tdRSmaQTaskInfoIterDestroy(&fIter); + tdCloseTFile(&tFile); goto _err; } tdRSmaQTaskInfoIterDestroy(&fIter); - metaReaderClear(&mr); - taosArrayDestroy(suidList); + tdCloseTFile(&tFile); + return TSDB_CODE_SUCCESS; +_err: + smaError("rsma restore, qtaskinfo reload failed since %s", terrstr()); + return TSDB_CODE_FAILED; +} + +/** + * @brief reload ts data from checkpoint + * + * @param pSma + * @return int32_t + */ +static int32_t tdRSmaRestoreTSDataReload(SSma *pSma) { + // TODO + return TSDB_CODE_SUCCESS; +_err: + smaError("rsma restore, ts data reload failed since %s", terrstr()); + return TSDB_CODE_FAILED; +} + +int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { + // step 1: iterate all stables to restore the rsma env + if (tdRSmaRestoreQTaskInfoInit(pSma) < 0) { + goto _err; + } + + // step 2: retrieve qtaskinfo items from the persistence file(rsma/qtaskinfo) and restore + if (tdRSmaRestoreQTaskInfoReload(pSma) < 0) { + goto _err; + } + + // step 3: reload ts data from checkpoint + if (tdRSmaRestoreTSDataReload(pSma) < 0) { + goto _err; + } + return TSDB_CODE_SUCCESS; _err: - metaReaderClear(&mr); - taosArrayDestroy(suidList); smaError("failed to restore rsma task since %s", terrstr()); return TSDB_CODE_FAILED; } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index fa10fc26dd..651fd90bcf 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -581,10 +581,10 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_INVALID_PTR, "Invalid tsma pointe TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_INVALID_PARA, "Invalid tsma parameters") TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_NO_INDEX_IN_CACHE, "No tsma index in cache") - //rsma TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_ENV, "Invalid rsma env") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state") +TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_QTASKINFO_CREATE, "Rsma qtaskinfo creation error") //tq TAOS_DEFINE_ERROR(TSDB_CODE_TQ_NO_COMMITTED_OFFSET, "No committed offset") diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 90bc4ab7c0..cc114ac55f 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -8,7 +8,6 @@ ./test.sh -f tsim/user/privilege_sysinfo.sim ## ---- db -./test.sh -f tsim/db/create_all_options.sim ./test.sh -f tsim/db/alter_option.sim ./test.sh -f tsim/db/alter_replica_13.sim ./test.sh -f tsim/db/alter_replica_31.sim @@ -17,6 +16,10 @@ ./test.sh -f tsim/db/basic3.sim ./test.sh -f tsim/db/basic6.sim ./test.sh -f tsim/db/basic7.sim +#./test.sh -f tsim/db/commit.sim +./test.sh -f tsim/db/create_all_options.sim +#./test.sh -f tsim/db/delete_part.sim +#./test.sh -f tsim/db/delete.sim ./test.sh -f tsim/db/error1.sim ./test.sh -f tsim/db/taosdlog.sim @@ -27,6 +30,13 @@ ./test.sh -f tsim/dnode/balance2.sim ./test.sh -f tsim/dnode/balance3.sim ./test.sh -f tsim/dnode/balancex.sim +#./test.sh -f tsim/dnode/cluster_alter.sim +#./test.sh -f tsim/dnode/cluster_balance1.sim +#./test.sh -f tsim/dnode/cluster_balance2.sim +#./test.sh -f tsim/dnode/cluster_balance3.sim +#./test.sh -f tsim/dnode/cluster_cache.sim +#./test.sh -f tsim/dnode/cluster_flowctrl.sim +#./test.sh -f tsim/dnode/cluster_vgroup100.sim ./test.sh -f tsim/dnode/create_dnode.sim ./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim @@ -78,7 +88,7 @@ ./test.sh -f tsim/mnode/basic2.sim ./test.sh -f tsim/mnode/basic3.sim ./test.sh -f tsim/mnode/basic4.sim -#./test.sh -f tsim/mnode/basic5.sim +./test.sh -f tsim/mnode/basic5.sim # ---- show ./test.sh -f tsim/show/basic.sim @@ -103,7 +113,6 @@ ./test.sh -f tsim/stream/schedSnode.sim ./test.sh -f tsim/stream/windowClose.sim - # ---- transaction ./test.sh -f tsim/trans/lossdata1.sim ./test.sh -f tsim/trans/create_db.sim @@ -168,6 +177,12 @@ ./test.sh -f tsim/vnode/replica3_vgroup.sim #./test.sh -f tsim/vnode/replica3_many.sim #./test.sh -f tsim/vnode/replica3_import.sim +./test.sh -f tsim/vnode/stable_balance_replica1.sim +./test.sh -f tsim/vnode/stable_dnode2_stop.sim +./test.sh -f tsim/vnode/stable_dnode2.sim +./test.sh -f tsim/vnode/stable_dnode3.sim +./test.sh -f tsim/vnode/stable_replica3_dnode6.sim +./test.sh -f tsim/vnode/stable_replica3_vnode3.sim # --- sync ./test.sh -f tsim/sync/3Replica1VgElect.sim diff --git a/tests/script/unique/arbitrator/check_cluster_cfg_para.sim b/tests/script/tsim/backup/arbitrator/check_cluster_cfg_para.sim similarity index 100% rename from tests/script/unique/arbitrator/check_cluster_cfg_para.sim rename to tests/script/tsim/backup/arbitrator/check_cluster_cfg_para.sim diff --git a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim b/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync.sim similarity index 100% rename from tests/script/unique/arbitrator/dn2_mn1_cache_file_sync.sim rename to tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync.sim diff --git a/tests/script/unique/arbitrator/dn2_mn1_cache_file_sync_second.sim b/tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync_second.sim similarity index 100% rename from tests/script/unique/arbitrator/dn2_mn1_cache_file_sync_second.sim rename to tests/script/tsim/backup/arbitrator/dn2_mn1_cache_file_sync_second.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_full_createTableFail.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_full_createTableFail.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_full_createTableFail.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_full_dropDnodeFail.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_full_dropDnodeFail.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_multiCreateDropTable.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_multiCreateDropTable.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_multiCreateDropTable.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_r2_vnode_delDir.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_r2_vnode_delDir.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_r3_vnode_delDir.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_r3_vnode_delDir.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_replica_change.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change_dropDnod.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_replica_change_dropDnod.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_stopDnode_timeout.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_stopDnode_timeout.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_stopDnode_timeout.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_change.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_change.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_change.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_online.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_corruptFile_online.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_createErrData_online.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_createErrData_online.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_delDir.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_delDir.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_delDir.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim diff --git a/tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim b/tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_nomaster.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn1_vnode_nomaster.sim diff --git a/tests/script/unique/arbitrator/dn3_mn2_killDnode.sim b/tests/script/tsim/backup/arbitrator/dn3_mn2_killDnode.sim similarity index 100% rename from tests/script/unique/arbitrator/dn3_mn2_killDnode.sim rename to tests/script/tsim/backup/arbitrator/dn3_mn2_killDnode.sim diff --git a/tests/script/unique/arbitrator/insert_duplicationTs.sim b/tests/script/tsim/backup/arbitrator/insert_duplicationTs.sim similarity index 100% rename from tests/script/unique/arbitrator/insert_duplicationTs.sim rename to tests/script/tsim/backup/arbitrator/insert_duplicationTs.sim diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_alterTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica2_alterTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica2_alterTable_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_alterTag_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica2_alterTag_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica2_alterTag_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica2_createTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_createTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica2_createTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica2_createTable_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_dropDb_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica2_dropDb_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica2_dropDb_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica2_dropTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica2_dropTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica2_dropTable_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_alterTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica3_alterTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica3_alterTable_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_alterTag_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica3_alterTag_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica3_alterTag_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica3_createTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_createTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica3_createTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica3_createTable_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_dropDb_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica3_dropDb_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica3_dropDb_online.sim diff --git a/tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim b/tests/script/tsim/backup/arbitrator/offline_replica3_dropTable_online.sim similarity index 100% rename from tests/script/unique/arbitrator/offline_replica3_dropTable_online.sim rename to tests/script/tsim/backup/arbitrator/offline_replica3_dropTable_online.sim diff --git a/tests/script/unique/arbitrator/replica_changeWithArbitrator.sim b/tests/script/tsim/backup/arbitrator/replica_changeWithArbitrator.sim similarity index 100% rename from tests/script/unique/arbitrator/replica_changeWithArbitrator.sim rename to tests/script/tsim/backup/arbitrator/replica_changeWithArbitrator.sim diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_add.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica2_alterTable_add.sim rename to tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_add.sim diff --git a/tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_drop.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica2_alterTable_drop.sim rename to tests/script/tsim/backup/arbitrator/sync_replica2_alterTable_drop.sim diff --git a/tests/script/unique/arbitrator/sync_replica2_dropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_dropDb.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica2_dropDb.sim rename to tests/script/tsim/backup/arbitrator/sync_replica2_dropDb.sim diff --git a/tests/script/unique/arbitrator/sync_replica2_dropTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica2_dropTable.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica2_dropTable.sim rename to tests/script/tsim/backup/arbitrator/sync_replica2_dropTable.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_add.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_add.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_drop.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_alterTable_drop.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_alterTable_drop.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_createTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_createTable.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_createTable.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_createTable.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_dropDb.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dropDb.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_dropDb.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_dropDb.sim diff --git a/tests/script/unique/arbitrator/sync_replica3_dropTable.sim b/tests/script/tsim/backup/arbitrator/sync_replica3_dropTable.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica3_dropTable.sim rename to tests/script/tsim/backup/arbitrator/sync_replica3_dropTable.sim diff --git a/tests/script/unique/arbitrator/sync_replica_alterTable_background_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_add.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica_alterTable_background_add.sim rename to tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_add.sim diff --git a/tests/script/unique/arbitrator/sync_replica_alterTable_background_drop.sim b/tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_drop.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica_alterTable_background_drop.sim rename to tests/script/tsim/backup/arbitrator/sync_replica_alterTable_background_drop.sim diff --git a/tests/script/unique/arbitrator/sync_replica_createTable_background_add.sim b/tests/script/tsim/backup/arbitrator/sync_replica_createTable_background_add.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica_createTable_background_add.sim rename to tests/script/tsim/backup/arbitrator/sync_replica_createTable_background_add.sim diff --git a/tests/script/unique/arbitrator/sync_replica_dropDb_background.sim b/tests/script/tsim/backup/arbitrator/sync_replica_dropDb_background.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica_dropDb_background.sim rename to tests/script/tsim/backup/arbitrator/sync_replica_dropDb_background.sim diff --git a/tests/script/unique/arbitrator/sync_replica_dropTable_background.sim b/tests/script/tsim/backup/arbitrator/sync_replica_dropTable_background.sim similarity index 100% rename from tests/script/unique/arbitrator/sync_replica_dropTable_background.sim rename to tests/script/tsim/backup/arbitrator/sync_replica_dropTable_background.sim diff --git a/tests/script/unique/cluster/client1_0.sim b/tests/script/tsim/backup/cluster/client1_0.sim similarity index 100% rename from tests/script/unique/cluster/client1_0.sim rename to tests/script/tsim/backup/cluster/client1_0.sim diff --git a/tests/script/unique/cluster/client1_1.sim b/tests/script/tsim/backup/cluster/client1_1.sim similarity index 100% rename from tests/script/unique/cluster/client1_1.sim rename to tests/script/tsim/backup/cluster/client1_1.sim diff --git a/tests/script/unique/cluster/client1_2.sim b/tests/script/tsim/backup/cluster/client1_2.sim similarity index 100% rename from tests/script/unique/cluster/client1_2.sim rename to tests/script/tsim/backup/cluster/client1_2.sim diff --git a/tests/script/unique/cluster/client1_3.sim b/tests/script/tsim/backup/cluster/client1_3.sim similarity index 100% rename from tests/script/unique/cluster/client1_3.sim rename to tests/script/tsim/backup/cluster/client1_3.sim diff --git a/tests/script/unique/cluster/client2_0.sim b/tests/script/tsim/backup/cluster/client2_0.sim similarity index 100% rename from tests/script/unique/cluster/client2_0.sim rename to tests/script/tsim/backup/cluster/client2_0.sim diff --git a/tests/script/unique/cluster/client2_1.sim b/tests/script/tsim/backup/cluster/client2_1.sim similarity index 100% rename from tests/script/unique/cluster/client2_1.sim rename to tests/script/tsim/backup/cluster/client2_1.sim diff --git a/tests/script/unique/cluster/client2_2.sim b/tests/script/tsim/backup/cluster/client2_2.sim similarity index 100% rename from tests/script/unique/cluster/client2_2.sim rename to tests/script/tsim/backup/cluster/client2_2.sim diff --git a/tests/script/unique/cluster/client2_3.sim b/tests/script/tsim/backup/cluster/client2_3.sim similarity index 100% rename from tests/script/unique/cluster/client2_3.sim rename to tests/script/tsim/backup/cluster/client2_3.sim diff --git a/tests/script/unique/cluster/client3.sim b/tests/script/tsim/backup/cluster/client3.sim similarity index 100% rename from tests/script/unique/cluster/client3.sim rename to tests/script/tsim/backup/cluster/client3.sim diff --git a/tests/script/unique/cluster/client4.sim b/tests/script/tsim/backup/cluster/client4.sim similarity index 100% rename from tests/script/unique/cluster/client4.sim rename to tests/script/tsim/backup/cluster/client4.sim diff --git a/tests/script/unique/cluster/client5.sim b/tests/script/tsim/backup/cluster/client5.sim similarity index 100% rename from tests/script/unique/cluster/client5.sim rename to tests/script/tsim/backup/cluster/client5.sim diff --git a/tests/script/unique/cluster/cluster_main.sim b/tests/script/tsim/backup/cluster/cluster_main.sim similarity index 100% rename from tests/script/unique/cluster/cluster_main.sim rename to tests/script/tsim/backup/cluster/cluster_main.sim diff --git a/tests/script/unique/cluster/cluster_main0.sim b/tests/script/tsim/backup/cluster/cluster_main0.sim similarity index 100% rename from tests/script/unique/cluster/cluster_main0.sim rename to tests/script/tsim/backup/cluster/cluster_main0.sim diff --git a/tests/script/unique/cluster/cluster_main1.sim b/tests/script/tsim/backup/cluster/cluster_main1.sim similarity index 100% rename from tests/script/unique/cluster/cluster_main1.sim rename to tests/script/tsim/backup/cluster/cluster_main1.sim diff --git a/tests/script/unique/cluster/cluster_main2.sim b/tests/script/tsim/backup/cluster/cluster_main2.sim similarity index 100% rename from tests/script/unique/cluster/cluster_main2.sim rename to tests/script/tsim/backup/cluster/cluster_main2.sim diff --git a/tests/script/unique/cluster/main1_client1_0.sim b/tests/script/tsim/backup/cluster/main1_client1_0.sim similarity index 100% rename from tests/script/unique/cluster/main1_client1_0.sim rename to tests/script/tsim/backup/cluster/main1_client1_0.sim diff --git a/tests/script/unique/cluster/main1_client1_1.sim b/tests/script/tsim/backup/cluster/main1_client1_1.sim similarity index 100% rename from tests/script/unique/cluster/main1_client1_1.sim rename to tests/script/tsim/backup/cluster/main1_client1_1.sim diff --git a/tests/script/unique/cluster/main1_client1_2.sim b/tests/script/tsim/backup/cluster/main1_client1_2.sim similarity index 100% rename from tests/script/unique/cluster/main1_client1_2.sim rename to tests/script/tsim/backup/cluster/main1_client1_2.sim diff --git a/tests/script/unique/cluster/main1_client1_3.sim b/tests/script/tsim/backup/cluster/main1_client1_3.sim similarity index 100% rename from tests/script/unique/cluster/main1_client1_3.sim rename to tests/script/tsim/backup/cluster/main1_client1_3.sim diff --git a/tests/script/unique/cluster/main1_client4.sim b/tests/script/tsim/backup/cluster/main1_client4.sim similarity index 100% rename from tests/script/unique/cluster/main1_client4.sim rename to tests/script/tsim/backup/cluster/main1_client4.sim diff --git a/tests/script/unique/cluster/main2_client1_0.sim b/tests/script/tsim/backup/cluster/main2_client1_0.sim similarity index 100% rename from tests/script/unique/cluster/main2_client1_0.sim rename to tests/script/tsim/backup/cluster/main2_client1_0.sim diff --git a/tests/script/unique/cluster/main2_client1_1.sim b/tests/script/tsim/backup/cluster/main2_client1_1.sim similarity index 100% rename from tests/script/unique/cluster/main2_client1_1.sim rename to tests/script/tsim/backup/cluster/main2_client1_1.sim diff --git a/tests/script/unique/cluster/main2_client1_2.sim b/tests/script/tsim/backup/cluster/main2_client1_2.sim similarity index 100% rename from tests/script/unique/cluster/main2_client1_2.sim rename to tests/script/tsim/backup/cluster/main2_client1_2.sim diff --git a/tests/script/unique/cluster/main2_client1_3.sim b/tests/script/tsim/backup/cluster/main2_client1_3.sim similarity index 100% rename from tests/script/unique/cluster/main2_client1_3.sim rename to tests/script/tsim/backup/cluster/main2_client1_3.sim diff --git a/tests/script/unique/cluster/main2_client2_0.sim b/tests/script/tsim/backup/cluster/main2_client2_0.sim similarity index 100% rename from tests/script/unique/cluster/main2_client2_0.sim rename to tests/script/tsim/backup/cluster/main2_client2_0.sim diff --git a/tests/script/unique/cluster/main2_client2_1.sim b/tests/script/tsim/backup/cluster/main2_client2_1.sim similarity index 100% rename from tests/script/unique/cluster/main2_client2_1.sim rename to tests/script/tsim/backup/cluster/main2_client2_1.sim diff --git a/tests/script/unique/cluster/main2_client2_2.sim b/tests/script/tsim/backup/cluster/main2_client2_2.sim similarity index 100% rename from tests/script/unique/cluster/main2_client2_2.sim rename to tests/script/tsim/backup/cluster/main2_client2_2.sim diff --git a/tests/script/unique/cluster/main2_client2_3.sim b/tests/script/tsim/backup/cluster/main2_client2_3.sim similarity index 100% rename from tests/script/unique/cluster/main2_client2_3.sim rename to tests/script/tsim/backup/cluster/main2_client2_3.sim diff --git a/tests/script/unique/clusterSimCase/client-01.sim b/tests/script/tsim/backup/clusterSimCase/client-01.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-01.sim rename to tests/script/tsim/backup/clusterSimCase/client-01.sim diff --git a/tests/script/unique/clusterSimCase/client-02.sim b/tests/script/tsim/backup/clusterSimCase/client-02.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-02.sim rename to tests/script/tsim/backup/clusterSimCase/client-02.sim diff --git a/tests/script/unique/clusterSimCase/client-03.sim b/tests/script/tsim/backup/clusterSimCase/client-03.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-03.sim rename to tests/script/tsim/backup/clusterSimCase/client-03.sim diff --git a/tests/script/unique/clusterSimCase/client-04.sim b/tests/script/tsim/backup/clusterSimCase/client-04.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-04.sim rename to tests/script/tsim/backup/clusterSimCase/client-04.sim diff --git a/tests/script/unique/clusterSimCase/client-05.sim b/tests/script/tsim/backup/clusterSimCase/client-05.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-05.sim rename to tests/script/tsim/backup/clusterSimCase/client-05.sim diff --git a/tests/script/unique/clusterSimCase/client-06.sim b/tests/script/tsim/backup/clusterSimCase/client-06.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-06.sim rename to tests/script/tsim/backup/clusterSimCase/client-06.sim diff --git a/tests/script/unique/clusterSimCase/client-07.sim b/tests/script/tsim/backup/clusterSimCase/client-07.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-07.sim rename to tests/script/tsim/backup/clusterSimCase/client-07.sim diff --git a/tests/script/unique/clusterSimCase/client-08.sim b/tests/script/tsim/backup/clusterSimCase/client-08.sim similarity index 100% rename from tests/script/unique/clusterSimCase/client-08.sim rename to tests/script/tsim/backup/clusterSimCase/client-08.sim diff --git a/tests/script/unique/clusterSimCase/cluster_main.sim b/tests/script/tsim/backup/clusterSimCase/cluster_main.sim similarity index 100% rename from tests/script/unique/clusterSimCase/cluster_main.sim rename to tests/script/tsim/backup/clusterSimCase/cluster_main.sim diff --git a/tests/script/unique/db/back_insert.sim b/tests/script/tsim/db/back_insert.sim similarity index 100% rename from tests/script/unique/db/back_insert.sim rename to tests/script/tsim/db/back_insert.sim diff --git a/tests/script/unique/db/commit.sim b/tests/script/tsim/db/commit.sim similarity index 100% rename from tests/script/unique/db/commit.sim rename to tests/script/tsim/db/commit.sim diff --git a/tests/script/unique/db/delete.sim b/tests/script/tsim/db/delete.sim similarity index 100% rename from tests/script/unique/db/delete.sim rename to tests/script/tsim/db/delete.sim diff --git a/tests/script/unique/db/delete_part.sim b/tests/script/tsim/db/delete_part.sim similarity index 100% rename from tests/script/unique/db/delete_part.sim rename to tests/script/tsim/db/delete_part.sim diff --git a/tests/script/unique/cluster/alter.sim b/tests/script/tsim/dnode/cluster_alter.sim similarity index 100% rename from tests/script/unique/cluster/alter.sim rename to tests/script/tsim/dnode/cluster_alter.sim diff --git a/tests/script/unique/cluster/balance1.sim b/tests/script/tsim/dnode/cluster_balance1.sim similarity index 100% rename from tests/script/unique/cluster/balance1.sim rename to tests/script/tsim/dnode/cluster_balance1.sim diff --git a/tests/script/unique/cluster/balance2.sim b/tests/script/tsim/dnode/cluster_balance2.sim similarity index 100% rename from tests/script/unique/cluster/balance2.sim rename to tests/script/tsim/dnode/cluster_balance2.sim diff --git a/tests/script/unique/cluster/balance3.sim b/tests/script/tsim/dnode/cluster_balance3.sim similarity index 100% rename from tests/script/unique/cluster/balance3.sim rename to tests/script/tsim/dnode/cluster_balance3.sim diff --git a/tests/script/unique/cluster/cache.sim b/tests/script/tsim/dnode/cluster_cache.sim similarity index 100% rename from tests/script/unique/cluster/cache.sim rename to tests/script/tsim/dnode/cluster_cache.sim diff --git a/tests/script/unique/cluster/flowctrl.sim b/tests/script/tsim/dnode/cluster_flowctrl.sim similarity index 100% rename from tests/script/unique/cluster/flowctrl.sim rename to tests/script/tsim/dnode/cluster_flowctrl.sim diff --git a/tests/script/unique/cluster/vgroup100.sim b/tests/script/tsim/dnode/cluster_vgroup100.sim similarity index 100% rename from tests/script/unique/cluster/vgroup100.sim rename to tests/script/tsim/dnode/cluster_vgroup100.sim diff --git a/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim b/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim index 15ad13b6fa..78bca45f31 100644 --- a/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim +++ b/tests/script/tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim @@ -124,6 +124,8 @@ if $data(5)[3] != 3 then return -1 endi +#sql reset query cache + print =============== step4: select data sql show d1.tables if $rows != 1 then diff --git a/tests/script/tsim/vnode/replica3_many.sim b/tests/script/tsim/vnode/replica3_many.sim index 6b1a582f23..4fd3e39fdf 100644 --- a/tests/script/tsim/vnode/replica3_many.sim +++ b/tests/script/tsim/vnode/replica3_many.sim @@ -61,10 +61,8 @@ step12: endi sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19 -print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29 -print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39 -if $rows != 4 then +$leaderExist = 0 +if $rows != 1 then return -1 endi if $data(2)[4] == leader then @@ -91,10 +89,8 @@ step13: endi sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19 -print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29 -print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39 -if $rows != 4 then +$leaderExist = 0 +if $rows != 1 then return -1 endi if $data(3)[4] == leader then @@ -121,12 +117,7 @@ step14: endi sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19 -print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29 -print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39 -if $rows != 4 then - return -1 -endi +$leaderExist = 0 if $data(4)[4] == leader then $leaderExist = 1 endi @@ -151,12 +142,7 @@ step15: endi sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -print ===> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 $data18 $data19 -print ===> $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 $data28 $data29 -print ===> $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 $data38 $data39 -if $rows != 4 then - return -1 -endi +$leaderExist = 0 if $data(4)[4] == leader then $leaderExist = 1 endi diff --git a/tests/script/unique/stable/balance_replica1.sim b/tests/script/tsim/vnode/stable_balance_replica1.sim similarity index 62% rename from tests/script/unique/stable/balance_replica1.sim rename to tests/script/tsim/vnode/stable_balance_replica1.sim index 3ea158eb39..dfc8de5160 100644 --- a/tests/script/unique/stable/balance_replica1.sim +++ b/tests/script/tsim/vnode/stable_balance_replica1.sim @@ -1,16 +1,12 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode1 -c statusInterval -v 1 -system sh/cfg.sh -n dnode2 -c statusInterval -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 dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 +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 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 $dbPrefix = br1_db $tbPrefix = br1_tb @@ -29,7 +25,7 @@ $db = $dbPrefix $mt = $mtPrefix $st = $stPrefix . $i -sql create database $db +sql create database $db vgroups 4 sql use $db sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int) @@ -54,51 +50,47 @@ endw sleep 100 print =============== step2 - -$x = 0 -show1: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi -sql show dnodes -x show1 -$dnode1Vnodes = $data2_1 -print dnode1 $dnode1Vnodes -$dnode2Vnodes = $data2_2 -print dnode2 $dnode2Vnodes - -if $dnode1Vnodes != 4 then - goto show1 -endi -if $dnode2Vnodes != null then - goto show1 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +if $data(1)[2] != 4 then + return -1 endi + print =============== step3 start dnode2 -sql create dnode $hostname2 +sql create dnode $hostname port 7200 system sh/exec.sh -n dnode2 -s start -sleep 8000 $x = 0 -show2: +step3: $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes -x show2 -$dnode1Vnodes = $data2_1 -print dnode1 $dnode1Vnodes -$dnode2Vnodes = $data2_2 -print dnode2 $dnode2Vnodes - -if $dnode1Vnodes != 2 then - goto show2 +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 endi -if $dnode2Vnodes != 2 then - goto show2 +if $data(1)[4] != ready then + goto step3 +endi +if $data(2)[4] != ready then + goto step3 endi +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 2 then + return -1 +endi +if $data(2)[2] != 2 then + return -1 +endi print =============== step4 $i = 1 diff --git a/tests/script/unique/stable/dnode2.sim b/tests/script/tsim/vnode/stable_dnode2.sim similarity index 73% rename from tests/script/unique/stable/dnode2.sim rename to tests/script/tsim/vnode/stable_dnode2.sim index 3ca8c4ee20..c29d960706 100644 --- a/tests/script/unique/stable/dnode2.sim +++ b/tests/script/tsim/vnode/stable_dnode2.sim @@ -1,28 +1,40 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 -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 dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/exec.sh -n dnode1 -s start +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 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +print ========== step1 +system sh/exec.sh -n dnode1 -s start sql connect -sql create dnode $hostname2 +sql create dnode $hostname port 7200 system sh/exec.sh -n dnode2 -s start $x = 0 -createDnode: +step1: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 +endi +if $data(1)[4] != ready then + goto step1 +endi +if $data(2)[4] != ready then + goto step1 +endi print ======================== dnode1 start @@ -38,7 +50,7 @@ $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i -sql create database $db +sql create database $db vgroups 3 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -97,20 +109,20 @@ if $data00 != $rowNum then endi print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) +sql select _wstartts, count(tbcol) as b from $tb interval(1m) print ===> $data01 if $data01 != 1 then return -1 endi -sql select count(tbcol) as b from $tb interval(1d) +sql select _wstartts, count(tbcol) as b from $tb interval(1d) print ===> $data01 if $data01 != $rowNum then return -1 endi print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) +sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) print ===> $data01 if $data01 != 1 then return -1 @@ -152,13 +164,13 @@ if $data00 != 25 then endi print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) +sql select _wstartts, count(tbcol) as b from $mt interval(1m) print ===> $data01 if $data01 != 10 then return -1 endi -sql select count(tbcol) as b from $mt interval(1d) +sql select _wstartts, count(tbcol) as b from $mt interval(1d) print ===> $data01 if $data01 != 200 then return -1 @@ -175,20 +187,10 @@ if $rows != $tbNum then return -1 endi -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi - print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -196,7 +198,4 @@ 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 \ No newline at end of file +system sh/exec.sh -n dnode5 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/stable/dnode2_stop.sim b/tests/script/tsim/vnode/stable_dnode2_stop.sim similarity index 64% rename from tests/script/unique/stable/dnode2_stop.sim rename to tests/script/tsim/vnode/stable_dnode2_stop.sim index c10f04338d..113cf27e17 100644 --- a/tests/script/unique/stable/dnode2_stop.sim +++ b/tests/script/tsim/vnode/stable_dnode2_stop.sim @@ -1,27 +1,40 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 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 dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/exec.sh -n dnode1 -s start +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 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +print ========== step1 +system sh/exec.sh -n dnode1 -s start sql connect -sql create dnode $hostname2 + +sql create dnode $hostname port 7200 system sh/exec.sh -n dnode2 -s start $x = 0 -createDnode: +step1: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 +endi +if $data(1)[4] != ready then + goto step1 +endi +if $data(2)[4] != ready then + goto step1 +endi print ======================== dnode1 start @@ -43,7 +56,7 @@ $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i -sql create database $db +sql create database $db vgroups 3 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -72,7 +85,6 @@ endi sleep 100 system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep 3000 print =============== step2 sql select count(*) from $mt -x step2 @@ -84,7 +96,27 @@ sql select count(tbcol) from $mt -x step21 step21: system sh/exec.sh -n dnode2 -s start -sleep 3000 + +$x = 0 +dnode2: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 +endi +if $data(1)[4] != ready then + goto dnode2 +endi +if $data(2)[4] != ready then + goto dnode2 +endi print =============== step3 sql select count(tbcol) as c from $mt where ts <= 1519833840000 @@ -106,13 +138,13 @@ if $data00 != 25 then endi print =============== step4 -sql select count(tbcol) as b from $mt interval(1m) +sql select _wstartts, count(tbcol) as b from $mt interval(1m) print ===> $data01 if $data01 != 10 then return -1 endi -sql select count(tbcol) as b from $mt interval(1d) +sql select _wstartts, count(tbcol) as b from $mt interval(1d) print ===> $data01 if $data01 != 200 then return -1 @@ -129,28 +161,14 @@ if $rows != $tbNum then return -1 endi -print =============== step6 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi - print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 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 \ No newline at end of file +system sh/exec.sh -n dnode4 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/stable/replica2_vnode3.sim b/tests/script/tsim/vnode/stable_dnode3.sim similarity index 70% rename from tests/script/unique/stable/replica2_vnode3.sim rename to tests/script/tsim/vnode/stable_dnode3.sim index 47d45c3d3d..ae777b9942 100644 --- a/tests/script/unique/stable/replica2_vnode3.sim +++ b/tests/script/tsim/vnode/stable_dnode3.sim @@ -1,33 +1,50 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 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 dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/exec.sh -n dnode1 -s start +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 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +print ========== step1 +system sh/exec.sh -n dnode1 -s start sql connect -sql create dnode $hostname2 + +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start $x = 0 -createDnode: +step1: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi - +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 3 then + return -1 +endi +if $data(1)[4] != ready then + goto step1 +endi +if $data(2)[4] != ready then + goto step1 +endi +if $data(3)[4] != ready then + goto step1 +endi + print ======================== dnode1 start - -$dbPrefix = r2v3_db -$tbPrefix = r2v3_tb -$mtPrefix = r2v3_mt +$dbPrefix = d3_db +$tbPrefix = d3_tb +$mtPrefix = d3_mt $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -37,7 +54,7 @@ $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i -sql create database $db replica 2 +sql create database $db vgroups 3 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -46,7 +63,7 @@ while $i < $tbNum $tb = $tbPrefix . $i sql create table $tb using $mt tags( $i ) - $x = 0 + $x = 0 while $x < $rowNum $val = $x * 60000 $ms = 1519833600000 + $val @@ -94,20 +111,20 @@ if $data00 != $rowNum then endi print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) +sql select _wstartts, count(tbcol) as b from $tb interval(1m) print ===> $data01 if $data01 != 1 then return -1 endi -sql select count(tbcol) as b from $tb interval(1d) +sql select _wstartts, count(tbcol) as b from $tb interval(1d) print ===> $data01 if $data01 != $rowNum then return -1 endi print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) +sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) print ===> $data01 if $data01 != 1 then return -1 @@ -149,13 +166,13 @@ if $data00 != 25 then endi print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) +sql select _wstartts, count(tbcol) as b from $mt interval(1m) print ===> $data01 if $data01 != 10 then return -1 endi -sql select count(tbcol) as b from $mt interval(1d) +sql select _wstartts, count(tbcol) as b from $mt interval(1d) print ===> $data01 if $data01 != 200 then return -1 @@ -172,20 +189,10 @@ if $rows != $tbNum then return -1 endi -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi -return print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -193,7 +200,3 @@ 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 \ No newline at end of file diff --git a/tests/script/unique/stable/replica3_dnode6.sim b/tests/script/tsim/vnode/stable_replica3_dnode6.sim similarity index 67% rename from tests/script/unique/stable/replica3_dnode6.sim rename to tests/script/tsim/vnode/stable_replica3_dnode6.sim index eeffb86cdb..aea5b88fed 100644 --- a/tests/script/unique/stable/replica3_dnode6.sim +++ b/tests/script/tsim/vnode/stable_replica3_dnode6.sim @@ -5,29 +5,22 @@ 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/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode5 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode6 -c supportVnodes -v 4 -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 dnode5 -c walLevel -v 2 -system sh/cfg.sh -n dnode6 -c walLevel -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 dnode6 -c maxtablesPerVnode -v 4 - +print ========== step1 system sh/exec.sh -n dnode1 -s start sql connect -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -sql create dnode $hostname5 -sql create dnode $hostname6 +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 +sql create dnode $hostname port 7400 +sql create dnode $hostname port 7500 +sql create dnode $hostname port 7600 system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start @@ -35,31 +28,41 @@ system sh/exec.sh -n dnode5 -s start system sh/exec.sh -n dnode6 -s start $x = 0 -createDnode: +step10: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi -if $data4_3 == offline then - goto createDnode -endi -if $data4_4 == offline then - goto createDnode -endi -if $data4_5 == offline then - goto createDnode -endi -if $data4_6 == offline then - goto createDnode -endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +if $rows != 6 then + return -1 +endi +if $data(1)[4] != ready then + goto step10 +endi +if $data(2)[4] != ready then + goto step10 +endi +if $data(3)[4] != ready then + goto step10 +endi +if $data(4)[4] != ready then + goto step10 +endi +if $data(5)[4] != ready then + goto step10 +endi +if $data(6)[4] != ready then + goto step10 +endi print ======================== dnode1 start - $dbPrefix = r3d6_db $tbPrefix = r3d6_tb $mtPrefix = r3d6_mt @@ -78,7 +81,7 @@ $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i -sql create database $db replica 3 +sql create database $db replica 3 vgroups 3 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -137,20 +140,20 @@ if $data00 != $rowNum then endi print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) +sql select _wstartts, count(tbcol) as b from $tb interval(1m) print ===> $data01 if $data01 != 1 then return -1 endi -sql select count(tbcol) as b from $tb interval(1d) +sql select _wstartts, count(tbcol) as b from $tb interval(1d) print ===> $data01 if $data01 != $rowNum then return -1 endi print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) +sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) print ===> $data01 if $data01 != 1 then return -1 @@ -192,13 +195,13 @@ if $data00 != 25 then endi print =============== step9 -#sql select count(tbcol) as b from $mt interval(1m) +#sql select _wstartts, count(tbcol) as b from $mt interval(1m) #print ===> $data01 #if $data01 != 10 then # return -1 #endi -sql select count(tbcol) as b from $mt interval(1d) +sql select _wstartts, count(tbcol) as b from $mt interval(1d) print ===> $data01 if $data01 != 200 then return -1 @@ -215,23 +218,6 @@ if $rows != $tbNum then return -1 endi -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi -return -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 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/unique/stable/replica3_vnode3.sim b/tests/script/tsim/vnode/stable_replica3_vnode3.sim similarity index 69% rename from tests/script/unique/stable/replica3_vnode3.sim rename to tests/script/tsim/vnode/stable_replica3_vnode3.sim index bc700b7dda..8137b087f5 100644 --- a/tests/script/unique/stable/replica3_vnode3.sim +++ b/tests/script/tsim/vnode/stable_replica3_vnode3.sim @@ -1,47 +1,58 @@ 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 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 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/exec.sh -n dnode1 -s start +system sh/deploy.sh -n dnode5 -i 5 +system sh/deploy.sh -n dnode6 -i 6 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode5 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode6 -c supportVnodes -v 4 +print ========== step1 +system sh/exec.sh -n dnode1 -s start sql connect -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 +sql create dnode $hostname port 7400 system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start + $x = 0 -createDnode: +step10: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi -if $data4_3 == offline then - goto createDnode -endi -if $data4_4 == offline then - goto createDnode -endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +if $rows != 4 then + return -1 +endi +if $data(1)[4] != ready then + goto step10 +endi +if $data(2)[4] != ready then + goto step10 +endi +if $data(3)[4] != ready then + goto step10 +endi +if $data(4)[4] != ready then + goto step10 +endi print ======================== dnode1 start - $dbPrefix = r3v3_db $tbPrefix = r3v3_tb $mtPrefix = r3v3_mt @@ -54,7 +65,7 @@ $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i -sql create database $db replica 3 +sql create database $db replica 3 vgroups 3 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -113,20 +124,20 @@ if $data00 != $rowNum then endi print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) +sql select _wstartts, count(tbcol) as b from $tb interval(1m) print ===> $data01 if $data01 != 1 then return -1 endi -sql select count(tbcol) as b from $tb interval(1d) +sql select _wstartts, count(tbcol) as b from $tb interval(1d) print ===> $data01 if $data01 != $rowNum then return -1 endi print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) +sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) print ===> $data01 if $data01 != 1 then return -1 @@ -169,13 +180,13 @@ if $data00 != 25 then endi print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) +sql select _wstartts, count(tbcol) as b from $mt interval(1m) print ===> $data01 if $data01 != 10 then return -1 endi -sql select count(tbcol) as b from $mt interval(1d) +sql select _wstartts, count(tbcol) as b from $mt interval(1d) print ===> $data01 if $data01 != 200 then return -1 @@ -192,23 +203,6 @@ if $rows != $tbNum then return -1 endi -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 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/unique/arbitrator/testSuite.sim b/tests/script/unique/arbitrator/testSuite.sim deleted file mode 100644 index 127a320e53..0000000000 --- a/tests/script/unique/arbitrator/testSuite.sim +++ /dev/null @@ -1,41 +0,0 @@ -run unique/arbitrator/check_cluster_cfg_para.sim -run unique/arbitrator/dn2_mn1_cache_file_sync.sim -run unique/arbitrator/dn3_mn1_full_createTableFail.sim -run unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim -run unique/arbitrator/dn3_mn1_multiCreateDropTable.sim -run unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim -run unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim -run unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim -run unique/arbitrator/dn3_mn1_replica_change.sim -run unique/arbitrator/dn3_mn1_stopDnode_timeout.sim -run unique/arbitrator/dn3_mn1_vnode_change.sim -run unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim -run unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim -run unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim -run unique/arbitrator/dn3_mn1_vnode_delDir.sim -run unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim -run unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim -run unique/arbitrator/dn3_mn1_vnode_nomaster.sim -run unique/arbitrator/dn3_mn2_killDnode.sim -run unique/arbitrator/insert_duplicationTs.sim -run unique/arbitrator/offline_replica2_alterTable_online.sim -run unique/arbitrator/offline_replica2_alterTag_online.sim -run unique/arbitrator/offline_replica2_createTable_online.sim -run unique/arbitrator/offline_replica2_dropDb_online.sim -run unique/arbitrator/offline_replica2_dropTable_online.sim -run unique/arbitrator/offline_replica3_alterTable_online.sim -run unique/arbitrator/offline_replica3_alterTag_online.sim -run unique/arbitrator/offline_replica3_createTable_online.sim -run unique/arbitrator/offline_replica3_dropDb_online.sim -run unique/arbitrator/offline_replica3_dropTable_online.sim -run unique/arbitrator/replica_changeWithArbitrator.sim -run unique/arbitrator/sync_replica2_alterTable_add.sim -run unique/arbitrator/sync_replica2_alterTable_drop.sim -run unique/arbitrator/sync_replica3_createTable.sim -run unique/arbitrator/sync_replica3_dnodeChang_DropAddAlterTableDropDb.sim -run unique/arbitrator/sync_replica2_dropDb.sim -run unique/arbitrator/sync_replica2_dropTable.sim -run unique/arbitrator/sync_replica3_alterTable_add.sim -run unique/arbitrator/sync_replica3_alterTable_drop.sim -run unique/arbitrator/sync_replica3_dropDb.sim -run unique/arbitrator/sync_replica3_dropTable.sim diff --git a/tests/script/unique/big/balance.sim b/tests/script/unique/big/balance.sim deleted file mode 100644 index f20939d458..0000000000 --- a/tests/script/unique/big/balance.sim +++ /dev/null @@ -1,399 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000 - -system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 1000 - -system sh/deploy.sh -n dnode3 -i 3 -system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 1000 - -system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 1000 - -system sh/deploy.sh -n dnode5 -i 5 -system sh/cfg.sh -n dnode5 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 1000 - -print =============== prepare data -system sh/exec.sh -n dnode1 -s start -sql connect - -$i = 0 -$tbNum = 4000 -$rowNum = 1 -$totalNum = 4000 * $rowNum - -sql create database db -sql use db -sql create table mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int) - -$i = 0 -$tbPrefix = t -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using mt tags( $i ) - $i = $i + 1 -endw - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql insert into $tb values (now, $i , $i ) - - $i = $i + 1 -endw - -print ========== step0 -sql show db.tables -if $rows != 4000 then - return -1 -endi - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - return -1 -endi - -print ========== step1 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -show1: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 openvnodes $data2_1 -print dnode2 openvnodes $data2_2 -if $data2_1 != 2 then - goto show1 -endi -if $data2_2 != 2 then - goto show1 -endi - -sql reset query cache -sleep 100 - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - goto show1 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show1 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show1 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show1 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - goto show1 -endi - -print ========== step2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -print ========== step3 -sql drop dnode $hostname2 - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 freeVnodes $data2_1 -print dnode2 freeVnodes $data2_2 -print dnode3 freeVnodes $data2_3 -if $data2_1 != 2 then - goto show3 -endi -if $data2_2 != null then - goto show3 -endi -if $data2_3 != 2 then - goto show3 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql reset query cache -sleep 100 - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - return -1 -endi - -print ========== step4 -sql drop dnode $hostname3 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 freeVnodes $data2_1 -print dnode3 freeVnodes $data2_3 -if $data2_1 != 4 then - goto show4 -endi -if $data2_3 != null then - goto show4 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -sql reset query cache -sleep 100 - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - return -1 -endi - -print ========== step5 -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname4 - -$x = 0 -step5: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_4 != ready then - goto step5 -endi - -sql alter database db replica 2 - -$x = 0 -show5: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 freeVnodes $data2_1 -print dnode4 freeVnodes $data2_4 -if $data2_1 != 4 then - goto show5 -endi -if $data2_4 != 4 then - goto show5 -endi - -sql reset query cache -sleep 100 - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - goto show5 -endi - -print ========== step6 -sql alter database db replica 1 - -$x = 0 -show6: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 freeVnodes $data2_1 -print dnode4 freeVnodes $data2_4 -if $data2_1 != 2 then - goto show6 -endi -if $data2_4 != 2 then - goto show6 -endi - -sql reset query cache -sleep 100 - -sql select count(*) from t10 -print select count(*) from t10 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t1010 -print select count(*) from t1010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t2010 -print select count(*) from t2010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from t3010 -print select count(*) from t3010 $data00 expect $rowNum -if $data00 != $rowNum then - goto show5 -endi - -sql select count(*) from mt -print select count(*) from mt $data00 expect $rowNum -if $data00 != $totalNum then - goto show5 -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 \ No newline at end of file diff --git a/tests/script/unique/big/maxvnodes.sim b/tests/script/unique/big/maxvnodes.sim deleted file mode 100644 index 10dbc8bbff..0000000000 --- a/tests/script/unique/big/maxvnodes.sim +++ /dev/null @@ -1,89 +0,0 @@ -system sh/stop_dnodes.sh - -$totalVnodes = 20 -$minVnodes = 10 -$maxVnodes = 10 -$maxTables = 4 -$totalRows = $totalVnodes * $maxTables - -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes -system sh/cfg.sh -n dnode1 -c balanceInterval -v 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v $totalVnodes -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 - -print ========== prepare data -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect -sql create database db blocks 3 cache 1 -sql use db - -print ========== step1 -sql create table mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$x = 0 -while $x < $totalRows - $tb = t . $x - sql create table $tb using mt tags( $x ) - sql insert into $tb values (now, $x ) - $x = $x + 1 -endw - -print ========== step2 -sql select * from mt -if $rows != $totalRows then - return -1 -endi - -sql select count(*) from mt -if $data00 != $totalRows then - return -1 -endi - -print ========== step3 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -show3: - $x = $x + 1 - sleep 2000 - if $x == 1000 then - return -1 - endi - -sql show dnodes -print dnode1 openvnodes $data2_1 -print dnode2 openvnodes $data2_2 -if $data2_1 != $minVnodes then - goto show3 -endi -if $data2_2 != $maxVnodes then - goto show3 -endi - -print ========== step4 -sql select * from mt -if $rows != $totalRows then - return -1 -endi - -sql select count(*) from mt -if $data00 != $totalRows then - return -1 -endi - -return - -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 \ No newline at end of file diff --git a/tests/script/unique/big/restartSpeed.sim b/tests/script/unique/big/restartSpeed.sim deleted file mode 100644 index bdc4a8678b..0000000000 --- a/tests/script/unique/big/restartSpeed.sim +++ /dev/null @@ -1,41 +0,0 @@ -system sh/stop_dnodes.sh - -$totalVnodes = 20 -$minVnodes = 10 -$maxVnodes = 10 -$maxTables = 4 -$totalRows = $totalVnodes * $maxTables - -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/deploy.sh -n dnode2 -i 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 - - -print ========== prepare data -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect -sql create database db blocks 3 cache 1 -sql use db - -print ========== step1 -sql create table mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$x = 0 -while $x < $totalRows - $tb = t . $x - sql create table $tb using mt tags( $x ) - sql insert into $tb values (now, $x ) - $x = $x + 1 -endw - - -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 \ No newline at end of file diff --git a/tests/script/unique/big/tcp.sim b/tests/script/unique/big/tcp.sim deleted file mode 100644 index b282e2e222..0000000000 --- a/tests/script/unique/big/tcp.sim +++ /dev/null @@ -1,113 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 30000 - -system sh/cfg.sh -n dnode1 -c dDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c mDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c sdbDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c cDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c gcDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c adminDebugFlag -v 131 -system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 -system sh/cfg.sh -n dnode1 -c debugFlag -v 131 - -system sh/exec.sh -n dnode1 -s start -sql connect -print ======================== dnode1 start - -$dbPrefix = db -$tbPrefix = tb -$mtPrefix = mt -$tbNum = 22000 -$rowNum = 10 - -print =============== step1 -$i = 0 -$db = $dbPrefix -$mt = $mtPrefix - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $i = $i + 1 -endw - -print =============== step2 -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql insert into $tb values (now, $i , $i ) - - $i = $i + 1000 -endw - -$i = 0 -while $i < 5 - print =============== step3 $i - sql select count(*) from $mt - print ===> $data00 $data01 - if $rows != 1 then - return -1 - endi - if $data00 != 22 then - return -1 - endi - - print =============== step4 $i - sql select * from $mt - print ===> $data00 $data01 - if $rows != 22 then - return -1 - endi - - $i = $i + 1 -endw - -print =============== step3 -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql insert into $tb values (now, $i , $i ) - - $i = $i + 1000 -endw - -$i = 0 -while $i < 5 - print =============== step5 $i - sql select count(*) from $mt where tgcol < 20200 - print ===> $data00 $data01 - if $rows != 1 then - return -1 - endi - if $data00 != 42 then - return -1 - endi - - print =============== step6 $i - sql select * from $mt where tgcol < 20200 - print ===> $data00 $data01 - if $rows != 42 then - return -1 - endi - - $i = $i + 1 -endw - -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/unique/big/testSuite.sim b/tests/script/unique/big/testSuite.sim deleted file mode 100644 index 2cead5626a..0000000000 --- a/tests/script/unique/big/testSuite.sim +++ /dev/null @@ -1,3 +0,0 @@ -run unique/big/balance.sim -run unique/big/maxvnodes.sim -run unique/big/tcp.sim diff --git a/tests/script/unique/cluster/testSuite.sim b/tests/script/unique/cluster/testSuite.sim deleted file mode 100644 index 9657558c12..0000000000 --- a/tests/script/unique/cluster/testSuite.sim +++ /dev/null @@ -1,4 +0,0 @@ -run unique/cluster/balance1.sim -run unique/cluster/balance2.sim -run unique/cluster/balance3.sim -run unique/cluster/cache.sim diff --git a/tests/script/unique/column/replica3.sim b/tests/script/unique/column/replica3.sim deleted file mode 100644 index 2d6c194ef8..0000000000 --- a/tests/script/unique/column/replica3.sim +++ /dev/null @@ -1,43 +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/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 dnode1 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 - -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -sql create database db replica 3 -sql use db -sql create table db.mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int) -sql create table db.tb1 using db.mt tags(1, 2) -sleep 3001 - -$x = 1000 -while $x < 1010 - sql insert into tb1 values (now+1s , $x , $x , $x , $x , $x , $x , $x , $x , $x , $x ) - $x = $x + 1 -endw - -sql_error create database d1 replica 2 wallevel 0 -sql_error create database d2 replica 1 wallevel 0 -sql_error alter database d2 replica 2 - -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 \ No newline at end of file diff --git a/tests/script/unique/column/testSuite.sim b/tests/script/unique/column/testSuite.sim deleted file mode 100644 index 8663e9f305..0000000000 --- a/tests/script/unique/column/testSuite.sim +++ /dev/null @@ -1 +0,0 @@ -run unique/column/replica3.sim diff --git a/tests/script/unique/db/replica_add12.sim b/tests/script/unique/db/replica_add12.sim deleted file mode 100644 index d46187e445..0000000000 --- a/tests/script/unique/db/replica_add12.sim +++ /dev/null @@ -1,349 +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 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 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 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 balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi -if $data2_2 != null then - goto step1 -endi -if $data2_3 != null then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 1 -sql create database d2 replica 1 -sql create database d3 replica 1 -sql create database d4 replica 1 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d1.t1 values(now, 1) -sql insert into d2.t2 values(now, 1) -sql insert into d3.t3 values(now, 1) -sql insert into d4.t4 values(now, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -sql show dnodes -print dnode1 ==> openVnodes: $data2_1 -print dnode2 ==> openVnodes: $data2_2 -print dnode3 ==> openVnodes: $data2_3 - -if $data2_1 != 0 then - return -1 -endi - -if $data2_2 != 2 then - return -1 -endi - -if $data2_3 != 2 then - return -1 -endi - -print ======== step2 -sql alter database d1 replica 2 -sql alter database d2 replica 2 -sql alter database d3 replica 2 -sql alter database d4 replica 2 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -print ======== step3 -sql show dnodes -print dnode1 ==> openVnodes: $data2_1 -print dnode2 ==> openVnodes: $data2_2 -print dnode3 ==> openVnodes: $data2_3 - -if $data2_1 != 0 then - return -1 -endi - -if $data2_2 != 4 then - return -1 -endi - -if $data2_3 != 4 then - return -1 -endi - -print ======== step4 -sql insert into d1.t1 values(now, 2) -sql insert into d2.t2 values(now, 2) -sql insert into d3.t3 values(now, 2) -sql insert into d4.t4 values(now, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -sql reset query cache -sleep 200 - -print ========= step5 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sql select * from d1.t1 -x s51 -s51: -#sql insert into d1.t1 values(now, 3) -x s52 -s52: - -print ========= step6 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql insert into d1.t1 values(now, 3) -x step6 -sql insert into d2.t2 values(now, 3) -x step6 -sql insert into d3.t3 values(now, 3) -x step6 -sql insert into d4.t4 values(now, 3) -x step6 - -sql select * from d1.t1 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi - -print ========= step61 -system sh/exec.sh -n dnode3 -s stop -x SIGINT -#sql insert into d1.t1 values(now, 3) -x s61 -s61: - -sql select * from d2.t2 -x s62 -s62: - -print ========= step7 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql insert into d1.t1 values(now, 5) -x step7 -sql insert into d2.t2 values(now, 5) -x step7 -sql insert into d3.t3 values(now, 5) -x step7 -sql insert into d4.t4 values(now, 5) -x step7 - -sql select * from d1.t1 -if $rows != 4 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 4 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 4 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 4 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 \ No newline at end of file diff --git a/tests/script/unique/db/replica_add13.sim b/tests/script/unique/db/replica_add13.sim deleted file mode 100644 index 13a5c97832..0000000000 --- a/tests/script/unique/db/replica_add13.sim +++ /dev/null @@ -1,419 +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 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 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 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 balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi -if $data4_4 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 1 -sql create database d2 replica 1 -sql create database d3 replica 1 -sql create database d4 replica 1 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d1.t1 values(1589529000011, 1) -sql insert into d2.t2 values(1589529000021, 1) -sql insert into d3.t3 values(1589529000031, 1) -sql insert into d4.t4 values(1589529000041, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ======== step2 -sql alter database d1 replica 3 -sql alter database d2 replica 3 -sql alter database d3 replica 3 -sql alter database d4 replica 3 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -print ======== step3 -sql show dnodes -print dnode1 ==> openVnodes: $data2_1 -print dnode2 ==> openVnodes: $data2_2 -print dnode3 ==> openVnodes: $data2_3 -print dnode4 ==> openVnodes: $data2_4 - -if $data2_1 != 0 then - return -1 -endi - -if $data2_2 != 4 then - return -1 -endi - -if $data2_3 != 4 then - return -1 -endi - -if $data2_3 != 4 then - return -1 -endi - -print ======== step4 -sql insert into d1.t1 values(1589529000012, 2) -sql insert into d2.t2 values(1589529000022, 2) -sql insert into d3.t3 values(1589529000032, 2) -sql insert into d4.t4 values(1589529000042, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -print ========= step5 -sql reset query cache -sleep 100 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql insert into d1.t1 values(1589529000013, 3) -sql insert into d2.t2 values(1589529000023, 3) -sql insert into d3.t3 values(1589529000033, 3) -sql insert into d4.t4 values(1589529000043, 3) - -sql select * from d1.t1 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi - -print ========= step6 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -sql insert into d1.t1 values(1589529000014, 4) -sql insert into d2.t2 values(1589529000024, 4) -sql insert into d3.t3 values(1589529000034, 4) -sql insert into d4.t4 values(1589529000044, 4) - -sql select * from d1.t1 -print select * from d1.t1 $rows -if $rows != 4 then - return -1 -endi - -sql select * from d2.t2 -print select * from d2.t2 $rows -if $rows != 4 then - return -1 -endi - -sql select * from d3.t3 -print select * from d3.t3 $rows -if $rows != 4 then - return -1 -endi - -sql select * from d4.t4 -print select * from d4.t4 $rows -if $rows != 4 then - return -1 -endi - -print ========= step7 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -sql insert into d1.t1 values(1589529000015, 5) -sql insert into d2.t2 values(1589529000025, 5) -sql insert into d3.t3 values(1589529000035, 5) -sql insert into d4.t4 values(1589529000045, 5) - -sql select * from d1.t1 -if $rows != 5 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 5 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 5 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 5 then - return -1 -endi - -print ========= step8 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -step8: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql insert into d1.t1 values(1589529000016, 6) -sql insert into d2.t2 values(1589529000026, 6) -sql insert into d3.t3 values(1589529000036, 6) -sql insert into d4.t4 values(1589529000046, 6) - -sql select * from d1.t1 -if $rows != 6 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 6 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 6 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 6 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 \ No newline at end of file diff --git a/tests/script/unique/db/replica_add23.sim b/tests/script/unique/db/replica_add23.sim deleted file mode 100644 index ac0bd6d9d7..0000000000 --- a/tests/script/unique/db/replica_add23.sim +++ /dev/null @@ -1,416 +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 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 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 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 balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi -if $data4_4 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 2 -sql create database d2 replica 2 -sql create database d3 replica 2 -sql create database d4 replica 2 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d1.t1 values(1588262400001, 1) -sql insert into d2.t2 values(1588262400001, 1) -sql insert into d3.t3 values(1588262400001, 1) -sql insert into d4.t4 values(1588262400001, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ======== step2 -sql alter database d1 replica 3 -sql alter database d2 replica 3 -sql alter database d3 replica 3 -sql alter database d4 replica 3 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto a1 -endi - -print ======== step3 -sql show dnodes -print dnode1 ==> openVnodes: $data2_1 -print dnode2 ==> openVnodes: $data2_2 -print dnode3 ==> openVnodes: $data2_3 -print dnode4 ==> openVnodes: $data2_4 - -if $data2_1 != 0 then - return -1 -endi - -if $data2_2 != 4 then - return -1 -endi - -if $data2_3 != 4 then - return -1 -endi - -if $data2_3 != 4 then - return -1 -endi - -print ======== step4 -sql insert into d1.t1 values(1588262400002, 2) -sql insert into d2.t2 values(1588262400002, 2) -sql insert into d3.t3 values(1588262400002, 2) -sql insert into d4.t4 values(1588262400002, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -sql reset query cache -sleep 100 - -print ========= step5 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sql insert into d1.t1 values(1588262400003, 3) -sql insert into d2.t2 values(1588262400003, 3) -sql insert into d3.t3 values(1588262400003, 3) -sql insert into d4.t4 values(1588262400003, 3) - -sql select * from d1.t1 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi - -print ========= step6 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step6 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -sql insert into d1.t1 values(1588262400004, 4) -sql insert into d2.t2 values(1588262400004, 4) -sql insert into d3.t3 values(1588262400004, 4) -sql insert into d4.t4 values(1588262400004, 4) - -sql select * from d1.t1 -if $rows != 4 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 4 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 4 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 4 then - return -1 -endi - -print ========= step7 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step7 -endi - -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -sql insert into d1.t1 values(1588262400005, 5) -sql insert into d2.t2 values(1588262400005, 5) -sql insert into d3.t3 values(1588262400005, 5) -sql insert into d4.t4 values(1588262400005, 5) - -sql select * from d1.t1 -if $rows != 5 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 5 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 5 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 5 then - return -1 -endi - -print ========= step8 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -step8: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 3 then - goto step8 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql insert into d1.t1 values(1588262400006, 6) -sql insert into d2.t2 values(1588262400006, 6) -sql insert into d3.t3 values(1588262400006, 6) -sql insert into d4.t4 values(1588262400006, 6) - -sql select * from d1.t1 -if $rows != 6 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 6 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 6 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 6 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 \ No newline at end of file diff --git a/tests/script/unique/db/replica_part.sim b/tests/script/unique/db/replica_part.sim deleted file mode 100644 index 9880ec666c..0000000000 --- a/tests/script/unique/db/replica_part.sim +++ /dev/null @@ -1,306 +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/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 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 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 dnode1 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 3 -sql create database d2 replica 3 -sql create database d3 replica 3 -sql create database d4 replica 3 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d2.t2 values(now, 1) -sql insert into d1.t1 values(now, 1) -sql insert into d3.t3 values(now, 1) -sql insert into d4.t4 values(now, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ========= step2 alter db -sql alter database d1 replica 2 -sql alter database d2 replica 2 -sql alter database d3 replica 2 -sql alter database d4 replica 2 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -print ========= step3 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step3: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step3 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step3 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step3 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step3 -endi - -print ========= step4 -sql insert into d1.t1 values(now, 2) -sql insert into d2.t2 values(now, 2) -sql insert into d3.t3 values(now, 2) -sql insert into d4.t4 values(now, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -print ========= step5 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql reset query cache -sleep 100 - -sql insert into d1.t1 values(now, 3) -x s1 -s1: -#sql insert into d2.t2 values(now, 3) -x s2 -#s2: -#sql insert into d3.t3 values(now, 3) -x s3 -#s3: -#sql insert into d4.t4 values(now, 3) -x s4 -#s4: - -print ========= step6 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -#sql insert into d1.t1 values(now, 4) -x s5 -#s5: -sql insert into d2.t2 values(now, 4) -x s6 -s6: -#sql insert into d3.t3 values(now, 4) -x s7 -#s7: -#sql insert into d4.t4 values(now, 4) -x s8 -#s8: - -print ========= step7 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step7 -endi - -sql insert into d1.t1 values(now, 5) -sql insert into d2.t2 values(now, 5) -sql insert into d3.t3 values(now, 5) -sql insert into d4.t4 values(now, 5) - -sql select * from d1.t1 -sql select * from d2.t2 -sql select * from d3.t3 -sql select * from d4.t4 - -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 \ No newline at end of file diff --git a/tests/script/unique/db/replica_reduce21.sim b/tests/script/unique/db/replica_reduce21.sim deleted file mode 100644 index d3a76485f8..0000000000 --- a/tests/script/unique/db/replica_reduce21.sim +++ /dev/null @@ -1,187 +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/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 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 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 dnode1 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show 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 - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -if $data2_1 != master then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 2 -sql create database d2 replica 2 -sql create database d3 replica 2 -sql create database d4 replica 2 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d2.t2 values(now, 1) -sql insert into d1.t1 values(now, 1) -sql insert into d3.t3 values(now, 1) -sql insert into d4.t4 values(now, 1) -sleep 1000 - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ======== step2 create d5 -sql create database d5 replica 1 - -print ========= step3 alter d1 -sql alter database d1 replica 1 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a1 -endi - - -print ========= step4 query d1 -sql insert into d1.t1 values(now, 2) -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -print ========= step5 query d5 -sql create table d5.t5 (ts timestamp, i int) -sql insert into d5.t5 values(now, 1); -sql select * from d5.t5 -if $rows != 1 then - return -1 -endi -return -print ========= step7 drop d1 -sql drop database d1 -sql reset query cache -sleep 100 - -print ========= step8 -sql insert into d5.t5 values(now, 2) -sql insert into d2.t2 values(now, 2) -sql insert into d3.t3 values(now, 2) -sql insert into d4.t4 values(now, 2) - -sql select * from d5.t5 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -print ======== step9 stop dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql insert into d5.t5 values(now, 3) -sql insert into d2.t2 values(now, 3) -sql insert into d3.t3 values(now, 3) -sql insert into d4.t4 values(now, 3) - -sql select * from d5.t5 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi - -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/replica_reduce31.sim b/tests/script/unique/db/replica_reduce31.sim deleted file mode 100644 index 5350bcc78c..0000000000 --- a/tests/script/unique/db/replica_reduce31.sim +++ /dev/null @@ -1,327 +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/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 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 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 dnode1 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 3 -sql create database d2 replica 3 -sql create database d3 replica 3 -sql create database d4 replica 3 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d1.t1 values(now, 1) -sql insert into d2.t2 values(now, 1) -sql insert into d3.t3 values(now, 1) -sql insert into d4.t4 values(now, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ========= step2 alter db -sql_error alter database d1 replica 1 -sql_error alter database d2 replica 1 -sql_error alter database d3 replica 1 -sql_error alter database d4 replica 1 -sql alter database d1 replica 2 -sql alter database d2 replica 2 -sql alter database d3 replica 2 -sql alter database d4 replica 2 - -$x = 0 -a2: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a2 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a2 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a2 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a2 -endi - -sql alter database d1 replica 1 -sql alter database d2 replica 1 -sql alter database d3 replica 1 -sql alter database d4 replica 1 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 1 then - goto a1 -endi - -sql show dnodes -print $data00 $data01 $data02 $data03 -print $data10 $data11 $data12 $data13 -print $data20 $data21 $data22 $data23 - -if $data02 != 0 then - goto a1 -endi -if $data12 != 2 then - goto a1 -endi -if $data22 != 2 then - goto a1 -endi - -print ========= step3 -sql reset query cache -sleep 100 - -sql insert into d1.t1 values(now, 2) -sql insert into d2.t2 values(now, 2) -sql insert into d3.t3 values(now, 2) -sql insert into d4.t4 values(now, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -print ========= step4 alter db -sql alter database d1 replica 2 -sql alter database d2 replica 2 -sql alter database d3 replica 2 -sql alter database d4 replica 2 - -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step4 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step4 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step4 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step4 -endi - -sql insert into d1.t1 values(now, 3) -sql insert into d2.t2 values(now, 3) -sql insert into d3.t3 values(now, 3) -sql insert into d4.t4 values(now, 3) - -sql select * from d1.t1 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi - -print ========= step4 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sql reset query cache -sleep 100 - -#sql insert into d1.t1 values(now, 4) -x step1 -#step1: -#sql insert into d2.t2 values(now, 4) -x step2 -#step2: -#sql insert into d3.t3 values(now, 4) -x step3 -#step3: -#sql insert into d4.t4 values(now, 4) -x step4 -#step4: - -print ========= step5 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -#sql insert into d1.t1 values(now, 5) -x step5 -#step5: -#sql insert into d2.t2 values(now, 5) -x step6 -#step6: -#sql insert into d3.t3 values(now, 5) -x step7 -#step7: -#sql insert into d4.t4 values(now, 5) -x step8 -#step8: - -print ========= step6 -system sh/exec.sh -n dnode3 -s start - -sql insert into d1.t1 values(now, 6) -sql insert into d2.t2 values(now, 6) -sql insert into d3.t3 values(now, 6) -sql insert into d4.t4 values(now, 6) - -sql select * from d1.t1 -sql select * from d2.t2 -sql select * from d3.t3 -sql select * from d4.t4 - -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 \ No newline at end of file diff --git a/tests/script/unique/db/replica_reduce32.sim b/tests/script/unique/db/replica_reduce32.sim deleted file mode 100644 index ead265d5d5..0000000000 --- a/tests/script/unique/db/replica_reduce32.sim +++ /dev/null @@ -1,294 +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/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 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 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 dnode1 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 1 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 1 - -print ========= start dnodes -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi -if $data2_2 != null then - goto step1 -endi -if $data2_3 != null then - goto step1 -endi - -print ======== step1 -sql create database d1 replica 3 -sql create database d2 replica 3 -sql create database d3 replica 3 -sql create database d4 replica 3 - -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql insert into d2.t2 values(now, 1) -sql insert into d1.t1 values(now, 1) -sql insert into d3.t3 values(now, 1) -sql insert into d4.t4 values(now, 1) - -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 1 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 1 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 1 then - return -1 -endi - -print ========= step2 alter db -sql alter database d1 replica 2 -sql alter database d2 replica 2 -sql alter database d3 replica 2 -sql alter database d4 replica 2 - -$x = 0 -a1: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto a1 -endi - -print ========= step3 -sql insert into d1.t1 values(now, 2) -sql insert into d2.t2 values(now, 2) -sql insert into d3.t3 values(now, 2) -sql insert into d4.t4 values(now, 2) - -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - -sql reset query cache -sleep 200 - -print ========= step4 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep 3000 - -sql insert into d1.t1 values(now, 3) -x s41 -s41: -sql insert into d2.t2 values(now, 3) -x s42 -s42: -sql insert into d3.t3 values(now, 3) -x s43 -s43: -sql insert into d4.t4 values(now, 3) -x s44 -s44: - -sql select * from d1.t1 -x s45 -s45: -sql select * from d2.t2 -x s46 -s46: -sql select * from d3.t3 -x s47 -s47: -sql select * from d4.t4 -x s48 -s48: - -print ========= step5 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step5: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step5 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step5 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step5 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step5 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sql reset query cache -sleep 100 - -sql_error insert into d1.t1 values(now, 3) -x s51 -s51: -sql_error insert into d2.t2 values(now, 3) -x s52 -s52: -sql_error insert into d3.t3 values(now, 3) -x s53 -s53: -sql_error insert into d4.t4 values(now, 3) -x s54 -s54: - -print ========= step6 -system sh/exec.sh -n dnode3 -s start -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show d1.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d2.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d3.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql show d4.vgroups -print online vnodes $data03 -if $data03 != 2 then - goto step6 -endi - -sql insert into d1.t1 values(now, 5) -sql insert into d2.t2 values(now, 5) -sql insert into d3.t3 values(now, 5) -sql insert into d4.t4 values(now, 5) -sleep 1000 - -sql select * from d1.t1 -print d1.t1 $rows - -sql select * from d2.t2 -print d2.t2 $rows - -sql select * from d3.t3 -print d3.t3 $rows - -sql select * from d4.t4 -print d4.t4 $rows - -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 \ No newline at end of file diff --git a/tests/script/unique/db/testSuite.sim b/tests/script/unique/db/testSuite.sim deleted file mode 100644 index adc1883a71..0000000000 --- a/tests/script/unique/db/testSuite.sim +++ /dev/null @@ -1,10 +0,0 @@ -run unique/db/commit.sim -run unique/db/delete.sim -run unique/db/replica_add12.sim -run unique/db/replica_add13.sim -run unique/db/replica_add23.sim -run unique/db/replica_reduce21.sim -run unique/db/replica_reduce32.sim -run unique/db/replica_reduce31.sim -run unique/db/replica_part.sim -run unique/db/delete_part.sim diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim deleted file mode 100644 index e5f2928748..0000000000 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim +++ /dev/null @@ -1,275 +0,0 @@ -# Test case describe: dnode1/dnode2 include mnode and vnode roles -# step 1: start dnode1/dnode2, and added into cluster -# step 2: create db(repl = 2), table, insert data, -# step 4: stop dnode1, remove its mnode dir, and copy mnode dir of dnode2 to dnode1 -# step 5: restart dnode1, waiting sync end -# step 6: stop dnode2, reset query cache, and query - -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 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 0 -system sh/cfg.sh -n dnode2 -c role -v 0 -#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/dnode2 and add into cluster -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 1000 -sql connect -sleep 1000 -sql create dnode $hostname2 -sleep 1000 - -print ============== step2: create database with replica 2, and create table, insert data -$totalTableNum = 10 -$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 = 1200 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -$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 rows:$rows data00:$data00 totalRows:$totalRows -if $rows != 1 then - return -1 -endi - -if $data00 != $totalRows then - return -1 -endi - - -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 dnode1 -system sh/exec.sh -n dnode1 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode1_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode1_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != offline then - sleep 2000 - goto wait_dnode1_offline -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_offline -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -#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 ============== step5: remove the mnode dir of dnode1, then copy the monde dir of dnode2 -system_content rm -rf ../../../sim/dnode1/data/mnode -system_content cp -rf ../../../sim/dnode2/data/mnode ../../../sim/dnode1/data/ - -print ============== step6: restart dnode1, waiting sync end -system sh/exec.sh -n dnode1 -s start -sleep 1000 - -$loopCnt = 0 -wait_dnode1_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 20 then - return -1 -endi - -sql show dnodes -x wait_dnode1_ready -if $rows != 3 then - sleep 2000 - goto wait_dnode1_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi - -$loopCnt = 0 -wait_dnode1_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 3 then - sleep 2000 - goto wait_dnode1_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 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 - -if $data5_4 != master then - print $data5_4 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_3 != slave then -print $data5_2 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_2 != master then -print $data5_3 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -if $data7_4 != slave then - print $data7_4 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_3 != master then - print $data7_3 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_2 != slave then - print $data7_2 - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -print ============== step7: stop dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 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 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi - -sql reset query cache - -# 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 \ No newline at end of file diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim deleted file mode 100644 index 8d063020e7..0000000000 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim +++ /dev/null @@ -1,271 +0,0 @@ -# Test case describe: dnode1/dnode2 include mnode and vnode roles -# step 1: start dnode1/dnode2, and added into cluster -# step 2: create db(repl = 2), table, insert data, -# step 4: stop dnode1, remove its mnode and vnode dir, and copy mnode and vnode dir of dnode2 to dnode1 -# step 5: restart dnode1, waiting sync end -# step 6: stop dnode2, reset query cache, and query - -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 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 0 -system sh/cfg.sh -n dnode2 -c role -v 0 -#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/dnode2 and add into cluster -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 1000 -sql connect -sleep 1000 -sql create dnode $hostname2 -sleep 1000 - -print ============== step2: create database with replica 2, and create table, insert data -$totalTableNum = 10 -$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 = 1200 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -$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 rows:$rows data00:$data00 totalRows:$totalRows -if $rows != 1 then - return -1 -endi - -if $data00 != $totalRows then - return -1 -endi - - -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 dnode1 -system sh/exec.sh -n dnode1 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode1_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode1_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != offline then - sleep 2000 - goto wait_dnode1_offline -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_offline -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -#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 ============== step5: remove the mnode dir of dnode1, then copy the monde dir of dnode2 -system_content rm -rf ../../../sim/dnode1/data/vnode -system_content rm -rf ../../../sim/dnode1/data/mnode -system_content cp -rf ../../../sim/dnode2/data/vnode ../../../sim/dnode1/data/ -system_content cp -rf ../../../sim/dnode2/data/mnode ../../../sim/dnode1/data/ - -print ============== step6: restart dnode1, waiting sync end -system sh/exec.sh -n dnode1 -s start -sleep 1000 - -$loopCnt = 0 -wait_dnode1_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 20 then - return -1 -endi - -sql show dnodes -x wait_dnode1_ready -if $rows != 3 then - sleep 2000 - goto wait_dnode1_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi - -$loopCnt = 0 -wait_dnode1_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 3 then - sleep 2000 - goto wait_dnode1_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 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 - -if $data5_4 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_3 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_2 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -if $data7_4 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_3 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_2 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -print ============== step7: stop dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 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 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi - -sql reset query cache - -# 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 \ No newline at end of file diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim deleted file mode 100644 index 69e83a2c00..0000000000 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim +++ /dev/null @@ -1,205 +0,0 @@ -# Test case describe: dnode1/dnode2 include mnode and vnode roles -# step 1: start dnode1/dnode2, and added into cluster -# step 2: create db(repl = 2), table, insert data, -# step 4: stop dnode1, remove its mnode and vnode dir, and copy mnode and vnode dir of dnode2 to dnode1 -# step 5: restart dnode1, waiting sync end -# step 6: stop dnode2, reset query cache, and query - -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 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 0 -system sh/cfg.sh -n dnode2 -c role -v 0 -#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/dnode2 and add into cluster -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 1000 -sql connect -sleep 1000 -sql create dnode $hostname2 -sleep 1000 - -print ============== step2: create database with replica 2, and create table, insert data -$totalTableNum = 10 -$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 = 1200 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -$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 rows:$rows data00:$data00 totalRows:$totalRows -if $rows != 1 then - return -1 -endi - -if $data00 != $totalRows then - return -1 -endi - - -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 dnode1 -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -print ============== step5: remove the mnode dir of dnode1, then copy the monde dir of dnode2 -system_content rm -rf ../../../sim/dnode1/data/vnode -system_content rm -rf ../../../sim/dnode1/data/mnode -system_content cp -rf ../../../sim/dnode2/data/vnode ../../../sim/dnode1/data/ -system_content cp -rf ../../../sim/dnode2/data/mnode ../../../sim/dnode1/data/ - -print ============== step6: restart dnode1/dnode2 -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 1000 -sql connect -sql use $db - -$loopCnt = 0 -wait_dnode1_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 20 then - return -1 -endi - -sql show dnodes -x wait_dnode1_ready -if $rows != 3 then - sleep 2000 - goto wait_dnode1_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi - -$loopCnt = 0 -wait_dnode1_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 3 then - sleep 2000 - goto wait_dnode1_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 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 -$d2v2status = $data5_4 -$d2v3status = $data5_2 -$d2v4status = $data5_3 - -$d1v2status = $data7_4 -$d1v3status = $data7_2 -$d1v4status = $data7_3 - -if $d2v2status != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $d2v3status != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $d2v4status != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -if $d1v2status != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $d1v3status != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $d1v4status != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -sql reset query cache - -# check using select -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/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim deleted file mode 100644 index 8f837b7e47..0000000000 --- a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim +++ /dev/null @@ -1,269 +0,0 @@ -# Test case describe: dnode1/dnode2 include mnode and vnode roles -# step 1: start dnode1/dnode2, and added into cluster -# step 2: create db(repl = 2), table, insert data, -# step 4: stop dnode1, remove its vnode dir, and copy vnode dir of dnode2 to dnode1 -# step 5: restart dnode1, waiting sync end -# step 6: stop dnode2, reset query cache, and query - -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 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 0 -system sh/cfg.sh -n dnode2 -c role -v 0 -#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/dnode2 and add into cluster -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -sleep 1000 -sql connect -sleep 1000 -sql create dnode $hostname2 -sleep 1000 - -print ============== step2: create database with replica 2, and create table, insert data -$totalTableNum = 10 -$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 = 1200 -$tblNum = $totalTableNum -$totalRows = 0 -$tsStart = 1577808000000 # 2020-01-01 00:00:00.000 - -$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 rows:$rows data00:$data00 totalRows:$totalRows -if $rows != 1 then - return -1 -endi - -if $data00 != $totalRows then - return -1 -endi - - -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 dnode1 -system sh/exec.sh -n dnode1 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode1_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 then - sleep 2000 - goto wait_dnode1_offline -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != offline then - sleep 2000 - goto wait_dnode1_offline -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_offline -endi - -# check using select -sql select count(*) from $stb -print data00 $data00 -if $data00 != $totalRows then - return -1 -endi - -#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 ============== step5: remove the mnode dir of dnode1, then copy the monde dir of dnode2 -system_content rm -rf ../../../sim/dnode1/data/vnode -system_content cp -rf ../../../sim/dnode2/data/vnode ../../../sim/dnode1/data/ - -print ============== step6: restart dnode1, waiting sync end -system sh/exec.sh -n dnode1 -s start -sleep 1000 - -$loopCnt = 0 -wait_dnode1_ready: -$loopCnt = $loopCnt + 1 -if $loopCnt == 20 then - return -1 -endi - -sql show dnodes -x wait_dnode1_ready -if $rows != 3 then - sleep 2000 - goto wait_dnode1_ready -endi -print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 -print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi -if $dnode2Status != ready then - sleep 2000 - goto wait_dnode1_ready -endi - -$loopCnt = 0 -wait_dnode1_vgroup_slave: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show vgroups -if $rows != 3 then - sleep 2000 - goto wait_dnode1_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 -print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 - -if $data5_4 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_3 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data5_2 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -if $data7_4 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_3 != master then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi -if $data7_2 != slave then - sleep 2000 - goto wait_dnode1_vgroup_slave -endi - -print ============== step7: stop dnode2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -$loopCnt = 0 -wait_dnode2_offline: -$loopCnt = $loopCnt + 1 -if $loopCnt == 10 then - return -1 -endi - -sql show dnodes -if $rows != 3 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 -$dnode1Status = $data4_1 -$dnode2Status = $data4_2 - -if $dnode1Status != ready then - sleep 2000 - goto wait_dnode2_offline -endi -if $dnode2Status != offline then - sleep 2000 - goto wait_dnode2_offline -endi - -sql reset query cache - -# 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 \ No newline at end of file diff --git a/tests/script/unique/stable/dnode3.sim b/tests/script/unique/stable/dnode3.sim deleted file mode 100644 index d0708c8154..0000000000 --- a/tests/script/unique/stable/dnode3.sim +++ /dev/null @@ -1,229 +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/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 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/exec.sh -n dnode1 -s start - -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$x = 0 -createDnode: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi -if $data4_3 == offline then - goto createDnode -endi - - -print ======================== dnode1 start - -$dbPrefix = d3_db -$tbPrefix = d3_tb -$mtPrefix = d3_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $val = $x * 60000 - $ms = 1519833600000 + $val - sql insert into $tb values ($ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sql show vgroups -print vgroups ==> $rows -if $rows != 3 then - return -1 -endi - -sql show dnodes -$dnode1Vnodes = $data2_1 -print dnode1 $dnode1Vnodes -$dnode2Vnodes = $data2_2 -print dnode2 $dnode2Vnodes -$dnode3Vnodes = $data2_3 -print dnode3 $dnode3Vnodes - -if $dnode1Vnodes != 1 then - return -1 -endi -if $dnode2Vnodes != 1 then - return -1 -endi -if $dnode3Vnodes != 1 then - return -1 -endi - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select count(*) from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -sql select count(tbcol) from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step3 -sql select count(tbcol) from $tb where ts <= 1519833840000 -print ===> $data00 -if $data00 != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol) as b from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi - -sql select count(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != $rowNum then - return -1 -endi - -print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select count(*) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -sql select count(tbcol) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -print =============== step8 -sql select count(tbcol) as c from $mt where ts <= 1519833840000 -print ===> $data00 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 and ts <= 1519833840000 -print ===> $data00 -if $data00 != 25 then - return -1 -endi - -print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) -print ===> $data01 -if $data01 != 10 then - return -1 -endi - -sql select count(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 200 then - return -1 -endi - -print =============== step10 -sql select count(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 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 \ No newline at end of file diff --git a/tests/script/unique/stable/replica2_dnode4.sim b/tests/script/unique/stable/replica2_dnode4.sim deleted file mode 100644 index 4f8211d5d4..0000000000 --- a/tests/script/unique/stable/replica2_dnode4.sim +++ /dev/null @@ -1,218 +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 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 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/exec.sh -n dnode1 -s start - -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start - -$x = 0 -createDnode: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql show dnodes; -if $data4_2 == offline then - goto createDnode -endi -if $data4_3 == offline then - goto createDnode -endi -if $data4_4 == offline then - goto createDnode -endi - -print ======================== dnode1 start - -$dbPrefix = r2d4_db -$tbPrefix = r2d4_tb -$mtPrefix = r2d4_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db replica 2 -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $val = $x * 60000 - $ms = 1519833600000 + $val - sql insert into $tb values ($ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sql show vgroups -print vgroups ==> $rows -if $rows != 3 then - return -1 -endi - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select count(*) from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -sql select count(tbcol) from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step3 -sql select count(tbcol) from $tb where ts <= 1519833840000 -print ===> $data00 -if $data00 != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol) as b from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi - -sql select count(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != $rowNum then - return -1 -endi - -print =============== step6 -sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select count(*) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -sql select count(tbcol) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -print =============== step8 -sql select count(tbcol) as c from $mt where ts <= 1519833840000 -print ===> $data00 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 and ts <= 1519833840000 -print ===> $data00 -if $data00 != 25 then - return -1 -endi - -print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) -print ===> $data01 -if $data01 != 10 then - return -1 -endi - -sql select count(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 200 then - return -1 -endi - -print =============== step10 -sql select count(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi -return -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 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 \ No newline at end of file diff --git a/tests/script/unique/stable/testSuite.sim b/tests/script/unique/stable/testSuite.sim deleted file mode 100644 index 2e3ab31a44..0000000000 --- a/tests/script/unique/stable/testSuite.sim +++ /dev/null @@ -1,8 +0,0 @@ -run unique/metrics/balance_replica1.sim -run unique/metrics/dnode2_stop.sim -run unique/metrics/dnode2.sim -run unique/metrics/dnode3.sim -run unique/metrics/replica2_dnode4.sim -run unique/metrics/replica2_vnode3.sim -run unique/metrics/replica3_dnode6.sim -run unique/metrics/replica3_vnode3.sim \ No newline at end of file diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index d4032cbc0d..2af23596a3 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -20,12 +20,12 @@ if "%1" == "full" ( call :GetTimeSeconds !time! set time1=!_timeTemp! echo Start at !time! - call %%i ARG1 > result_!a!.txt 2>error_!a!.txt + call %%i ARG1 > result_!a!.txt 2>error_!a!.txt || set errorlevel=8 if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && set /a exitNum=8 && echo %%i >>failed.txt ) else ( call :colorEcho 0a "Success" &echo. ) ) ) ) - exit !exitNum! + exit /b !exitNum! ) echo Windows Taosd Test for /F "usebackq tokens=*" %%i in (simpletest.bat) do ( @@ -36,8 +36,8 @@ for /F "usebackq tokens=*" %%i in (simpletest.bat) do ( call :GetTimeSeconds !timeNow! set time1=!_timeTemp! echo Start at !timeNow! - call %%i ARG1 > result_!a!.txt 2>error_!a!.txt - if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. ) + call %%i ARG1 > result_!a!.txt 2>error_!a!.txt || set errorlevel=8 + if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit /b 8 ) else ( call :colorEcho 0a "Success" &echo. ) ) ) @REM echo Linux Taosd Test @@ -52,7 +52,7 @@ for /F "usebackq tokens=*" %%i in (simpletest.bat) do ( @REM if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. ) @REM ) @REM ) -exit +exit /b :colorEcho set timeNow=%time% diff --git a/tests/system-test/test.py b/tests/system-test/test.py index 76b83da348..2d7f78661a 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -186,7 +186,7 @@ if __name__ == "__main__": tdLog.info("Procedures for tdengine deployed in %s" % (host)) if platform.system().lower() == 'windows': fileName = fileName.replace("/", os.sep) - if (masterIp == "" and not fileName[0:12] == "0-others\\udf"): + if (masterIp == "" and not fileName == "0-others\\udf_create.py"): threading.Thread(target=checkRunTimeError,daemon=True).start() tdLog.info("Procedures for testing self-deployment") tdDnodes.init(deployPath, masterIp)