Skip to content

fix: refresh embedded seekdb index after upsert#69

Merged
xxsc0529 merged 1 commit into
oceanbase:mainfrom
webup:codex/refresh-seekdb-index-after-upsert
Jul 10, 2026
Merged

fix: refresh embedded seekdb index after upsert#69
xxsc0529 merged 1 commit into
oceanbase:mainfrom
webup:codex/refresh-seekdb-index-after-upsert

Conversation

@webup

@webup webup commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Background

Embedded SeekDB 1.3+ builds vector indexes asynchronously. A caller that writes a record and immediately performs an ANN query can therefore miss that record until the pending index work is flushed.

langchain-oceanbase exposed this path because OceanbaseVectorStore writes through pyobvector.ObClient.upsert(). ObClient.insert() already flushes the embedded SeekDB index after a successful write, but upsert() did not.

Why Fix This in pyobvector

The missing behavior is in pyobvector's shared write primitive, not in LangChain. Aligning upsert() with insert() here:

  • Gives every direct and indirect pyobvector consumer the same read-after-write ANN behavior.
  • Keeps embedded-SeekDB details behind pyobvector's existing _flush_seekdb_index() hook.
  • Avoids a LangChain-only workaround that would duplicate backend-specific logic, depend on a private pyobvector implementation detail, and leave other users exposed.

A future langchain-oceanbase dependency update can then add an end-to-end embedded HNSW regression test against the released pyobvector fix.

Change

Call the existing _flush_seekdb_index() hook after a successful ObClient.upsert() transaction, matching insert() behavior. The hook is already a no-op for non-embedded or unsupported backends, so remote OceanBase behavior is unchanged.

Validation

  • Added a regression test that confirms upsert() invokes the embedded refresh hook.
  • Verified the test fails before the change and passes afterward.
  • Ran Python compilation and staged-diff whitespace checks.

The broader embedded suite was attempted but is not counted as validation: the local pylibseekdb 1.3.0.post2 environment fails during table creation before reaching upsert().

@webup
webup marked this pull request as ready for review July 10, 2026 06:44
@xxsc0529
xxsc0529 merged commit 2512b79 into oceanbase:main Jul 10, 2026
8 checks passed
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.

2 participants