Repository navigation
feat(index): catch the index up from the op log - #108
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PiquelChips
force-pushed
the
feat/events-index-catch-up
branch
2 times, most recently
from
November 22, 2026 18:54
b20ec4a to
8a31bb2
Compare
A batch appended its records to the index before publishing them, and marked them published after, under a shared index lock. With the op log there were two logs of every batch, each synced. Writers no longer touch the index: a batch logs its records in the op log, with what the index keeps of them, synced with the records. Opening the index catches up: it reads the op log after the last entry it has, adds the records that are published, and appends them to the index, with that entry's sequence number, without syncing. A frame lost to a crash is caught up again from the op log, and if the op log no longer keeps the entries, the index is rebuilt. An entry whose write is still in progress is looked at again next time. The records published after it meanwhile, such as this process's own, are taken in memory only, since a power loss may take them back before their entry settles. A rebuild starts from the op log's last settled entry, and keeps the records of later entries in memory the same way. The index's format moves to version 3.
PiquelChips
force-pushed
the
feat/events-index-catch-up
branch
from
November 22, 2026 19:20
8a31bb2 to
81d71fa
Compare
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.
A batch appended its records to the index before publishing them, and marked them published afterwards. With the op log, every batch was logged twice, and each log was synced.
Writers no longer touch the index. A batch logs its records in the op log, with what the index keeps of them, synced with the records. Opening the index catches up: it reads the op log after the last entry it has, adds the records that are published, and appends them to the index without syncing. If a crash loses an appended frame, the index catches up again from the op log. If the op log no longer keeps those entries, the index is rebuilt.
The index stops before an entry whose write is still in progress, and looks at it again next time. It takes records published after that entry, such as this process's own, in memory only, since a power loss may take them back before their entry settles. The index only writes records of settled entries. A rebuild starts from the op log's last settled entry and keeps the records of later entries in memory the same way. The index format moves to version 3.
rebuilds_never_miss_concurrent_writespassed 300/300 with the op log's segment fix.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)