-
Notifications
You must be signed in to change notification settings - Fork 994
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
PHOENIX-6082 : Avoid checkAndPut when altering properties for a table or view with column-encoding enabled #982
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Test failure with |
@ChinmaySKulkarni @yanxinyi could you please take a look? |
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.
@virajjasani thanks for the patch! I have a few nit-type comments on your tests, otherwise lgtm. Can you please confirm this patch locally by scanning SYSTEM.MUTEX via HBase shell?
ResultSet resultSet = conn.createStatement().executeQuery( | ||
"SELECT * FROM " + PhoenixDatabaseMetaData.SYSTEM_MUTEX_NAME); | ||
if (resultSet.next()) { | ||
isSysMutexEmpty.getAndSet(false); |
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 can be a simple set()
since you're not using the returned value right?
while (!Thread.interrupted() && !conn.isClosed()) { | ||
try { | ||
ResultSet resultSet = conn.createStatement().executeQuery( | ||
"SELECT * FROM " + PhoenixDatabaseMetaData.SYSTEM_MUTEX_NAME); |
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 we do end up going this route then, just to be safe, can we query the exact expected row in SYSTEM.MUTEX instead of this query? If this gets run in parallel with any of the upgrade tests (where we acquire an upgrade mutex), your test will fail.
… or view with column-encoding enabled
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.
Thanks @ChinmaySKulkarni for the review.
💔 -1 overall
This message was automatically generated. |
Sure, confirmed by scanning SYSTEM.MUTEX on local cluster with and without this patch. Initially, updated SYSTEM.MUTEX with KEEP_DELETED_CELLS => 'TRUE' because while executing ALTER TABLE query, Mutex cell is going to be deleted soon (finally block), hence it appears only momentarily. With patch, no records were found while scanning SYSTEM.MUTEX: Without patch, executed ALTER TABLE query twice and found two deleted rows (first scan result after first execution of ALTER query, and second scan result after second execution of ALTER query) : ALTER TABLE query used for testing: |
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.
+1 can you please put up a pr against 4.x too?
-- edit: nevermind, just saw #983
Anyone else want to take a look @yanxinyi @gjacoby126 @jpisaac ?
Thanks for the reviews @ChinmaySKulkarni @yanxinyi |
No description provided.