fix(lite): make delete-on-empty armings prospective#314
Merged
Conversation
Contributor
Greptile SummaryThis PR fixes a correctness bug in the delete-on-empty (DOE) background task and tightens the semantics of DOE deadline arming. The bug was that Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[DOE Arming Paths] --> B[create_stream new stream]
A --> C[create_stream CreateOrReconfigure]
A --> D[reconfigure_stream]
A --> E[arm_doe_maybe after trim empties stream]
A --> F[maybe_doe_deadline on append]
B --> G[arm: doe_arm_delay\nretention_age plus min_age plus 600s]
C -->|prior DOE was None| G
C -->|prior DOE was Some| SKIP1[skip - prospective only]
D -->|prior DOE was None, now Some| G
D -->|prior DOE already Some| SKIP2[skip - prospective only]
E --> G
F -->|retention_age present plus refresh elapsed| G
G --> H[(KV entry: deadline plus stream_id = min_age)]
H --> I[tick_stream_doe: list expired entries]
I --> J{stream_has_records?}
J -->|yes| K[clear deadlines, skip delete]
J -->|no| L{any entry satisfies:\nwrite_ts plus min_age le deadline?}
L -->|yes| M[delete_stream]
L -->|no| K
M --> N[clear_doe_deadlines]
K --> N
Last reviewed commit: 08714f5 |
c5cb119 to
02a7abd
Compare
Member
Author
|
@greptileai rereview |
62edaef to
af8fbc2
Compare
Member
Author
|
@greptileai final review |
Merged
shikhar
pushed a commit
that referenced
this pull request
Mar 13, 2026
## 🤖 New release * `s2-api`: 0.27.9 -> 0.27.10 (✓ API compatible changes) * `s2-lite`: 0.29.21 -> 0.29.22 (✓ API compatible changes) * `s2-cli`: 0.29.21 -> 0.29.22 <details><summary><i><b>Changelog</b></i></summary><p> ## `s2-api` <blockquote> ## [0.27.10] - 2026-03-13 ### Performance - Avoid intermediate SSE batch allocations ([#320](#320)) <!-- generated by git-cliff --> </blockquote> ## `s2-lite` <blockquote> ## [0.29.22] - 2026-03-13 ### Bug Fixes - Make delete-on-empty armings prospective ([#314](#314)) ### Performance - Avoid intermediate SSE batch allocations ([#320](#320)) <!-- generated by git-cliff --> </blockquote> ## `s2-cli` <blockquote> ## [0.29.22] - 2026-03-13 <!-- 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.
Closes #274.
Summary
(deadline, min_age)pairs instead of mixing maximaTesting
just fmtcargo clippy -p s2-lite --all-targets -- -D warningscargo test -p s2-lite stream_doeNotes
just testhit an unrelated local-environment failure ins2-cli::cli missing_access_tokenbecauses2 list-basinssucceeded on this machine with existing auth