fix: remove vector index profile from owning table on dropIndex#2511
Draft
erichare wants to merge 1 commit into
Draft
fix: remove vector index profile from owning table on dropIndex#2511erichare wants to merge 1 commit into
erichare wants to merge 1 commit into
Conversation
createVectorIndex persists a per-index profile record (name + applied SAI options) under the owning table's VECTOR_INDEX_PROFILES extension. dropIndex previously left that entry behind, so profile metadata outlived the dropped index (metadata bloat that could later mislead a profile-echo on listIndexes). dropIndex now resolves the owning table from the keyspace metadata and, when a stored profile exists for the index, runs a sequential ALTER TABLE ... WITH extensions after the drop to remove just that entry. The rewrite reuses the clobber-safe TableExtensions.createCustomProperties so vectorize config and the other indexes' profiles are preserved. A keyspace-typed DropVectorIndexProfileDBTask is added so it can share a TaskGroup with the keyspace-typed DropIndexDBTask (a TableSchemaObject-typed AlterTableDBTask could not). KeyspaceSchemaObject exposes keyspaceMetadata() to support owning-table resolution. The happy path is not integration-testable on the default dse-server:6.9.21 backend (creating a profiled index needs custom SAI params it rejects), consistent with the parent PR; the resolution + entry-removal logic is unit tested instead.
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.
Follow-up to #2505.
createVectorIndexrecords a per-index profile under the owning table'sVECTOR_INDEX_PROFILESextension;dropIndexleft that entry behind (metadata bloat). NowdropIndexremoves it.How
TableExtensions.removeIndexProfile— finds the owning table via the live index, drops just that entry, and rebuilds the clobber-safe extensions payload (vectorize config + other profiles preserved). Returns empty when there's nothing to clean up, so non-profiled drops are unchanged.DropVectorIndexProfileDBTask— keyspace-typed so it can share aTaskGroupwithDropIndexDBTask; runsALTER TABLE … WITH extensionssequentially after the drop.KeyspaceSchemaObject.keyspaceMetadata()getter added for owning-table resolution.Pre-existing orphans (index already gone) aren't backfilled — this only stops new bloat.
Tests
Unit tests for resolution/removal and the generated
ALTER TABLE. Happy path isn't integration-testable ondse-server:6.9.21(rejects the custom SAI params), same as #2505.