Skip to content

fix: allow disabling per-request document flush - #14

Open
iaojnh wants to merge 1 commit into
zvec-ai:mainfrom
iaojnh:codex/batch-commit
Open

iaojnh wants to merge 1 commit into
zvec-ai:mainfrom
iaojnh:codex/batch-commit

Conversation

@iaojnh

@iaojnh iaojnh commented Oct 26, 2026

Copy link
Copy Markdown

Summary

Flushing after every document write can seal the current write block and create a new FLAT index file on the next request, growing storage by roughly 5 MB for each small insert. Add the process-wide ZVEC_STUDIO_AUTO_FLUSH=false setting so consecutive CRUD requests can reuse the current write block. The default remains true for compatibility.

Explicit flush and collection close still save pending writes, and file imports still flush once at the end. If flushing during close fails, keep the collection registered and propagate the error so saving can be retried. With automatic flushing disabled, users must explicitly save or close the collection before stopping the server; abnormal termination may lose unsaved changes.

The change is limited to backend configuration, the existing write/close paths, documentation, and regression tests. No Zvec SDK changes or frontend changes are required.

Validation

  • Backend: 585 unit and integration tests passed against Zvec 0.7.0.
  • Real FLAT-index regression coverage verifies three separate inserts produce one .proxima file with deferred flushing, versus three with the default; saved documents survive close/reopen.
  • Regression coverage also verifies all six CRUD paths, explicit flush, import flushing, and retry after a close-time flush failure.
  • Frontend: 329 tests passed; TypeScript checks and the production build passed.
  • Ruff, mypy, dependency lock validation, and git diff --check passed.

Signed-off-by: Zefeng Yin <yinzefeng.yzf@alibaba-inc.com>
@iaojnh
iaojnh force-pushed the codex/batch-commit branch from ba576b3 to 059fe94 Compare October 26, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant