Skip to content

test(index): cover no-op optimize after compaction - #8408

Open
lance-gatefixer[bot] wants to merge 1 commit into
mainfrom
gatekeeper/fix-6659-1
Open

test(index): cover no-op optimize after compaction#8408
lance-gatefixer[bot] wants to merge 1 commit into
mainfrom
gatekeeper/fix-6659-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Summary

  • extend the existing optimize_indices no-op regression through index-segment consolidation and file compaction
  • assert repeated optimization preserves both the dataset version and the complete dataset file set

Root cause and fix

The original defect rebuilt steady-state index groups even when no fragments were unindexed, creating a new index UUID directory and manifest version on every call. The production no-op checks are already present on main; this change closes the remaining regression-coverage gap for the issue's reported compact-then-reoptimize sequence so future compaction or index-remap changes cannot silently restore the disk churn.

Validation

  • make build
  • uv run pytest python/tests/test_optimize.py::test_optimize_indices_second_call_is_noop
  • uv run make format
  • uv run make lint (passes; Pyright reports 10 existing missing-stub warnings)

Fixes #6659

@github-actions github-actions Bot added chore A-python Python bindings labels Aug 7, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The change extends the existing no-op regression through index-segment consolidation and an actual fragment compaction while preserving both dataset-version and full file-set invariants. Reusing the existing all-index test keeps this coverage focused on the Python end-to-end contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset optimize_indices seems to duplicate all the indices everytime, and the disk

0 participants