fix(g2-followup): tiebreak newest-first journal scans on event_id#159
Merged
Merged
Conversation
The bounded journal scan added in S4 (PR #158) ordered by `{time_column} DESC` with no secondary key, unlike the existing ascending path's `ASC, event_id ASC` total order. Two rows sharing an identical timestamp for the same entity resolved to whichever the backend happened to emit first — nondeterministic across backends and across reloads. Add `, event_id DESC` to restore a total order and match the old last-write-wins tie behavior deterministically. Found in an Opus review pass standing in for the unavailable Codex review step.
DORA Metrics
MTTR note: No failed mainline CI runs in the selected window. |
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
{time_column} DESCwith no secondary key, unlike the pre-existing ascending path (ASC, event_id ASC), which is a total order., event_id DESCto the descending branch to restore a total order, matching old last-write-wins behavior deterministically.Found during an Opus review pass (standing in for the currently-unavailable Codex review step) of merged PR #158. Low severity / non-blocking per that review — only reachable with two different-status rows for one order at a byte-identical timestamp, which the demo seed never produces — but cheap and correct to close now.
Test plan
ruff check/ruff format --checkcleantest_pipeline_events_scan.py,test_stuck_orders.py,test_exceptions_inbox.py— 28 passed🤖 Generated with Claude Code