diff --git a/crates/worker/src/partition_processor_manager/mod.rs b/crates/worker/src/partition_processor_manager/mod.rs index ccac57637..a019265bc 100644 --- a/crates/worker/src/partition_processor_manager/mod.rs +++ b/crates/worker/src/partition_processor_manager/mod.rs @@ -26,7 +26,7 @@ use tokio::sync::oneshot; use tokio::sync::{mpsc, watch}; use tokio::task::JoinSet; use tokio::time::MissedTickBehavior; -use tracing::{debug, error, info, instrument, warn, Instrument}; +use tracing::{debug, error, info, instrument, warn}; use crate::metric_definitions::NUM_ACTIVE_PARTITIONS; use crate::metric_definitions::PARTITION_IS_ACTIVE; @@ -619,7 +619,7 @@ impl PartitionProcessorManager { processor_state.stop(); } if self.pending_snapshots.contains_key(&partition_id) { - warn!(%partition_id, "Partition processor stopped while snapshot task is still pending."); + warn!(%partition_id, "Partition processor requested to stop while a snapshot task is still outstanding."); } } ProcessorCommand::Follower | ProcessorCommand::Leader => { @@ -726,7 +726,7 @@ impl PartitionProcessorManager { if let Some(pending) = self.pending_snapshots.remove(&partition_id) { let _ = pending.sender.send(response); } else { - error!("Snapshot task result received, but there was no pending sender found!") + warn!("Snapshot task result received, but there was no pending sender found!") } } @@ -800,12 +800,11 @@ impl PartitionProcessorManager { node_name: config.common.node_name().into(), }; - let snapshot_span = tracing::info_span!("create-snapshot", %snapshot_id, %partition_id); let spawn_task_result = restate_core::task_center().spawn_unmanaged( TaskKind::PartitionSnapshotProducer, "create-snapshot", Some(partition_id), - async move { create_snapshot_task.run().await }.instrument(snapshot_span), + create_snapshot_task.run(), ); match spawn_task_result { diff --git a/crates/worker/src/partition_processor_manager/snapshot_task.rs b/crates/worker/src/partition_processor_manager/snapshot_task.rs index 6c2e75135..9ff7d2250 100644 --- a/crates/worker/src/partition_processor_manager/snapshot_task.rs +++ b/crates/worker/src/partition_processor_manager/snapshot_task.rs @@ -12,7 +12,7 @@ use std::path::PathBuf; use std::time::SystemTime; use tokio::sync::oneshot; -use tracing::{debug, warn}; +use tracing::{debug, instrument, warn}; use restate_core::worker_api::SnapshotError; use restate_partition_store::snapshots::{ @@ -33,6 +33,7 @@ pub struct SnapshotPartitionTask { } impl SnapshotPartitionTask { + #[instrument(level = "info", skip_all, fields(snapshot_id = %self.snapshot_id, partition_id = %self.partition_id))] pub async fn run(self) { debug!("Creating partition snapshot");