镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix partial vec0 rows after invalid metadata INSERT - #360

Open
dajiaohuang wants to merge 1 commit into
asg017:mainfrom
dajiaohuang:fix/issue-333-atomic-insert-20261028
Open

dajiaohuang wants to merge 1 commit into
asg017:mainfrom
dajiaohuang:fix/issue-333-atomic-insert-20261028

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #333.

vec0Update_Insert wrote rowid/chunk/vector data before vec0_write_metadata_value checked metadata types. An invalid metadata value could therefore return an INSERT error after partial writes. Validate all supplied metadata values before conflict replacement or row writes, and reuse the same type check in the metadata writer.

The regression test reproduces the explicit-transaction sequence with synthetic vectors: a valid insert, an invalid INTEGER metadata value, a later valid insert, and commit. It asserts that only successful rows remain, the rejected vector is not searchable, and its rowid is available for a corrected retry.

Validation on task-local Windows tooling:

  • Built the loadable extension from the checkout and its vendored SQLite amalgamation with task-local Zig 0.16.0 (21 compiler warnings, all unused parameters/variable).
  • pytest tests/test-loadable.py tests/test-metadata.py tests/test-insert-delete.py: 83 passed, 4 skipped; 144 snapshots passed.
  • git diff --check and staged diff check passed.

This branch has not been deployed

No deployments
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.

Failed vec0 INSERT leaves a persistent, searchable ghost row in v0.1.9

1 participant