Skip to content

HBASE-22380 break circle replication when doing bulkload - #566

Merged
wchevreuil merged 4 commits into
apache:masterfrom
wchevreuil:HBASE-22380-master
Sep 21, 2019
Merged

HBASE-22380 break circle replication when doing bulkload#566
wchevreuil merged 4 commits into
apache:masterfrom
wchevreuil:HBASE-22380-master

Conversation

@wchevreuil

Copy link
Copy Markdown
Contributor

PR for master branch

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec40Docker mode activated.
_ Prechecks _
+1dupname1No case conflicting files found.
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 2 new or modified test files.
_ master Compile Tests _
0mvndep34Maven dependency ordering for branch
+1mvninstall332master passed
+1compile124master passed
+1checkstyle154master passed
+1shadedjars314branch has no errors when building our shaded downstream artifacts.
+1javadoc81master passed
0spotbugs271Used deprecated FindBugs config; considering switching to SpotBugs.
+1findbugs520master passed
_ Patch Compile Tests _
0mvndep19Maven dependency ordering for patch
+1mvninstall382the patch passed
+1compile118the patch passed
+1cc118the patch passed
+1javac118the patch passed
-1checkstyle82hbase-server: The patch generated 1 new + 283 unchanged - 0 fixed = 284 total (was 283)
+1whitespace1The patch has no whitespace issues.
+1shadedjars289patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck1000Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1hbaseprotoc242the patch passed
-1javadoc103hbase-server generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
-1findbugs537hbase-server generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
_ Other Tests _
+1unit65hbase-protocol-shaded in the patch passed.
+1unit181hbase-client in the patch passed.
-1unit10539hbase-server in the patch failed.
+1asflicense86The patch does not generate ASF License warnings.
16575
ReasonTests
FindBugsmodule:hbase-server
org.apache.hadoop.hbase.replication.regionserver.ReplicationSink.replicateEntries(List, CellScanner, String, String, String) makes inefficient use of keySet iterator instead of entrySet iterator At ReplicationSink.java:makes inefficient use of keySet iterator instead of entrySet iterator At ReplicationSink.java:[line 258]
Failed junit testshadoop.hbase.tool.TestBulkLoadHFilesSplitRecovery
hadoop.hbase.tool.TestSecureBulkLoadHFilesSplitRecovery
hadoop.hbase.regionserver.TestHRegionWithInMemoryFlush
SubsystemReport/Notes
DockerClient=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/artifact/out/Dockerfile
GITHUB PR#566
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc
unameLinux feb8ff49f0f1 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-566/out/precommit/personality/provided.sh
git revisionmaster / 8e8bd8b
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/artifact/out/diff-checkstyle-hbase-server.txt
javadochttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/artifact/out/diff-javadoc-javadoc-hbase-server.txt
findbugshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/artifact/out/new-findbugs-hbase-server.html
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/testReport/
Max. process+thread count4500 (vs. ulimit of 10000)
modulesC: hbase-protocol-shaded hbase-client hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/7/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@busbey

Copy link
Copy Markdown
Contributor

how is the implementation here different than on #494?

@wchevreuil

Copy link
Copy Markdown
ContributorAuthor

Concept is the same, but there were major changes between branch-2 and master code bases that required some re-work to come with a PR to master. For example, there's no LoadIncrementalHFiles, the most equivalent class is BulkLoadHFilesTool. Same for SecureBulkLoadClient, which was removed on master branch, being replaced by AsyncClusterConnection/AsyncClusterConnectionImpl methods.

@joshelserjoshelser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally looks OK to me. A couple of comments/questions/requests, but none of them serious.

I think the only thing that worries me is that the test doesn't seem to be doing a replication "ring" of 3 clusters. I thought that was the intent reading HBASE-22380, but maybe I missed something over there.

//We have 3 bulk load events (1 initiated on each cluster).
//Each event gets 3 counts (the originator cluster, plus the two peers),
//so BULK_LOADS_COUNT expected value is 3 * 3 = 9.
assertEquals(9, BULK_LOADS_COUNT.get());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm thinking about debugging this if/when it breaks. Is there any way that we could expand your Observer to know which Clusters got their bulk loaded files and how many? e.g. a Map of ClusterID to counts of files bulkloaded (or even a list of the file names that were bulkloaded)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Do you mean to add extra validation per file bullkloaded on this test? Or are you talking about a general bulk load observer to be implemented on a separate jira?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not so much validation, but just proactive-debugging.

For example, if the test fails was it because the hfiles never made it from A to B or B to C?

I think some counters in a bulk loader observer would be a nice way to just proactively log "I saw 3 bulk loads for clusterA, 3 for clusterB, and 0 for cluster" which would make debugging much easier. If it's not that straightforward to capture/log, don't worry about it :)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

That's a good idea actually. Pushed a change that adds a counter to this CP and prints a debug message on each completed bulkload, for each cluster.

value = Bytes.toBytes("v3");
assertBulkLoadConditions(row, value, UTIL3, peer1TestTable, peer2TestTable, peer3TestTable);
//Additional wait to make sure no extra bulk load happens
Thread.sleep(400);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any way we could know when HBase is done replicating? Could we figure this out from the replication queue?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Problem is that we want to make sure no "extra" replication will occur. Checking replication queue would require extra code to read/monitor it from ZK, I guess, and we still would need to do some wait, then certify no new items were enqueued.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to confirm, we don't have any Observer hook for when a bulkload-via-replication request comes in? so we can't just have a latch that ensure each server sees the correct number of events?

@wchevreuilwchevreuilSep 12, 2019

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Just to confirm, we don't have any Observer hook for when a bulkload-via-replication request comes in?

No, just general bulkload events, via preBulkLoadHFile/postBulkLoadHFile.

so we can't just have a latch that ensure each server sees the correct number of events?

We are already using a latch for the expected amount of bulk load events. This wait here is for the case where we have infinite loops. Simply relying on countdown latch would not suffice, we would pass the test even if we are in a loop situation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure you could. Just make a latch that once we pass the expected number it starts throwing exceptions or calls Assert.fail

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

We would still need to wait a bit over once we reached the expected number, right? Otherwise, we may pass the test before an additional, unwanted bulkload event happens to be accounted in the latch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah. yeah unless we can check the replication status to show that we're up to date.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ick, yeah, that's hard to capture. I like the idea of proactively failing when we get more bulk loads than we expect (we can probably rule out retriable bulk load errors in a contrived unit test like this). Don't consider this to be some blocking request for change -- just an open question :)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

(we can probably rule out retriable bulk load errors in a contrived unit test like this).

Moved the BULK_LOADS_COUNT increment to postBulkLoadHFile Observer method. That way, we would only be counting succeeded bulkloads, ignoring failed ones, so if it's a retry, the failed attempt didn't get count.

But the problem of how to check something that shouldn't happen anytime in the future without the wait/sleep seems unsolvable to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hehe, yeah. The only thing I could think of would be instrumenting the code that "skips" replicating to a cluster which already got it, but that's pretty down in the weeds, I'd say.

I think you're good :)

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 0sDocker mode activated.
💔patch0m 6s#566 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#566
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/8/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@wchevreuil

Copy link
Copy Markdown
ContributorAuthor

Ok, so would it be ok as it is now?

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 0sDocker mode activated.
💔patch0m 5s#566 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#566
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/9/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

…kloads happened for each cluster, in order to help with debugging on eventual test failures
@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 0sDocker mode activated.
💔patch0m 5s#566 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#566
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-566/10/console
versionsgit=2.17.1
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@wchevreuil
wchevreuil merged commit 3ae353c into apache:masterSep 21, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wchevreuil@Apache-HBase@busbey@joshelser