Repository navigation
fix(index): keep the earliest-created segment when every index segment is empty - #10107
Merged
wjones127 merged 1 commit intoOct 17, 2026
Merged
Conversation
When every segment of an index has empty live coverage, retain_relevant_indices kept the one with the lowest dataset_version. That is a watermark, not a creation time, so it could keep a newer segment and lose the earliest created_at. Order by created_at instead, with segments lacking one last and ties on the lowest dataset_version. Closes lance-format#10097
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The earliest known creation timestamp now survives all-empty retention, addressing #10097. All 20 focused retention tests pass, including the new ordering regression and the existing coverage and missing-timestamp cases.
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.
Closes #10097.
When every segment of an index has empty live coverage,
retain_relevant_indiceskeeps a single segment as the index definition. It picked the lowestdataset_version, but that's a watermark rather than a creation time (merges take the minimum of their sources, remaps raise it), so it could keep a newer segment and lose the earliestcreated_at.This sorts the all-empty segments by
created_atinstead, as #10097 / #10090 describe: segments without acreated_atgo after those with one, and ties fall back to the lowestdataset_version. Segments that all lackcreated_atbehave exactly as before.Testing: added
test_retain_multiple_empty_indices_keeps_earliest_created(fails on main, passes here).cargo test -p lance-table --libpasses, andcargo fmt/cargo clippy -p lance-table --testsshow nothing new.I used an AI coding assistant to help write this change and the test; I reviewed the diff and ran the tests above.