Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What changes were proposed in this pull request?
ALTER INDEX ... CONSISTENCY = STRONG | EVENTUALnow fails on the client with a new error,ALTER_INDEX_CONSISTENCY_NOT_SUPPORTED(ERROR 917 (43M28)). The check is the first statement inMetaDataClient#alterIndex, so nothing is written toSYSTEM.CATALOGand no CDC objects are created.CONSISTENCYclause, so users get a clear error and not a syntax error. Removing the check enables the existing consistency handling again.CREATE INDEX ... CONSISTENCYand the otherALTER INDEXstatements, such asREBUILDandDISABLE, work as before.IndexMaintainerConsistencyIT#testAlterIndexConsistencyis the only test that runsALTER INDEX ... CONSISTENCY. It is ignored until PHOENIX-8046 is fixed, and the newtestAlterIndexConsistencyNotSupportedcovers the error.Why are the changes needed?
ALTER INDEX ... CONSISTENCY(PHOENIX-7794) writes the new consistency only to the index row inSYSTEM.CATALOG. Other clients and the region servers keep cached metadata with the old consistency, the client that ran the ALTER can lose the index from its cache and skip index maintenance, and the change is not coordinated with the eventually consistent index consumers. The index can then get out of sync with the data table. PHOENIX-8046 (#2658) fixes this. Until it lands, the statement should be rejected. #2658 changes the same block ofalterIndex, so it can remove this check and the@Ignore.Does this PR introduce any user-facing change?
Yes. On master and in the 5.3.1 and 5.3.2 releases,
ALTER INDEX ... CONSISTENCYchanges the consistency of the index. With this PR,ALTER INDEX IDX ON S.T CONSISTENCY = EVENTUALfails with:The check runs before the index is looked up, so an index that does not exist gets the same error, also with
IF EXISTS.How was this patch tested?
IndexMaintainerConsistencyIT#testAlterIndexConsistencyNotSupported. It creates a table and an index, and runsALTER INDEX ... CONSISTENCY=STRONGandCONSISTENCY=EVENTUAL. It checks that both fail withALTER_INDEX_CONSISTENCY_NOT_SUPPORTED. It then reads the index and the data table fromSYSTEM.CATALOG, bypassing the client cache, and checks that the index consistency is still unset and that no CDC index was created.ALTER INDEX ... CONSISTENCY=STRONG should not be supported).IndexMaintainerConsistencyITpasses locally: 2 tests pass andtestAlterIndexConsistencyis skipped.testIndexMaintainerConsistencyFromPTablecoversCREATE INDEX ... CONSISTENCY.Was this patch authored or co-authored using generative AI tooling?
Co-authored-by: Claude Code (Claude Opus 5.5)
🤖 Co-authored with Claude Code