You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2021/05/23 22:25:49 UTC

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Hello Grant Henke,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/17493

to review the following change.


Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................

KUDU-3277 fix concurrent session flush issue in Java client

This patch fixes the issue reported by KUDU-3277.  The bug manifested
itself in rare cases when a session running in the AUTO_FLUSH_BACKGROUND
mode was either being flushed explicitly or implicitly (i.e. upon
closing the session) while the AUTO_FLUSH_BACKGROUND session's logic was
flushing its data buffers concurrently as well.

This patch also adds a reproduction scenario for KUDU-3277.  The newly
introduced test scenario was reliably failing before the fix:

  * 'java.lang.AssertionError: This Deferred was already called'
    messages were encountered in the log multiple times with the stack
    exactly as described in KUDU-3277

  * some flusher threads were unable to join since KuduSession.flush()
    would hang (i.e. would not return)

Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Reviewed-on: http://gerrit.cloudera.org:8080/17486
Tested-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Grant Henke <gr...@apache.org>
(cherry picked from commit d1969e2623e30bfd62f2463f15e0bf02422d1d84)
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
2 files changed, 170 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/93/17493/1
-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17493 )

Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................


Patch Set 1: Verified+1

unrelated failures due to unsynchronized clock

unavailable: Cannot initialize clock: timed out waiting for clock synchronisation: wallclock is not synchronized: no valid NTP responses yet


1) testMultipleFailover(org.apache.kudu.client.TestMultipleLeaderFailover)      
java.io.IOException: /tmp/dist-test-taskz9e6yq/build/asan/bin/kudu: process exited with non-zero status 1

2) testBoolPredicates(org.apache.kudu.client.TestScanPredicate)                 
java.io.IOException: failed to start masters: Unable to start Master at index 0: /tmp/dist-test-taskgN9e2e/build/debug/bin/kudu: process exited with non-zero status 1

3) testAlterChangeOwner(org.apache.kudu.client.TestAlterTable)                  
java.io.IOException: failed to start masters: Unable to start Master at index 0: /tmp/dist-test-task7kvTlJ/build/debug/bin/kudu: process exited with non-zero status 1

4) RaftConsensusITest.TestSlowFollower

5) ShouldGCWals/ParticipantCopyITest.TestCopyParticipantOps/1
F0523 23:35:48.952225  6112 test_workload.cc:298] Already present: key already presentF0523 23:35:48.952286  6111 test_workload.cc:298] Already present: key already presentF0523 23:35:48.977990  6110 test_workload.cc:298] Already present: key already present


-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: comment
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 24 May 2021 00:03:03 +0000
Gerrit-HasComments: No

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Posted by "Bankim Bhavsar (Code Review)" <ge...@cloudera.org>.
Bankim Bhavsar has posted comments on this change. ( http://gerrit.cloudera.org:8080/17493 )

Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................


Patch Set 1: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: comment
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 24 May 2021 13:55:51 +0000
Gerrit-HasComments: No

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17493 )

Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................

KUDU-3277 fix concurrent session flush issue in Java client

This patch fixes the issue reported by KUDU-3277.  The bug manifested
itself in rare cases when a session running in the AUTO_FLUSH_BACKGROUND
mode was either being flushed explicitly or implicitly (i.e. upon
closing the session) while the AUTO_FLUSH_BACKGROUND session's logic was
flushing its data buffers concurrently as well.

This patch also adds a reproduction scenario for KUDU-3277.  The newly
introduced test scenario was reliably failing before the fix:

  * 'java.lang.AssertionError: This Deferred was already called'
    messages were encountered in the log multiple times with the stack
    exactly as described in KUDU-3277

  * some flusher threads were unable to join since KuduSession.flush()
    would hang (i.e. would not return)

Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Reviewed-on: http://gerrit.cloudera.org:8080/17486
Tested-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Grant Henke <gr...@apache.org>
(cherry picked from commit d1969e2623e30bfd62f2463f15e0bf02422d1d84)
Reviewed-on: http://gerrit.cloudera.org:8080/17493
Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
---
M java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduSession.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
2 files changed, 170 insertions(+), 8 deletions(-)

Approvals:
  Grant Henke: Looks good to me, approved
  Alexey Serbin: Verified
  Bankim Bhavsar: Looks good to me, approved

-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: merged
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/17493 )

Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................


Patch Set 1: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: comment
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 23 May 2021 23:34:07 +0000
Gerrit-HasComments: No

[kudu-CR](branch-1.15.x) KUDU-3277 fix concurrent session flush issue in Java client

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.

Change subject: KUDU-3277 fix concurrent session flush issue in Java client
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/17493
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.15.x
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: If6aaccc06abf1a2673620ab7c649f51f91999ad9
Gerrit-Change-Number: 17493
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Bankim Bhavsar <ba...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)