fix: remove region number validation (#1593)

* fix: remove region number validation

* Update src/mito/src/engine.rs

Co-authored-by: dennis zhuang <killme2008@gmail.com>

---------

Co-authored-by: dennis zhuang <killme2008@gmail.com>
This commit is contained in:
Weny Xu
2023-05-17 10:23:56 +09:00
committed by GitHub
parent 3330957896
commit ca75a7b744
2 changed files with 2 additions and 10 deletions

View File

@@ -450,15 +450,7 @@ impl<S: StorageEngine> MitoEngineInner<S> {
table_id, table_info
);
for target_region in &request.region_numbers {
if !table_info.meta.region_numbers.contains(target_region) {
table_error::RegionNotFoundSnafu {
table: table_ref.to_string(),
region: *target_region,
}
.fail()?
}
}
// FIXME: We cannot trust the region numbers in the manifest because other datanodes might overwrite the manifest.
let mut regions = HashMap::with_capacity(table_info.meta.region_numbers.len());

View File

@@ -460,7 +460,7 @@ async fn test_open_table_with_region_number() {
.err()
.unwrap();
assert_eq!(region_not_found.to_string(), "Failed to operate table, source: Cannot find region, table: greptime.public.demo, region: 1");
assert_eq!(region_not_found.to_string(), "Failed to operate table, source: Failed to operate table, source: Cannot find region, table: greptime.public.demo, region: 1");
let reopened = table_engine
.open_table(&ctx, open_req.clone())