mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 20:46:11 +00:00
fix(odm): expose store context after relocation
Expose the ECStore instance context through a narrow accessor so relocated on-demand migration backfill code no longer reaches into private storage fields. Declare the faster-hex dependency used by the relocated native HTTP source implementation. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com>
This commit is contained in:
Generated
+1
@@ -9503,6 +9503,7 @@ dependencies = [
|
|||||||
"clap",
|
"clap",
|
||||||
"const-str",
|
"const-str",
|
||||||
"datafusion",
|
"datafusion",
|
||||||
|
"faster-hex",
|
||||||
"flatbuffers",
|
"flatbuffers",
|
||||||
"flate2",
|
"flate2",
|
||||||
"futures",
|
"futures",
|
||||||
|
|||||||
@@ -707,6 +707,10 @@ impl std::fmt::Debug for ECStore {
|
|||||||
/// These delegate to the process-global statics. No local state — the globals
|
/// These delegate to the process-global statics. No local state — the globals
|
||||||
/// remain the single source of truth until the migration is complete.
|
/// remain the single source of truth until the migration is complete.
|
||||||
impl ECStore {
|
impl ECStore {
|
||||||
|
pub fn instance_ctx(&self) -> &Arc<InstanceContext> {
|
||||||
|
&self.ctx
|
||||||
|
}
|
||||||
|
|
||||||
/// Every erasure set across all pools, pool-major order.
|
/// Every erasure set across all pools, pool-major order.
|
||||||
///
|
///
|
||||||
/// Read-only queries that must consult each set's own copy of a
|
/// Read-only queries that must consult each set's own copy of a
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ tokio-rustls = { workspace = true, default-features = false, features = ["loggin
|
|||||||
aws-smithy-runtime-api = { workspace = true, features = ["http-1x"] }
|
aws-smithy-runtime-api = { workspace = true, features = ["http-1x"] }
|
||||||
aws-smithy-types = { workspace = true }
|
aws-smithy-types = { workspace = true }
|
||||||
google-cloud-auth = { workspace = true, optional = true }
|
google-cloud-auth = { workspace = true, optional = true }
|
||||||
|
faster-hex = { workspace = true }
|
||||||
moka = { workspace = true, features = ["sync"] }
|
moka = { workspace = true, features = ["sync"] }
|
||||||
xxhash-rust = { workspace = true, features = ["xxh3"] }
|
xxhash-rust = { workspace = true, features = ["xxh3"] }
|
||||||
aws-sdk-s3 = { workspace = true, default-features = false, features = ["sigv4a", "default-https-client", "rt-tokio"] }
|
aws-sdk-s3 = { workspace = true, default-features = false, features = ["sigv4a", "default-https-client", "rt-tokio"] }
|
||||||
|
|||||||
@@ -470,10 +470,10 @@ impl BackfillContext for BucketBackfillContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn config_updated_at(&self) -> Result<Option<OffsetDateTime>, StorageError> {
|
async fn config_updated_at(&self) -> Result<Option<OffsetDateTime>, StorageError> {
|
||||||
Ok(
|
Ok(super::config::decode_stored_config(
|
||||||
super::config::decode_stored_config(get_on_demand_migration_config_in(&self.api.ctx, self.state.bucket()).await?)?
|
get_on_demand_migration_config_in(self.api.instance_ctx(), self.state.bucket()).await?,
|
||||||
.map(|(_, updated_at)| updated_at),
|
)?
|
||||||
)
|
.map(|(_, updated_at)| updated_at))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1472,7 +1472,7 @@ impl Job {
|
|||||||
/// Spawns [`run_backfill_recovery_loop`] on the store's shutdown token;
|
/// Spawns [`run_backfill_recovery_loop`] on the store's shutdown token;
|
||||||
/// `false` (nothing spawned) when the store has no background token.
|
/// `false` (nothing spawned) when the store has no background token.
|
||||||
pub fn spawn_backfill_recovery_loop(runner: Arc<BackfillRunner>) -> bool {
|
pub fn spawn_backfill_recovery_loop(runner: Arc<BackfillRunner>) -> bool {
|
||||||
let Some(cancel) = runner.api.ctx.background_cancel_token() else {
|
let Some(cancel) = runner.api.instance_ctx().background_cancel_token() else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
tokio::spawn(run_backfill_recovery_loop(runner, cancel));
|
tokio::spawn(run_backfill_recovery_loop(runner, cancel));
|
||||||
|
|||||||
Reference in New Issue
Block a user