Skip to content

Commit

Permalink
Remove old migration in progress function
Browse files Browse the repository at this point in the history
  • Loading branch information
acerone85 committed Oct 31, 2024
1 parent 69e38f1 commit 3d88ac5
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions crates/fuel-core/src/state/historical_rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,10 @@ where
}

fn oldest_changes_height(&self) -> StorageResult<Option<u64>> {
let modifications_history_migration_in_progress = self.is_migration_in_progress();
let modifications_history_migration_in_progress = self
.shared_migration_state
.lock()
.is_migration_in_progress();

let (v2_oldest_height, v1_oldest_height) = self.multiversion_changes_heights(
IterDirection::Forward,
Expand Down Expand Up @@ -553,7 +556,9 @@ where
let last_changes = multiversion_take(
&mut storage_transaction,
height_to_rollback,
self.is_migration_in_progress(),
self.shared_migration_state
.lock()
.is_migration_in_progress(),
)?
.ok_or(not_found!(ModificationsHistoryV1<Description>))?;

Expand All @@ -578,15 +583,6 @@ where
.set_last_height_to_be_migrated(height_to_rollback);
Ok(())
}

fn v1_entries(&self) -> BoxedIter<StorageResult<(u64, Changes)>> {
self.db
.iter_all::<ModificationsHistoryV1<Description>>(None)
}

fn is_migration_in_progress(&self) -> bool {
self.v1_entries().next().is_some()
}
}

// Try to take the value from `ModificationsHistoryV2` first.
Expand Down

0 comments on commit 3d88ac5

Please sign in to comment.