Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locking of non-partitioned transactional tables #9070

Merged
merged 1 commit into from Sep 6, 2021

Conversation

losipiuk
Copy link
Member

@losipiuk losipiuk commented Sep 1, 2021

Without the fix we were using partition locking API in HMS even for
non-partitioned tables. It happened if during execution we successfully
completed predicate pushdown flow. Then in HiveTableHandle we had
non-empty partitions list. It contained a single element with synthetic
HivePartition object using UNPARTITIONED_ID id. It is used to pass
information about bucket filtering.

With the fix we are detecting such case in getValidWriteIds and locking
whole table instead.

@cla-bot cla-bot bot added the cla-signed label Sep 1, 2021
@losipiuk
Copy link
Member Author

losipiuk commented Sep 1, 2021

Tested manually but no idea how to write automated test for that.

@losipiuk
Copy link
Member Author

losipiuk commented Sep 2, 2021

AC @findepi

Comment on lines 72 to 73
if (partitioned) {
if (tableHandle.getPartitions().isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fuse the IFs seince else branches are the same.

(Then it's IMO natural to make the lockedTables,lockedPartitions variables effectively final)

@losipiuk
Copy link
Member Author

losipiuk commented Sep 6, 2021

AC @findepi

Without the fix we were using partition locking API in HMS even for
non-partitioned tables. It happened if during execution we successfully
completed predicate pushdown flow. Then in HiveTableHandle we had
non-empty partitions list. It contained a single element with synthetic
HivePartition object using UNPARTITIONED_ID id. It is used to pass
information about bucket filtering.

With the fix we are detecting such case in getValidWriteIds and locking
whole table instead.
@losipiuk losipiuk merged commit 8216444 into trinodb:master Sep 6, 2021
@findepi findepi added this to the 362 milestone Sep 8, 2021
@losipiuk losipiuk mentioned this pull request Sep 15, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants