[core] Rethrow foreign typed 404s from alterTable - #10268
Open
LuciferYang wants to merge 1 commit into
Open
LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
The alterTable catch for NoSuchResourceException translated TABLE and COLUMN typed 404s but silently returned for any other resource type, for example a DATABASE typed 404 when the database was dropped concurrently, so a failed ALTER reported success. Rethrow unhandled resource types like the sibling methods do. Assisted-by: GLM-5.3
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.
Purpose
RESTCatalog.alterTablehandles aNoSuchResourceExceptionby mapping theTABLEandCOLUMNresource types to the right behavior, but withignoreIfNotExists = falseany other resource type falls through the if/else-if chain and the method returns normally, reporting success on an alter that did not apply. This happens when the server returns a non-table/column 404, for example aDATABASEnot-found because the table's database was concurrently dropped.This rethrows the exception for the unmapped resource types, so the failure reaches the caller. The sibling
createBranchalready rethrows in the analogous default branch of the same dispatch. TheignoreIfNotExists = truepath is unchanged and still swallows every 404.This closes #10267.
Tests
MockRESTCatalogTestgains a case that injects a non-table/column 404 intoalterTablewithignoreIfNotExists = falseand asserts the exception propagates. Without the fix the method returned normally, so the assertion failed.API and Format
No.
Documentation
No.