Repository navigation
HIVE-30234: Iceberg: HiveCatalog rename can revert a concurrent commit's metadata_location - #6977
Open
hemanthumashankar0511 wants to merge 1 commit into
Open
hemanthumashankar0511 wants to merge 1 commit into
hemanthumashankar0511 wants to merge 1 commit into
Conversation
…t's metadata_location
|
This branch has not been deployed
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?
Send metadata_location CAS on HiveCatalog rename (same as no-lock commits) and fail with CommitFailedException on concurrent modify.
Why are the changes needed?
Rename could overwrite HMS params and silently drop a concurrent Iceberg snapshot.
Does this PR introduce any user-facing change?
Yes, concurrent rename now fails loudly instead of losing data
How was this patch tested?
Ran new unit test
mvn test -pl iceberg/iceberg-catalog -Dtest=TestHiveCatalogRenameConcurrencyTez on Yarn Integration test
Started the cluster in debug mode:
mvn test -Pitests,tez-yarn -pl itests/tez-yarn-it -Dtest=StartTezYarnCluster -Dmaven.surefire.debugAttached the IDE debugger to port 5005 and set a thread breakpoint in
HiveCatalog.renameTableOrViewafter getTable (before alterTable).Opened two Beeline sessions to HiveServer2 (session 1 and 2):
beeline -u 'jdbc:hive2://localhost:10000/default;auth=noSasl' -n hiveIn session 2, created the table and inserted the first row (no-lock mode for embedded Derby):
In session 1, started a rename and paused on the breakpoint:
ALTER TABLE ice_t RENAME TO ice_t2;In session 2, while 1 was paused, committed a concurrent write:
INSERT INTO ice_t VALUES (2);Resumed the debugger. With the fix, session A’s rename failed (concurrent modification),
SELECT * FROM ice_tstill returned both rows, and a secondALTER TABLE ice_t RENAME TO ice_t2completed successfully with both rows visible onice_t2.