Skip to content

Conversation

@kabhishek4
Copy link
Contributor

…a new active cluster

This change

  • Add a logic where active cluster id file is re-created with the newly set active cluster id suffix.
  • active cluster id file is created when the read only mode is set to false

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 49s 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.
_ HBASE-29081 Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 4m 15s HBASE-29081 passed
+1 💚 compile 5m 21s HBASE-29081 passed
-0 ⚠️ checkstyle 0m 20s /buildtool-branch-checkstyle-hbase-server.txt The patch fails to run checkstyle in hbase-server
+1 💚 spotbugs 2m 37s HBASE-29081 passed
+1 💚 spotless 1m 0s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 4m 6s the patch passed
+1 💚 compile 5m 12s the patch passed
+1 💚 javac 5m 12s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 22s /buildtool-patch-checkstyle-hbase-server.txt The patch fails to run checkstyle in hbase-server
+1 💚 spotbugs 3m 2s the patch passed
+1 💚 hadoopcheck 14m 51s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 56s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 19s The patch does not generate ASF License warnings.
54m 4s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7437/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7437
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux e4d6d6c9a7cf 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 HBASE-29081 / 0075496
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7437/2/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.

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

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

I don't really understand the reasoning behind all this complicated logic. To my understanding the task is pretty simple:

Monitor the transition of read-only property and do the following:

  • if it transitions from R/W -> R/O, delete the file,
  • if R/O -> R/W, create the file.

If the above operation fails, log it and try to notify the user somehow.
That's basically it. No backoff logic, no retry logic is needed for now. User will fix the problem and restarts if needed.


// Not timed out, log and sleep before retrying
LOG.warn(
"Failed to recreate active cluster ID file: {}. Retrying in {}ms... "
Copy link
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 you need to retry to create the file. Try it only once and log error if it failed. There's no such thing that a filesystem is unavailable for some reason, but will become available at some point and we wait for it. It should be available at all times or something is wrong.

* specified permissions and overwrite flag.
* @param fs The FileSystem
* @param path The file path to recreate
* @param recursive If true, delete recursively (for a directory)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is about a single file. 'Recursive' doesn't make sense to me here.

* @param path The file path to recreate
* @param recursive If true, delete recursively (for a directory)
* @param perm The FsPermission to apply to the new file
* @param overwrite If true, overwrite an existing file (though it should be deleted by this
Copy link
Contributor

Choose a reason for hiding this comment

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

You're trying to recreate a file. This should be always true.

FsPermission perm, boolean overwrite) throws IOException {
LOG.debug("Attempting to delete path {} (recursive={}) for recreation.", path, recursive);
try {
if (!fs.delete(path, recursive) && fs.exists(path)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

fs.exists() is redundant. fs.delete() should give your a clear result about whether the delete operation was successful or not.

throw new IOException("Failed to delete " + path + " for recreation. "
+ "delete() returned false and path still exists.");
}
} catch (IOException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need this all complicated logic? Delete either failed or successful, right?

overwrite);

// Create the new file with the specified permissions
return create(fs, path, perm, overwrite);
Copy link
Contributor

Choose a reason for hiding this comment

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

You should not recreate the file when read-only mode is turned on. In that case you only need to delete the file and let the active cluster a new. How do cover that scenario?

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 13s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ HBASE-29081 Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for branch
+1 💚 mvninstall 4m 52s HBASE-29081 passed
+1 💚 compile 1m 39s HBASE-29081 passed
+1 💚 javadoc 0m 57s HBASE-29081 passed
+1 💚 shadedjars 7m 13s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 4m 24s the patch passed
+1 💚 compile 1m 38s the patch passed
+1 💚 javac 1m 38s the patch passed
+1 💚 javadoc 0m 53s the patch passed
+1 💚 shadedjars 7m 3s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 3m 36s hbase-common in the patch passed.
-1 ❌ unit 558m 5s /patch-unit-hbase-server.txt hbase-server in the patch failed.
596m 8s
Subsystem Report/Notes
Docker ClientAPI=1.48 ServerAPI=1.48 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7437/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7437
Optional Tests javac javadoc unit compile shadedjars
uname Linux f46f798effcd 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision HBASE-29081 / 0075496
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7437/2/testReport/
Max. process+thread count 2998 (vs. ulimit of 30000)
modules C: hbase-common hbase-server U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7437/2/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.

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.

3 participants