Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(resharding): fix dynamic config #10297

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions chain/chain/src/resharding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ impl Chain {
config,
..
} = state_split_request;
let config = config.get();

tracing::debug!(target: "resharding", ?config, ?shard_uid, "build_state_for_split_shards_impl starting");
tracing::debug!(target: "resharding", config=?config.get(), ?shard_uid, "build_state_for_split_shards_impl starting");

let shard_id = shard_uid.shard_id();
let new_shards = next_epoch_shard_layout
Expand Down Expand Up @@ -361,7 +359,7 @@ impl Chain {
let batch = {
let histogram = RESHARDING_BATCH_PREPARE_TIME.with_label_values(&metrics_labels);
let _timer = histogram.start_timer();
let batch = get_trie_update_batch(&config, &mut iter);
let batch = get_trie_update_batch(&config.get(), &mut iter);
let batch = batch.map_err(Into::<StorageError>::into)?;
let Some(batch) = batch else { break };
batch
Expand Down Expand Up @@ -395,11 +393,11 @@ impl Chain {

// sleep between batches in order to throttle resharding and leave
// some resource for the regular node operation
std::thread::sleep(config.batch_delay);
std::thread::sleep(config.get().batch_delay);
}

state_roots = apply_delayed_receipts(
&config,
&config.get(),
&tries,
shard_uid,
state_root,
Expand Down
1 change: 1 addition & 0 deletions chain/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ pub struct Client {
impl Client {
pub(crate) fn update_client_config(&self, update_client_config: UpdateableClientConfig) {
self.config.expected_shutdown.update(update_client_config.expected_shutdown);
self.config.state_split_config.update(update_client_config.state_split_config);
}
}

Expand Down
Loading