Repository navigation
index: wait for named indices with a bounded timeout - #85
Merged
Merged
Conversation
Expose the SDK's `Table::wait_for_index` so a caller can block until the indices it names report no unindexed rows. The call takes explicit names and a positive millisecond budget; the poll interval and the maximum budget stay SDK behavior, and its errors, including the rejection of a too-large budget, reach the caller unchanged. Waiting does not build an index, so wait-all, zero and indefinite budgets are rejected instead of being reinterpreted.
The SDK checks its budget between polling rounds, so the listing and statistics requests of a round, and the diagnostics of the last round, finish after the budget has run out. The binding does not interrupt them and cannot promise a wall-clock bound.
…x-wait # Conflicts: # tests/test_index.cpp
Intel macOS is no longer a supported platform, so the matrix must not launch the macos-15-intel runner. Package script and documentation references are removed by the standalone packaging change.
…x-wait # Conflicts: # tests/test_index.cpp
…x-wait # Conflicts: # include/lancedb.h # src/index.rs
This was referenced Nov 22, 2026
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.
The C API can create, list and drop indices, but not wait for one. lancedb-go needs that operation for its
WaitForIndex(ctx, names, timeout)contract, which today is implemented in its own cgo FFI, and a C consumer that starts an index build has no way to learn when the build has committed.This adds
lancedb_table_wait_for_index(table, index_names, num_index_names, timeout_ms, error_message), which binds the SDK'sTable::wait_for_index. It blocks until every named index reports no unindexed rows, and returnsLANCEDB_TIMEOUTwhen the budget no longer allows another polling round. The SDK's own error code and message reach the caller for everything else.The budget is the SDK's polling budget, not a wall-clock bound: the SDK checks it between rounds, so the listing and statistics requests of a round, and the diagnostics it reads after the last one, complete after the budget has run out. The binding does not interrupt them.
The operation is deliberately narrow because the SDK is:
InvalidInputand message reach the caller, so the binding does not carry a second copy of the limit.docs/index.rstpoint at index creation and optimization instead.Integration with the runtime rework: this branch is based on
mainand callsget_runtime(), which #76 replaces withrun_blocking. A clean merge of the two therefore leaves the new wait call uncompilable, and the branch that lands second must move it ontorun_blockingwith an ownedTableclone and owned names, because the spawned future must be'static. Nothing else needs adapting, and no ordering is required: either branch can land first.Verification:
cargo fmt --check,cargo checkandcargo clippypass; the public header compiles as C, and the test translation unit compiles against it. The new cases intests/test_index.cpprun in the existinglancedb_index_teststarget on hosted CI, which is where the C++ suite runs for this change: the successful named wait, a missing index that times out, the SDK's rejection of an over-cap budget, and the invalid pointer, length, UTF-8 and zero-budget inputs, without long sleeps.