Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions d-engine-core/src/raft_role/leader_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3247,7 +3247,7 @@ impl<T: TypeConfig> LeaderState<T> {
// Step 1: Remove stale entries (older than configured threshold)
let now = Instant::now();
self.pending_promotions.retain(|entry| {
now.duration_since(entry.ready_since) <= config.stale_learner_threshold
now.saturating_duration_since(entry.ready_since) <= config.stale_learner_threshold
});

if self.pending_promotions.is_empty() {
Expand Down Expand Up @@ -3661,10 +3661,11 @@ impl<T: TypeConfig> LeaderState<T> {
trace!(
"Inspecting entry: {:?} - {:?} - {:?}",
entry,
now.duration_since(entry.ready_since),
now.saturating_duration_since(entry.ready_since),
&config.stale_learner_threshold
);
if now.duration_since(entry.ready_since) > config.stale_learner_threshold {
if now.saturating_duration_since(entry.ready_since) > config.stale_learner_threshold
{
stale_entries.push(entry);
} else {
// Return non-stale entry and stop
Expand Down
5 changes: 4 additions & 1 deletion d-engine-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ pub use d_engine_core::Result;
pub use d_engine_core::SnapshotError;
/// Storage-specific error type
pub use d_engine_core::StorageError;
// -------------------- Extension Traits --------------------
// -------------------- Client API --------------------
pub use api::EmbeddedClient;
/// Unified client operations trait (put/get/delete/CAS/watch).
/// Re-exported here so embedded-mode users don't need a separate d-engine-client dependency.
pub use d_engine_core::client::{ClientApi, ClientApiError, ClientApiResult};
/// Storage trait for implementing custom storage backends
///
/// Implement this trait to create your own storage engine.
Expand Down
Loading