From ce7960726fa07d2391be642e6d4072c2ae241e08 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 16 Jul 2021 18:24:15 +0800 Subject: [PATCH] fix rs obtest case --- src/rootserver/ob_root_inspection.cpp | 3 ++- src/rootserver/ob_root_service.cpp | 3 ++- src/rootserver/ob_schema_history_recycler.cpp | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rootserver/ob_root_inspection.cpp b/src/rootserver/ob_root_inspection.cpp index 6dcb2ac0a2..8f5181a545 100644 --- a/src/rootserver/ob_root_inspection.cpp +++ b/src/rootserver/ob_root_inspection.cpp @@ -1653,9 +1653,10 @@ int ObForceDropSchemaTask::process() int ret = OB_SUCCESS; const int64_t FAST_INTERVAL = 10 * 1000 * 1000; // 10s int64_t delay = ObInspector::INSPECT_INTERVAL; -#ifdef ERRSIM +#ifdef DEBUG delay = ObServerConfig::get_instance().schema_drop_gc_delay_time; #endif + ObForceDropSchemaChecker drop_schema_checker(root_service_, root_service_.get_schema_service(), root_service_.get_common_rpc_proxy(), diff --git a/src/rootserver/ob_root_service.cpp b/src/rootserver/ob_root_service.cpp index d22b5da230..095cc64f77 100644 --- a/src/rootserver/ob_root_service.cpp +++ b/src/rootserver/ob_root_service.cpp @@ -2269,9 +2269,10 @@ int ObRootService::schedule_inspector_task() { int ret = OB_SUCCESS; int64_t inspect_interval = ObInspector::INSPECT_INTERVAL; -#ifdef ERRSIM +#ifdef DEBUG inspect_interval = ObServerConfig::get_instance().schema_drop_gc_delay_time; #endif + int64_t delay = 1 * 60 * 1000 * 1000; int64_t purge_interval = GCONF._recyclebin_object_purge_frequency; int64_t expire_time = GCONF.recyclebin_object_expire_time; diff --git a/src/rootserver/ob_schema_history_recycler.cpp b/src/rootserver/ob_schema_history_recycler.cpp index 98015c7546..4c395e751b 100644 --- a/src/rootserver/ob_schema_history_recycler.cpp +++ b/src/rootserver/ob_schema_history_recycler.cpp @@ -473,7 +473,7 @@ int ObSchemaHistoryRecycler::get_recycle_schema_version_by_standby_cluster( ret = OB_ERR_UNEXPECTED; LOG_WARN("schema_status_proxy is null", K(ret)); } else { - for (int64_t i = 0; OB_SUCC(ret) && i < tenant_ids.at(i); i++) { + for (int64_t i = 0; OB_SUCC(ret) && i < tenant_ids.count(); i++) { const uint64_t tenant_id = tenant_ids.at(i); int64_t recycle_schema_version = OB_INVALID_VERSION; ObRefreshSchemaStatus schema_status; @@ -660,6 +660,7 @@ int ObSchemaHistoryRecycler::get_recycle_schema_version_by_global_stat( } } if (OB_SUCC(ret)) { + // step 4. restore point int64_t schema_version = 0; for (int64_t i = 0; OB_SUCC(ret) && i < tenant_ids.count(); i++) { const uint64_t tenant_id = tenant_ids.at(i); @@ -670,6 +671,8 @@ int ObSchemaHistoryRecycler::get_recycle_schema_version_by_global_stat( OB_FAIL(fill_recycle_schema_versions(tenant_id, schema_version, recycle_schema_versions))) { LOG_WARN("fail to fill recycle schema versions", KR(ret), K(tenant_id), K(schema_version)); } + LOG_INFO("[SCHEMA_RECYCLE] get recycle schema version by restore point", + KR(ret), K(tenant_id), K(schema_version)); } } } -- GitLab