Skip to content

HBASE-28988 Enhance WALPlayer for restore of BulkLoad - #6523

Closed
ankitsol wants to merge 2 commits into
apache:HBASE-28957from
ankitsol:as.HBASE-28988
Closed

HBASE-28988 Enhance WALPlayer for restore of BulkLoad#6523
ankitsol wants to merge 2 commits into
apache:HBASE-28957from
ankitsol:as.HBASE-28988

Conversation

@ankitsol

@ankitsolankitsol commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

Enhance WALPlayer for restore of BulkLoad WAL entries

https://issues.apache.org/jira/browse/HBASE-28988

@ankitsol

Copy link
Copy Markdown
ContributorAuthor

Need to update for newly suggested backup directory structure

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@vinayakphegde

Copy link
Copy Markdown
Contributor

@ankitsol You need to run mvn spotless:apply to fix code style issues.

@vinayakphegdevinayakphegde 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.

In general, I found the following issues:

  • All the new log lines are at the INFO level, which may not be necessary. Consider reducing them to DEBUG or TRACE in some cases.
  • Javadoc/comments have not been updated to reflect the latest changes.
  • There are code style issues that need to be fixed so we can run the unit tests and update them if necessary.
  • New unit tests need to be added.

*/
protected static class WALMapper
extends Mapper<WALKey, WALEdit, ImmutableBytesWritable, Mutation> {
extends Mapper<WALKey, WALEdit, ImmutableBytesWritable, Pair<Mutation, List<String>>> {

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.

Instead of Pair here, can we use a Custom Class? So that The exclusivity between Mutation and BulkLoadFiles is enforced programmatically.


// Retrieve configuration and set up file systems for backup and staging locations
Configuration conf = context.getConfiguration();
Path backupLocation = new Path(conf.get(BULKLOAD_BACKUP_LOCATION));

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.

check for if backupLocation is not specified.


try {
for (String file : bulkloadFilesWithFullPath) {
// Full file path from S3

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.

remove the hardcoded S3 here

List<String> stagingPaths = new ArrayList<>();

try {
for (String file : bulkloadFilesWithFullPath) {

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.

these are not full paths, but the relative paths from namespace

for (ExtendedCell cell : WALEditInternalHelper.getExtendedCells(value)) {
context.getCounter(Counter.CELLS_READ).increment(1);

if (CellUtil.matchingQualifier(cell, WALEdit.BULK_LOAD)) {

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 believe the processing of bulkloaded files can be simplified, and we could reduce the log level from INFO to DEBUG or TRACE in some cases.

setupTime(conf, WALInputFormat.START_TIME_KEY);
setupTime(conf, WALInputFormat.END_TIME_KEY);
String inputDirs = args[0];
String walDir = new Path(inputDirs, "WALs").toString();

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 think this is correct. We are hard-coding the directories here.
We could introduce a new optional parameter that the user can specify if they have bulkloaded files for us to process.
For example:
hbase org.apache.hadoop.hbase.mapreduce.WALPlayer /backuplogdir oldTable1,oldTable2 newTable1,newTable2 -Dwal.bulk.backup.location=/bulkload-files-dir

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 40sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ HBASE-28957 Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for branch
+1 💚mvninstall2m 46sHBASE-28957 passed
+1 💚compile1m 6sHBASE-28957 passed
+1 💚checkstyle0m 23sHBASE-28957 passed
+1 💚spotbugs0m 59sHBASE-28957 passed
+1 💚spotless1m 7sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall3m 0sthe patch passed
+1 💚compile1m 4sthe patch passed
-0 ⚠️javac0m 33s/results-compile-javac-hbase-mapreduce.txthbase-mapreduce generated 1 new + 197 unchanged - 1 fixed = 198 total (was 198)
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 24sthe patch passed
+1 💚spotbugs1m 6sthe patch passed
+1 💚hadoopcheck9m 55sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 39spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 20sThe patch does not generate ASF License warnings.
30m 9s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6523/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6523
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 68382c610f0a 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionHBASE-28957 / 12fdd6d
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count83 (vs. ulimit of 30000)
modulesC: hbase-mapreduce hbase-it U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6523/2/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 36sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ HBASE-28957 Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 34sHBASE-28957 passed
+1 💚compile0m 49sHBASE-28957 passed
+1 💚javadoc0m 31sHBASE-28957 passed
+1 💚shadedjars7m 27sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for patch
+1 💚mvninstall4m 7sthe patch passed
+1 💚compile0m 42sthe patch passed
+1 💚javac0m 42sthe patch passed
+1 💚javadoc0m 25sthe patch passed
+1 💚shadedjars5m 37spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit27m 20s/patch-unit-hbase-mapreduce.txthbase-mapreduce in the patch failed.
+1 💚unit0m 39shbase-it in the patch passed.
53m 33s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6523/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6523
Optional Testsjavac javadoc unit compile shadedjars
unameLinux b92f4b8e2b6c 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionHBASE-28957 / 12fdd6d
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6523/2/testReport/
Max. process+thread count3286 (vs. ulimit of 30000)
modulesC: hbase-mapreduce hbase-it U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6523/2/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@anmolnar

anmolnar commented Dec 19, 2024

Copy link
Copy Markdown
Contributor

As discussed internally we need to add this enhancement outside of the WALPlayer class. Perhaps we could try to extend WALPlayer and the mapper to create a new MR job with the two functionalities mixed together.

One thing I don't understand reading this patch: how the original code skipped BulkLoad edits and how the new code enabled them?

@anmolnar

Copy link
Copy Markdown
Contributor

Not needed anymore.

@anmolnaranmolnar closed this Jul 9, 2026
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.

5 participants

@ankitsol@Apache-HBase@vinayakphegde@anmolnar@asolomonC