-
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-6871 Fix write threads deadlock #1559
Conversation
@tkhurana FYI |
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.
One minor comment.
@@ -502,9 +503,10 @@ private void populateRowsToLock(MiniBatchOperationInProgress<Mutation> miniBatch | |||
Mutation m = miniBatchOp.getOperation(i); | |||
if (this.builder.isAtomicOp(m) || this.builder.isEnabled(m)) { | |||
ImmutableBytesPtr row = new ImmutableBytesPtr(m.getRow()); | |||
if (!context.rowsToLock.contains(row)) { | |||
// This seems to be unnecessary as we are using a set here | |||
// if (!context.rowsToLock.contains(row)) { |
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 for improving this - can you remove this commented code, as don't think this needs to be checked in.
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 @mnpoonia . Looks good. Please remove the comments as suggested by @gourabtaparia
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.
Done
Test failure FailoverPhoenixConnectionIT.testConnectionWhenActiveZKRestarts It is unrelated. |
@@ -227,7 +228,7 @@ public static class BatchMutateContext { | |||
// The collection of candidate index mutations that will be applied after the data table mutations | |||
private ListMultimap<HTableInterfaceReference, Pair<Mutation, byte[]>> indexUpdates; | |||
private List<RowLock> rowLocks = Lists.newArrayListWithExpectedSize(QueryServicesOptions.DEFAULT_MUTATE_BATCH_SIZE); | |||
private HashSet<ImmutableBytesPtr> rowsToLock = new HashSet<>(); | |||
private TreeSet<ImmutableBytesPtr> rowsToLock = new TreeSet<>(); |
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.
nit: private Set<ImmutableBytesPtr> rowsToLock = new TreeSet<>()
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.
Done
a33b435
to
a15d733
Compare
a15d733
to
895d08d
Compare
@gourabtaparia @tkhurana @virajjasani Please review and merge if changes look good |
phoenix-core/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java
Show resolved
Hide resolved
d1cbdd0
to
e43d8da
Compare
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, thanks @mnpoonia
Belated +1, thank you @mnpoonia! |
@tkhurana @virajjasani Can you cherrypick to 5.1 branch as well. |
* PHOENIX-6871 Fix write threads deadlock * Add comment about Treeset importance
Done @mnpoonia |
No description provided.