Skip to content

HBASE-23205 Correctly update the position of WALs currently being replicated - #980

Merged
wchevreuil merged 1 commit into
apache:branch-1.4from
JeongDaeKim:HBASE-23205-branch-1.4
Jan 9, 2020
Merged

HBASE-23205 Correctly update the position of WALs currently being replicated#980
wchevreuil merged 1 commit into
apache:branch-1.4from
JeongDaeKim:HBASE-23205-branch-1.4

Conversation

@JeongDaeKim

Copy link
Copy Markdown

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 41sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ branch-1.4 Compile Tests _
+1 💚mvninstall8m 7sbranch-1.4 passed
+1 💚compile0m 39sbranch-1.4 passed with JDK v1.8.0_232
+1 💚compile0m 45sbranch-1.4 passed with JDK v1.7.0_242
+1 💚checkstyle1m 35sbranch-1.4 passed
+1 💚shadedjars2m 47sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 38sbranch-1.4 passed with JDK v1.8.0_232
+1 💚javadoc0m 40sbranch-1.4 passed with JDK v1.7.0_242
+0 🆗spotbugs2m 49sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs2m 47sbranch-1.4 passed
_ Patch Compile Tests _
+1 💚mvninstall1m 56sthe patch passed
+1 💚compile0m 39sthe patch passed with JDK v1.8.0_232
+1 💚javac0m 39sthe patch passed
+1 💚compile0m 47sthe patch passed with JDK v1.7.0_242
+1 💚javac0m 47sthe patch passed
-1 ❌checkstyle1m 34shbase-server: The patch generated 1 new + 25 unchanged - 10 fixed = 26 total (was 35)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚shadedjars2m 39spatch has no errors when building our shaded downstream artifacts.
+1 💚hadoopcheck2m 30sPatch does not cause any errors with Hadoop 2.7.7.
+1 💚javadoc0m 30sthe patch passed with JDK v1.8.0_232
+1 💚javadoc0m 40sthe patch passed with JDK v1.7.0_242
+1 💚findbugs2m 51sthe patch passed
_ Other Tests _
+1 💚unit118m 36shbase-server in the patch passed.
+1 💚asflicense0m 34sThe patch does not generate ASF License warnings.
155m 34s
SubsystemReport/Notes
DockerClient=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-980/1/artifact/out/Dockerfile
GITHUB PR#980
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 7a7589a46ec7 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-980/out/precommit/personality/provided.sh
git revisionbranch-1.4 / aaa2266
Default Java1.7.0_242
Multi-JDK versions/usr/lib/jvm/zulu-8-amd64:1.8.0_232 /usr/lib/jvm/zulu-7-amd64:1.7.0_242
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-980/1/artifact/out/diff-checkstyle-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-980/1/testReport/
Max. process+thread count4346 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-980/1/console
versionsgit=1.9.1 maven=3.0.5 findbugs=3.0.1
Powered byApache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@saintstacksaintstack left a comment

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.

Looking good. Need to come back to this. Substantial change.

@VisibleForTesting
public Path getLastLoggedPath() {
for (ReplicationSourceShipperThread worker : workerThreads.values()) {
return worker.getLastLoggedPath();

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.

Are the workerThreads sorted so we get last logged first?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not sorted, It's only for testing in non-multi wal environment, as same as ReplicationSource.getCurrentPath().

@wchevreuilwchevreuil left a comment

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.

Looks in line with the changes of PR #944 (merged into branch-1). So LGTM, but let's wait for @saintstack review.

@saintstacksaintstack left a comment

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.

I don't know this code well but what is here looks good to me. A few questions in the below.

long position = worker.getCurrentPosition();
Path currentPath = worker.getCurrentPath();
long position = worker.getLastLoggedPosition();
Path currentPath = worker.getLastLoggedPath();

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.

This is not for test, right? We iterate the workers twice -- once to get path and then again to get position. Don't want to return a Pair with Path and offset so just iterate once?

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.

Hmm... reading later in the patch, I see need to have them distinct. For sure we'll get the right offset for the selected path?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, not for test and not the same one. each thread have it's own path and position. no need to iterate

// set "ageOfLastShippedOp" to <now> to indicate that we're current
metrics.setAgeOfLastShippedOp(EnvironmentEdgeManager.currentTime(), walGroupId);
}
updateLogPosition(lastReadPosition);

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.

Will we be doing a bunch of spinning updating same value over and over w/o these checks in place that look to see if position has changed? Will we be burning CPU to no end?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It won't be updated with the same value repeatably. entryReader will put a batch only when read position is changed.

}

private void updateLogPosition(long lastReadPosition) {
manager.setPendingShipment(false);

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.

Its ok to remove this setting?

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.

We don't do pending flag anymore?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, we don't need the flag anymore. it was required because not only shipper but also reader thread can update log position, but it had some issues about concurrency and high update frequency. With this PR, when wal rolled or log position changed, reader will put a batch for shipper to update log position.

@JeongDaeKim

Copy link
Copy Markdown
Author

Thanks all for approvals! Could you merge this, if no more comments or questions?

@wchevreuil
wchevreuil merged commit 879b7ea into apache:branch-1.4Jan 9, 2020
@wchevreuil

Copy link
Copy Markdown
Contributor

Thanks again for all the work here, @JeongDaeKim !

@JeongDaeKim
JeongDaeKim deleted the HBASE-23205-branch-1.4 branch January 13, 2020 01:29
udaynpusa pushed a commit to mapr/hbase that referenced this pull request Jan 30, 2024
…licated (apache#980)
Signed-off-by: stack <stack@apache.org>
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
(cherry picked from commit 879b7ea)
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

@JeongDaeKim@Apache-HBase@wchevreuil@saintstack