Skip to content

Commit

Permalink
Experiment: also don't write clock tags to WAL in partial state (qdra…
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Nov 8, 2024
1 parent 6afdac1 commit 06b557c
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions lib/collection/src/wal_delta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ impl RecoverableWal {
&'a self,
operation: &mut OperationWithClockTag,
) -> crate::wal::Result<(u64, ParkingMutexGuard<'a, SerdeWal<OperationWithClockTag>>)> {
// If clcoks are disabled, remove the clock tag from the operation and always accept it
if !self.clocks_enabled.load(Ordering::Acquire) {
operation.clock_tag.take();
}

// Update last seen clock map and correct clock tag if necessary
if self.clocks_enabled.load(Ordering::Acquire) {
if let Some(clock_tag) = &mut operation.clock_tag {
let operation_accepted = self
.newest_clocks
.lock()
.await
.advance_clock_and_correct_tag(clock_tag);

if !operation_accepted {
return Err(crate::wal::WalError::ClockRejected);
}
if let Some(clock_tag) = &mut operation.clock_tag {
let operation_accepted = self
.newest_clocks
.lock()
.await
.advance_clock_and_correct_tag(clock_tag);

if !operation_accepted {
return Err(crate::wal::WalError::ClockRejected);
}
}

Expand Down

0 comments on commit 06b557c

Please sign in to comment.