feat: impl migrate_region and procedure_state SQL function (#3325)

* fix: logical region can't find region routes

* feat: fetch partitions info in batch

* refactor: rename batch functions

* refactor: rename DdlTaskExecutor to ProcedureExecutor

* feat: impl migrate_region and query_procedure_state for ProcedureExecutor

* feat: adds SQL function procedure_state and finish migrate_region impl

* fix: constant vector

* feat: unit tests for migrate_region and procedure_state

* test: test region migration by SQL

* fix: compile error after rebeasing

* fix: clippy warnings

* feat: ensure procedure_state and migrate_region can be only called under greptime catalog

* fix: license header
This commit is contained in:
dennis zhuang
2024-02-22 10:37:11 +08:00
committed by GitHub
parent e9a2b0a9ee
commit 564fe3beca
48 changed files with 994 additions and 189 deletions

View File

@@ -52,7 +52,8 @@ where
pub(crate) fn sample_script_engine() -> PyEngine {
let catalog_manager =
MemoryCatalogManager::new_with_table(NumbersTable::table(NUMBERS_TABLE_ID));
let query_engine = QueryEngineFactory::new(catalog_manager, None, None, false).query_engine();
let query_engine =
QueryEngineFactory::new(catalog_manager, None, None, None, false).query_engine();
PyEngine::new(query_engine.clone())
}

View File

@@ -385,7 +385,7 @@ mod tests {
let catalog_manager =
MemoryCatalogManager::new_with_table(NumbersTable::table(NUMBERS_TABLE_ID));
let query_engine =
QueryEngineFactory::new(catalog_manager, None, None, false).query_engine();
QueryEngineFactory::new(catalog_manager, None, None, None, false).query_engine();
PyEngine::new(query_engine.clone())
}

View File

@@ -56,7 +56,7 @@ pub async fn setup_scripts_manager(
let catalog_manager = MemoryCatalogManager::new_with_table(table.clone());
let factory = QueryEngineFactory::new(catalog_manager.clone(), None, None, false);
let factory = QueryEngineFactory::new(catalog_manager.clone(), None, None, None, false);
let query_engine = factory.query_engine();
let mgr = ScriptManager::new(Arc::new(MockGrpcQueryHandler {}) as _, query_engine)
.await