Skip to content

Commit

Permalink
fix: check version before alter region
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Sep 18, 2023
1 parent c42cce5 commit eda7c40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mito2/src/worker/handle_alter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ impl<S> RegionWorkerLoop<S> {

// Get the version before alter.
let version = region.version();
if version.metadata.schema_version >= request.schema_version {
// Returns if it altered.
sender.send(Ok(Output::AffectedRows(0)));
return;
}
// Checks whether we can alter the region directly.
if !version.memtables.is_empty() {
// If memtable is not empty, we can't alter it directly and need to flush
Expand Down

0 comments on commit eda7c40

Please sign in to comment.