feat: add ingestion recovery and concurrent add pipeline#104
Open
gwokhou wants to merge 2 commits into
Open
Conversation
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
Follow-up to #86. That PR added cooperative KB mutation locks and atomic state writes, and left concurrent ingestion / transactional recovery for follow-up work. This PR adds per-ingest recovery journals plus concurrent directory preparation, while keeping live KB commits serialized under the mutation lock.
Changes
addmutations.openkb add <directory>.pageindex.db-wal,pageindex.db-shm,pageindex.db-journal) in long-document rollback coverage.Add pipeline
Only file-local preparation is parallel. Any live KB mutation remains serialized under the KB mutation lock, and each committed file gets its own recovery journal.
Related work / merge notes
add --from-pageindex-cloud(closes #88) #97 / [Feature] Support importing existing PageIndex Cloud indices #88: cloud import is out of scope. If feat(cli): import existing PageIndex Cloud indices viaadd --from-pageindex-cloud(closes #88) #97 lands first, itspageindex_cloudpath should be rebased through this recovery/commit boundary or explicitly kept separate.HashRegistrymodel and adds onlyHashRegistry.memory()for reservation. If Add SQLite-backed registry with JSON migration support #15 lands first, this branch needs a registry-abstraction rebase and snapshot coverage forhashes.db*.openkb/cli.py.Scope boundaries
addpath.wiki/log.mdis post-commit best-effort: successful ingests remain visible even if log append fails.Validation
git diff --check upstream/main..HEADUV_CACHE_DIR=/tmp/uv-cache UV_PYTHON=3.13 uv run --extra dev pytest tests/test_add_command.py tests/test_mutation.py tests/test_converter.pyResult: 53 passed. Existing tests still emit
compile_short_doccoroutine warning noise; no test failed.