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 39e0e11
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 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,19 @@ impl<S> RegionWorkerLoop<S> {

// Get the version before alter.
let version = region.version();
<<<<<<< Updated upstream
if version.metadata.schema_version >= request.schema_version {
=======
if version.metadata.schema_version > request.schema_version {
warn!(
"region schema version {} greater than request schema version {}",
version.metadata.schema_version, request.schema_version
);
>>>>>>> Stashed changes
// 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 39e0e11

Please sign in to comment.