Skip to content

Commit

Permalink
fix(migration): release storage locks
Browse files Browse the repository at this point in the history
Closes #4344. Hat tip to @erwanor for spotting the omission.
  • Loading branch information
conorsch committed May 7, 2024
1 parent 15f347c commit 0e4bb1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bin/pd/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl Migration {
storage.release().await;
let storage = Storage::load(rocksdb_dir, SUBSTORE_PREFIXES.to_vec()).await?;
let migrated_state = storage.latest_snapshot();
storage.release().await;

// The migration is complete, now we need to generate a genesis file. To do this, we need
// to lookup a validator view from the chain, and specify the post-upgrade app hash and
Expand Down Expand Up @@ -254,6 +255,7 @@ pub async fn last_block_timestamp(home: PathBuf) -> anyhow::Result<tendermint::T
.get_block_timestamp()
.await
.context("error reading latest block timestamp")?;
storage.release().await;
Ok(last_block_time)
}

Expand Down
1 change: 1 addition & 0 deletions crates/bin/pd/src/migrate/testnet74.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ pub async fn migrate(
storage.release().await;
let storage = Storage::load(rocksdb_dir, SUBSTORE_PREFIXES.to_vec()).await?;
let migrated_state = storage.latest_snapshot();
storage.release().await;

// The migration is complete, now we need to generate a genesis file. To do this, we need
// to lookup a validator view from the chain, and specify the post-upgrade app hash and
Expand Down

0 comments on commit 0e4bb1a

Please sign in to comment.