Skip to content

Conversation

@gvprathyusha6
Copy link
Contributor

@gvprathyusha6 gvprathyusha6 commented Oct 22, 2025

The test added currently fails on master branch and empty regionDir/regioninfo file are still created, with the fix it is throwing an excepted exception .

@gvprathyusha6 gvprathyusha6 marked this pull request as draft October 22, 2025 14:56
@gvprathyusha6 gvprathyusha6 marked this pull request as ready for review October 25, 2025 03:48
FsPermission perms = CommonFSUtils.getFilePermissions(fs, conf, HConstants.DATA_FILE_UMASK_KEY);
// Write the RegionInfo file content
try (FSDataOutputStream out = FSUtils.create(conf, fs, regionInfoFile, perms, null)) {
try (FSDataOutputStream out = FSUtils.create(conf, fs, regionInfoFile, perms, null, false)) {
Copy link
Contributor

@apurtell apurtell Oct 27, 2025

Choose a reason for hiding this comment

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

Add a comment here why this change, providing the JIRA identifier. The reason not to recursively create directories is important, we don't want someone refactoring this code later to miss that.

@virajjasani
Copy link
Contributor

I know it's difficult but any possibility of creating some tests around this?

@ujjawal4046
Copy link
Contributor

ujjawal4046 commented Oct 29, 2025

I know it's difficult but any possibility of creating some tests around this?

+1, as discussed offline this can actually be tested with same scenario @gvprathyusha6

  1. Restore the snapshot into a temp directory
  2. Delete the snapshot from the temp directory (other option would be to call the MR job with non-existing restore directory)
  3. Create MR job for snapshot (ref IntegrationTestTableSnapshotInputFormat class on this), it should fail

@gvprathyusha6
Copy link
Contributor Author

I know it's difficult but any possibility of creating some tests around this?

+1, as discussed offline this can actually be tested with same scenario @gvprathyusha6

  1. Restore the snapshot into a temp directory
  2. Delete the snapshot from the temp directory (other option would be to call the MR job with non-existing restore directory)
  3. Create MR job for snapshot (ref IntegrationTestTableSnapshotInputFormat class on this), it should fail

@ujjawal4046 why not just add the test for HRegion initialise to fail if there is no regionDir? that way all downstreams are covered?

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

@gvprathyusha6 gvprathyusha6 force-pushed the HBASE-29662 branch 5 times, most recently from 0579809 to c2cb21c Compare October 30, 2025 23:32
@gvprathyusha6 gvprathyusha6 marked this pull request as draft October 31, 2025 00:10
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@gvprathyusha6 gvprathyusha6 marked this pull request as ready for review November 1, 2025 07:02
@Apache-HBase

This comment has been minimized.

@apurtell
Copy link
Contributor

apurtell commented Nov 2, 2025

lgtm, I plan to apply this back to 2.5 tomorrow, unless objection.
Thanks @gvprathyusha6 for digging in to this issue.

Copy link
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

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

Left few minor comments, looks good overall

mfs.getFileSystem(), tableDir, regionInfo);
} catch (IOException e) {
LOG.warn("Failed to create region directory for {}: {}",
regionInfo.getRegionNameAsString(), e.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's print whole stacktrace here instead of error message?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, if we suppress the error here, how can fixHoles progress? I hope that's the only place using this utility?

Copy link
Contributor Author

@gvprathyusha6 gvprathyusha6 Nov 3, 2025

Choose a reason for hiding this comment

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

how can fixHoles progress

It shall continue to fix hole for other regions, right now also that part is taken care of by the procedure logic, as part of Assign it is creating the region directory, so if region directory creation fails, it would only effect that region and not rest of them, so I tried to keep it similar

I hope that's the only place using this utility?

yes and its private

throw new IOException("Region directory does not exist: " + getRegionDir());
}
if (!fs.exists(getTempDir())) {
fs.mkdirs(getTempDir());
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, this was not covered so far?

Copy link
Contributor Author

@gvprathyusha6 gvprathyusha6 Nov 3, 2025

Choose a reason for hiding this comment

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

this was created previously as part of recursion in FS while creating file, now that I removed it and now we dont just blindly create all the directories that are present in path, we would need to create tmp directory explicitly

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 40s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 20s Maven dependency ordering for branch
+1 💚 mvninstall 4m 34s master passed
+1 💚 compile 6m 1s master passed
+1 💚 checkstyle 2m 8s master passed
+1 💚 spotbugs 3m 44s master passed
+1 💚 spotless 1m 5s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 3m 56s the patch passed
+1 💚 compile 6m 11s the patch passed
+1 💚 javac 6m 11s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 59s the patch passed
+1 💚 spotbugs 4m 0s the patch passed
+1 💚 hadoopcheck 14m 22s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 1m 0s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
60m 42s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7406/8/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7406
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux d6ded2a3d85b 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 5bce7ca
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-mapreduce U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7406/8/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 19s Maven dependency ordering for branch
+1 💚 mvninstall 3m 45s master passed
+1 💚 compile 1m 57s master passed
+1 💚 javadoc 1m 12s master passed
+1 💚 shadedjars 7m 15s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 4m 4s the patch passed
+1 💚 compile 2m 2s the patch passed
+1 💚 javac 2m 2s the patch passed
+1 💚 javadoc 1m 11s the patch passed
+1 💚 shadedjars 6m 55s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 3m 0s hbase-common in the patch passed.
+1 💚 unit 242m 59s hbase-server in the patch passed.
+1 💚 unit 25m 31s hbase-mapreduce in the patch passed.
306m 50s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7406/8/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7406
Optional Tests javac javadoc unit compile shadedjars
uname Linux ad21094c44a3 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 5bce7ca
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7406/8/testReport/
Max. process+thread count 3746 (vs. ulimit of 30000)
modules C: hbase-common hbase-server hbase-mapreduce U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7406/8/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@apurtell apurtell merged commit bc54a7e into apache:master Nov 3, 2025
1 check passed
asf-gitbox-commits pushed a commit that referenced this pull request Nov 3, 2025
…o file creation in HRegion initialize (#7406)

Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>
asf-gitbox-commits pushed a commit that referenced this pull request Nov 3, 2025
…o file creation in HRegion initialize (#7406)

Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/master/janitor/MetaFixer.java
	hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
asf-gitbox-commits pushed a commit that referenced this pull request Nov 4, 2025
…o file creation in HRegion initialize (#7406)

Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/master/janitor/MetaFixer.java
	hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
asf-gitbox-commits pushed a commit that referenced this pull request Nov 4, 2025
…o file creation in HRegion initialize (#7406)

Signed-off-by: Andrew Purtell <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/master/janitor/MetaFixer.java
	hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/TruncateRegionProcedure.java
        hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Sign up for free to 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