Skip to content

Commit

Permalink
Fixes for storage replication (#938)
Browse files Browse the repository at this point in the history
* zenoh: remove digest's unwrap to avoid runtime panic

* fix compile error

* zenoh: remove digest's unwrap to avoid runtime panic

Author:    Nathan Ward <nathan.ward@scytherobotics.com>
Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>

* Zenoh: Fix all non-math unwrap() calls in digest.rs

Author:    Jack Morrison <jack@scytherobotics.com>
Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>

* Zenoh: Fix digest updating.

* Zenoh: Add more debug output to align queryable.

Author:    Jack Morrison <jack@scytherobotics.com>
Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>

* Zenoh Storage: update_digest doesn't need to be async.

* Zenoh Storage: Improve Digest calculation.

Cleans up mut and &mut usage and deletes before updating with new
content to prevent incorrect deletions.

Author:    Jack Morrison <jack@scytherobotics.com>
Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>

* Zenoh Storage: Replace sleeps with proper interval timers.

---------

Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>
Co-authored-by: Nathan Ward <nathan.ward@scytherobotics.com>
Co-authored-by: Jack Morrison <jack@scytherobotics.com>
  • Loading branch information
3 people authored Apr 22, 2024
1 parent bbd53f8 commit 7e52c20
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,36 @@ impl AlignQueryable {
match reply.sample {
Ok(sample) => {
tracing::trace!(
"[ALIGN QUERYABLE] Received ('{}': '{}')",
"[ALIGN QUERYABLE] Received ('{}': '{}' @ {:?})",
sample.key_expr.as_str(),
sample.value
sample.value,
sample.timestamp
);
if let Some(timestamp) = sample.timestamp {
match timestamp.cmp(&logentry.timestamp) {
Ordering::Greater => return None,
Ordering::Greater => {
tracing::error!(
"[ALIGN QUERYABLE] Data in the storage is newer than requested."
);
return None;
}
Ordering::Less => {
tracing::error!(
"[ALIGN QUERYABLE] Data in the storage is older than requested."
);
return None;
}
Ordering::Equal => return Some(sample),
Ordering::Equal => {
tracing::debug!(
"[ALIGN QUERYABLE] Data in the storage has a good timestamp."
);
return Some(sample);
}
}
} else {
tracing::error!(
"[ALIGN QUERYABLE] No timestamp on log entry sample from storage."
);
}
}
Err(err) => {
Expand Down
Loading

0 comments on commit 7e52c20

Please sign in to comment.