Repository navigation
Conversation
…ore writer Archive, unarchive and delete now take a list of threads and persist with one index write per command; deleting a project and the settle cascades do the same. External import prepares each thread off the host loop, installs its log through the store writer and indexes the whole run in one batched upsert, so nothing outside the writer rewrites sessions.json while the host runs and the in-memory index is no longer replaced from disk. PROTOCOL_VERSION 9: ArchiveSessions, UnarchiveSessions and DeleteSessions replace the single-thread commands. Closes #520 Closes #521
Owner
Author
|
Folded into #591, which carries this commit unchanged as one PR for the whole storage phase. |
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
First slice of the storage work in #535. Closes #520 and #521. It is the prerequisite for the redb index (#523 / #588), which needs the store writer to be the only owner of index writes.
Archive, unarchive and delete become batch commands, and every lifecycle path persists its index once instead of once per thread.
Also: a project deleted mid-import no longer gets sessions written against its id (their logs are removed), and a batch naming an unknown thread is rejected whole with
unknown_session, as the single commands were.Not changed: lifecycle semantics. Deleting a thread still leaves descendants with a dangling parent (#518). One side effect:
Command::session_id()isNonefor batch commands, so a thread whose only pending command is an archive or delete no longer appears in the outbox's pending-thread list.Evidence
Index writes counted with temporary counters (removed) at 200 threads:
lifecycle_batches_apply_exact_timestamp_cascades_and_persist(renamed and extended) drives the batched commands andDeleteProjectthrough the pipe handler and asserts the reopened store. MakingRemoveSessionspersist only its first id fails it.prepare_importcannot write; within-run dedupe stays covered byimport_finalizes_the_index_before_finished_even_after_the_initiator_disconnects.Android not run locally (no NDK). No visual change.
Merge Danger
Door: two-way
No on-disk format change. Reverting restores the per-thread commands.
Blast Radius: protocol
The protocol version bumps and the single-id commands are removed rather than wrapped, so every client updates with the host. The branch is currently conflicting with
mainon the version constant (#584 and #586 bumped it since); it needs a rebase to 10 before merge.