Skip to content

Commit

Permalink
refactor(storage-manager): improve logging
Browse files Browse the repository at this point in the history
* plugins/zenoh-plugin-storage-manager/src/replication/core.rs:
  - Log the `DigestDiff` when a misalignment is detected.
  - Removed the log indicated that an alignment query is received as it
    is redundant with later logs.

* plugins/zenoh-plugin-storage-manager/src/replication/log.rs: added a
  trace when an event is added to the Replication Log.

* plugins/zenoh-plugin-storage-manager/src/storages_mgt/service.rs:
  - Only print the key expression of the sample being processed.
  - Remove the redundant log indicating the the sample is being
    processed.

Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>
  • Loading branch information
J-Loudet authored and gabrik committed Oct 11, 2024
1 parent 85b2cf4 commit 55eb81a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions plugins/zenoh-plugin-storage-manager/src/replication/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Replication {
};

if let Some(digest_diff) = digest.diff(other_digest) {
tracing::debug!("Potential misalignment detected");
tracing::debug!("Potential misalignment detected: {digest_diff:?}");

let replica_aligner_ke = match keformat!(
aligner_key_expr_formatter::formatter(),
Expand Down Expand Up @@ -465,8 +465,6 @@ impl Replication {
continue;
}

tracing::trace!("Received Alignment Query");

let replication = replication.clone();
tokio::task::spawn(async move { replication.aligner(query).await });
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/zenoh-plugin-storage-manager/src/replication/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ impl LogLatest {
return;
};

tracing::trace!("Inserting < {:?} > in Replication Log", event.key_expr());

self.bloom_filter_event.set(event.key_expr());

self.intervals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl StorageService {
// The storage should only simply save the key, sample pair while put and retrieve the same
// during get the trimming during PUT and GET should be handled by the plugin
pub(crate) async fn process_sample(&self, sample: Sample) -> ZResult<()> {
tracing::trace!("[STORAGE] Processing sample: {:?}", sample);
tracing::trace!("[STORAGE] Processing sample: {:?}", sample.key_expr());

// A Sample, in theory, will not arrive to a Storage without a Timestamp. This check (which,
// again, should never enter the `None` branch) ensures that the Storage Manager
Expand Down Expand Up @@ -254,12 +254,6 @@ impl StorageService {
continue;
}

tracing::trace!(
"Sample `{:?}` identified as needed processing for key {}",
sample,
k
);

// there might be the case that the actual update was outdated due to a wild card
// update, but not stored yet in the storage. get the relevant wild
// card entry and use that value and timestamp to update the storage
Expand Down

0 comments on commit 55eb81a

Please sign in to comment.