fix: only register region keeper while creating physical table (#3223)

fix: only register region keeper during create physical table
This commit is contained in:
Weny Xu
2024-01-23 18:42:32 +09:00
committed by GitHub
parent 26535f577d
commit d75cf86467
2 changed files with 12 additions and 7 deletions

View File

@@ -232,12 +232,14 @@ impl CreateTableProcedure {
region_routes: &[RegionRoute],
request_builder: CreateRequestBuilder,
) -> Result<Status> {
// Registers opening regions
let guards = self
.creator
.register_opening_regions(&self.context, region_routes)?;
if !guards.is_empty() {
self.creator.opening_regions = guards;
if self.creator.data.table_route.is_physical() {
// Registers opening regions
let guards = self
.creator
.register_opening_regions(&self.context, region_routes)?;
if !guards.is_empty() {
self.creator.opening_regions = guards;
}
}
let create_table_data = &self.creator.data;

View File

@@ -53,6 +53,7 @@ use servers::Mode;
use tempfile::TempDir;
use tonic::transport::Server;
use tower::service_fn;
use uuid::Uuid;
use crate::test_util::{
self, create_datanode_opts, create_tmp_dir_and_datanode_opts, FileDirGuard, StorageGuard,
@@ -96,7 +97,9 @@ impl GreptimeDbClusterBuilder {
let backend = EtcdStore::with_endpoints(endpoints)
.await
.expect("malformed endpoints");
Arc::new(ChrootKvBackend::new(cluster_name.into(), backend))
// Each retry requires a new isolation namespace.
let chroot = format!("{}{}", cluster_name, Uuid::new_v4());
Arc::new(ChrootKvBackend::new(chroot.into(), backend))
};
Self {