@@ -2499,14 +2499,27 @@ impl Relayer {
2499
2499
for chunk in sync_result. chunks_to_store . into_iter ( ) {
2500
2500
let md = chunk. get_slot_metadata ( ) ;
2501
2501
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
+ }
2510
2523
continue ;
2511
2524
} else {
2512
2525
debug ! ( "Stored chunk" ; "stackerdb_contract_id" => & format!( "{}" , & sync_result. contract_id) , "slot_id" => md. slot_id, "slot_version" => md. slot_version) ;
0 commit comments