Skip to content

Commit ab73c37

Browse files
authored
Merge pull request #5343 from stacks-network/chore/silence-stale-chunk-errors
Turn common stale chunk error into a debug with its own message
2 parents dd1ebe6 + c9d3e36 commit ab73c37

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

stackslib/src/net/relay.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,14 +2499,27 @@ impl Relayer {
24992499
for chunk in sync_result.chunks_to_store.into_iter() {
25002500
let md = chunk.get_slot_metadata();
25012501
if let Err(e) = tx.try_replace_chunk(&sc, &md, &chunk.data) {
2502-
warn!(
2503-
"Failed to store chunk for StackerDB";
2504-
"stackerdb_contract_id" => &format!("{}", &sync_result.contract_id),
2505-
"slot_id" => md.slot_id,
2506-
"slot_version" => md.slot_version,
2507-
"num_bytes" => chunk.data.len(),
2508-
"error" => %e
2509-
);
2502+
if matches!(e, Error::StaleChunk { .. }) {
2503+
// This is a common and expected message, so log it as a debug and with a sep message
2504+
// to distinguish it from other message types.
2505+
debug!(
2506+
"Dropping stale StackerDB chunk";
2507+
"stackerdb_contract_id" => &format!("{}", &sync_result.contract_id),
2508+
"slot_id" => md.slot_id,
2509+
"slot_version" => md.slot_version,
2510+
"num_bytes" => chunk.data.len(),
2511+
"error" => %e
2512+
);
2513+
} else {
2514+
warn!(
2515+
"Failed to store chunk for StackerDB";
2516+
"stackerdb_contract_id" => &format!("{}", &sync_result.contract_id),
2517+
"slot_id" => md.slot_id,
2518+
"slot_version" => md.slot_version,
2519+
"num_bytes" => chunk.data.len(),
2520+
"error" => %e
2521+
);
2522+
}
25102523
continue;
25112524
} else {
25122525
debug!("Stored chunk"; "stackerdb_contract_id" => &format!("{}", &sync_result.contract_id), "slot_id" => md.slot_id, "slot_version" => md.slot_version);

0 commit comments

Comments
 (0)