Skip to content

Commit

Permalink
fix: only register region keeper while creating physical table (Grept…
Browse files Browse the repository at this point in the history
…imeTeam#3223)

fix: only register region keeper during create physical table
  • Loading branch information
WenyXu authored Jan 23, 2024
1 parent 26535f5 commit d75cf86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/common/meta/src/ddl/create_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion tests-integration/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d75cf86

Please sign in to comment.