-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
HIVE-26023: Non blocking REPLACE, RENAME COLUMNS implementation #3089
Conversation
driver.getFetchTask().fetch(res); | ||
swapTxnManager(txnMgr2); | ||
|
||
FieldSetter.setField(txnMgr2, txnMgr2.getClass().getDeclaredField("numStatements"), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this set needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
txnMgr.acquireLocks increments the number of statements and that prevents us from calling it again - so doing a hard reset here.
checkLock(blocking ? LockType.EXCLUSIVE : LockType.EXCL_WRITE, | ||
LockState.ACQUIRED, "default", "tab_acid", null, locks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be changed to sth like
checkLock(blocking ? LockType.EXCLUSIVE : LockType.EXCL_WRITE, blocking ? LockState.WAITING : LockState.ACQUIRED, "default", "tab_acid", null, locks);
In this case the code block inside if (blocking)
would not be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case of blocking flow, 1st step was to check if we'll be blocked/waiting on prev txn, then commit blocking txn and proceed with the current one. At that step, we should have a lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, +1
…iewed by Antal Sinkovits, Laszlo Vegh) Closes apache#3089
…iewed by Antal Sinkovits, Laszlo Vegh) Closes apache#3089
What changes were proposed in this pull request?
Why are the changes needed?
Modify the REPLACE/RENAME COLUMNS operation to not acquire EXCLUSIVE lock limiting the system concurrency.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit tests