fix(lite): initialize durability notifier from close status#312
Merged
Conversation
Contributor
Greptile SummaryThis PR fixes a bug in Key changes:
The fix is minimal, logically sound, and does not introduce any race conditions: the Confidence Score: 5/5
Sequence DiagramsequenceDiagram
participant Caller
participant DN as DurabilityNotifier
participant Task as run_notifier task
participant DB as slatedb watch channel
Caller->>DN: spawn(db)
DN->>DB: subscribe() returns status_rx
DN->>DB: borrow() returns initial_status
alt initial_status.close_reason is None
DN->>Task: tokio::spawn(run_notifier)
DN-->>Caller: Self { state: closed_reason=None }
loop on each status change
Task->>DB: changed().await
Task->>Task: notify_waiters(durable_seq)
opt close_reason is Some
Task->>Task: close_with_reason then exit
end
end
else initial_status.close_reason is Some
Note over Task: Task NOT spawned
DN-->>Caller: Self { state: closed_reason=Some }
end
Caller->>DN: subscribe(target_seq, callback)
alt closed_reason is Some
DN->>Caller: callback(Err(reason)) synchronously
else last_durable_seq >= target_seq
DN->>Caller: callback(Ok(durable_seq)) synchronously
else pending
DN->>DN: enqueue sorted Waiter
end
Last reviewed commit: e4f731c |
Merged
shikhar
pushed a commit
that referenced
this pull request
Mar 6, 2026
## 🤖 New release * `s2-lite`: 0.29.20 -> 0.29.21 (✓ API compatible changes) * `s2-sdk`: 0.24.7 -> 0.24.8 (✓ API compatible changes) * `s2-cli`: 0.29.20 -> 0.29.21 <details><summary><i><b>Changelog</b></i></summary><p> ## `s2-lite` <blockquote> ## [0.29.21] - 2026-03-06 ### Bug Fixes - Allow http endpoints for S3-compatible object stores ([#303](#303)) - Preserve follow wait budget after lagged recovery ([#311](#311)) - Initialize durability notifier from close status ([#312](#312)) <!-- generated by git-cliff --> </blockquote> ## `s2-sdk` <blockquote> ## [0.24.8] - 2026-03-06 ### Bug Fixes - Compression and FrameSignal ordering ([#313](#313)) <!-- generated by git-cliff --> </blockquote> ## `s2-cli` <blockquote> ## [0.29.21] - 2026-03-06 <!-- generated by git-cliff --> </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: s2-release-plz[bot] <262023388+s2-release-plz[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DurabilityNotifierstate from the subscribedDbStatus, includingclose_reasonDb::close()Closes #307
Testing