Skip to content

feat(index): support dry_run in drop_global_index#489

Draft
JunRuiLee wants to merge 6 commits into
apache:mainfrom
JunRuiLee:feat/global-index-drop-dry-run
Draft

feat(index): support dry_run in drop_global_index#489
JunRuiLee wants to merge 6 commits into
apache:mainfrom
JunRuiLee:feat/global-index-drop-dry-run

Conversation

@JunRuiLee

Copy link
Copy Markdown
Contributor

Stacked on #487 — this branch builds on feat/global-index-drop-lumina-vindex. Until #487 merges, the diff below also shows #487's commits; it will narrow to just the dry_run commit once #487 is merged. Kept as draft until then.

Purpose

Add dry_run to drop_global_index, matching Java's #8309. A dry run reports how many global index files a drop would remove, committing nothing — a safety preview before the irreversible metadata commit. Because it lives in the shared GlobalIndexDropBuilder, it covers all supported types (btree/bitmap/lumina/vindex) in one change.

Changes

  • GlobalIndexDropBuilder: new with_dry_run(bool); execute() still returns the matched count (usize), but on dry-run short-circuits before the commit, so nothing is written. The non-dry-run path is unchanged.
  • sys.drop_global_index: parses the dry_run arg (true/false, case-insensitive; invalid → error), and on dry-run returns Would drop N global index file(s) instead of committing.

Out of scope

partitions remains NotImplemented (separate follow-up).

Tests

  • Builder: dry-run returns the matched count and leaves the index entry in place (no commit), then a real drop removes it; dry-run with no match returns 0.
  • Procedure: drop_global_index(... dry_run => true) leaves $table_indexes unchanged, then a real drop empties it; invalid dry_run value is rejected.

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.

1 participant