Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-09 Thread via GitHub


anmolnar commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2957077109

   Hm, interesting. Let me check the design doc once again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-06 Thread via GitHub


kgeisz commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2950830915

   > What do you mean by "active cluster startup attempted"?
   
   I got it from the design document:
   
   > When the ‘active_cluster_id’ file is created on cloud storage with cluster 
id of active cluster, startup will not be allowed and error will be reported in 
below scenarios,
   > - active cluster startup attempted after setting 
hbase.global.readonly.enabled to true
   > - replica cluster startup attempted after setting 
hbase.global.readonly.enabled to false
   
   My understanding is "active cluster startup attempted" means the cluster 
whose ID and suffix is in the `active_cluster_id` file is the cluster that's 
being started.
   
   > If readonly mode is true, it means user attempts to start a replica 
cluster which will succeed always, because in this case we don't check the 
active cluster id file.
   
   That makes sense, although it doesn't align with what the design doc says.  
I was expecting this scenario to result in an exception.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-05 Thread via GitHub


anmolnar commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2945937918

   > active cluster startup attempted after setting 
hbase.global.readonly.enabled to true
   
   What do you mean by "active cluster startup attempted"?
   If readonly mode is true, it means user attempts to start a replica cluster 
which will succeed always, because in this case we don't check the active 
cluster id file.
   
   Similarly
   
   > replica cluster startup attempted after setting 
hbase.global.readonly.enabled to false
   
   This is going to be an active cluster startup attempt which will succeed 
only if:
   - active cluster id file is missing
   - active cluster id file contents matches our suffix.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-04 Thread via GitHub


kgeisz commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2941732509

   > > Should we have a unit test case for switching the active cluster?
   > > cc. @anmolnar
   > 
   > Could you please elaborate on that? Tests in this patch cover the 
different startup scenarios for HBase and validates it behaves as expected. 
Switching the active cluster sounds to me a multi-step operation which is 
beyond the scope here, but correct me if I'm wrong.
   
   Yes, I was talking about more complex scenarios mentioned in the design doc. 
 In this case, I was talking about verifying a failure occurs when the scenario 
in the [ticket description](https://issues.apache.org/jira/browse/HBASE-29228) 
happens.  I'm also wondering if we should make unit tests that verify failures 
for these scenarios mentioned in the doc:
   
   1. active cluster startup attempted after setting 
hbase.global.readonly.enabled to true
   2. replica cluster startup attempted after setting 
hbase.global.readonly.enabled to false
   
   I agree with you though.  This patch is a small change that prevents 
multiple running clusters, and the unit tests verify that behavior is correct, 
so the tests I'm thinking of are beyond the scope of this patch. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-04 Thread via GitHub


anmolnar commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2941520556

   > Should we have a unit test case for switching the active cluster?
   > 
   > cc. @anmolnar
   
   Could you please elaborate on that?
   Tests in this patch cover the different startup scenarios for HBase and 
validates it behaves as expected. Switching the active cluster sounds to me a 
multi-step operation which is beyond the scope here, but correct me if I'm 
wrong.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-03 Thread via GitHub


kgeisz commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2937724216

   Should we have a unit test case for switching the active cluster?
   
   cc. @anmolnar 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-03 Thread via GitHub


anmolnar merged PR #6887:
URL: https://github.com/apache/hbase/pull/6887


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-03 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2935374051

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   3m 24s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 15s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   2m 15s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m 12s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   6m  2s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  8s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m 12s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m 12s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  9s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 57s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 33s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   2m 17s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   1m 36s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 256m 49s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 296m 20s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux 9562ddbc6718 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 / 481e4e6045f43721e5e69537ab3d1877c7c17006 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/testReport/
 |
   | Max. process+thread count | 4528 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-03 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2934489069

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   4m  6s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 33s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m  6s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   6m 21s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 33s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   6m 22s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 51s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 50s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   6m 23s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   6m 23s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   6m 23s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 32s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   7m  0s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  13m  9s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   2m  8s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 56s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 43s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  68m 52s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux 045f4d52c9d5 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 / 481e4e6045f43721e5e69537ab3d1877c7c17006 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 85 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/9/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-03 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2123199566


##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   Yes, I still believe it would be cleaner design, but I approve the patch 
regardless.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-02 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2933552413

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 51s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m 13s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   3m 13s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m 32s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   6m 42s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 50s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m 36s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m 36s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m 18s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   7m 44s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   1m  4s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   4m 20s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   2m 52s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 314m 48s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/8/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 361m 32s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/8/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux f321599bc235 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 / 481e4e6045f43721e5e69537ab3d1877c7c17006 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/8/testReport/
 |
   | Max. process+thread count | 4537 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-06-02 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2933001212

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 36s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m  4s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   6m 21s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 34s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   6m 38s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 55s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 18s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 41s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   5m 56s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   5m 56s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   5m 56s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 20s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   6m 38s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m 58s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   1m 48s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 35s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  62m 40s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/8/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux 0e9f15ad0df2 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 / 481e4e6045f43721e5e69537ab3d1877c7c17006 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 86 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-29 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2113654954


##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +393,68 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+String suffix_file_name = HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME;
+boolean activeClusterSuffixFileExists =
+  FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir, suffix_file_name, 
wait);

Review Comment:
   Yes. I think it is possible to use exception types coming from 
getActiveClusterSuffix method and update the logic here to do it one step. I 
will try out the changes and update the patch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-29 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2113654954


##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +393,68 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+String suffix_file_name = HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME;
+boolean activeClusterSuffixFileExists =
+  FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir, suffix_file_name, 
wait);

Review Comment:
   Yes. I think it is possible to use exception types coming from 
getActiveClusterSuffix method and update the logic here to do it in one step. I 
will try out the changes and update the patch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-29 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2113652108


##
hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java:
##
@@ -1668,6 +1668,9 @@ public enum OperationStatusCode {
*/
   public final static boolean HBASE_GLOBAL_READONLY_ENABLED_DEFAULT = false;
 
+  /** name of the file having active cluster suffix */
+  public static final String ACTIVE_CLUSTER_SUFFIX_FILE_NAME = 
"active_cluster_suffix.id";

Review Comment:
   Sure, will change that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-29 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2113647529


##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   It can be stored as 2 fields but I have first coded considering 1 field 
after getting comments added the cluster id. 
   
   Both the fields are string. For primary, the suffix is anyways null. Also, 
concatenated string comparison serves the purpose. Hence, I see no problem 
concatenating and storing them. Please let me know if you still want it to be 
coded as two different fields.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-29 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2113647529


##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   It can be stored as 2 fields but I have first coded considering 1 field 
after getting comments added the cluster id. 
   Both the fields are string. For primary, the suffix is anyways null. Also, 
concatenated string comparison serves the purpose. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-28 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2112938923


##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +393,68 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+String suffix_file_name = HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME;
+boolean activeClusterSuffixFileExists =
+  FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir, suffix_file_name, 
wait);

Review Comment:
   Would it be possible to read the file contents _and_ check for existence in 
a single step?
   That would reduce the possibility of a race condition issue between here and 
line where you read the contents.



##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   Why don't you store them as two separate fields?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-28 Thread via GitHub


Kota-SH commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2112627979


##
hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java:
##
@@ -1668,6 +1668,9 @@ public enum OperationStatusCode {
*/
   public final static boolean HBASE_GLOBAL_READONLY_ENABLED_DEFAULT = false;
 
+  /** name of the file having active cluster suffix */
+  public static final String ACTIVE_CLUSTER_SUFFIX_FILE_NAME = 
"active_cluster_suffix.id";

Review Comment:
   All config keys in this class use dots as separators. Can we follow a 
similar approach here and use something like this - active.cluster.suffix.id?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-28 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2111393640


##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   Suffix will be cluster id and meta suffix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-21 Thread via GitHub


anmolnar commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2899304044

   @wchevreuil You might want to check these test failure, because as far as I 
can see flaky test fixes are already rebased to the feature branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-20 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2895074720

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |  19m 10s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m 14s |  |  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 :ok: |  mvndep  |   0m 45s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  10m  8s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   3m 27s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m 46s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   8m 48s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 15s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   6m 41s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   5m 24s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   5m 24s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m 33s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   7m 15s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 47s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   3m 18s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   2m  0s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 301m 58s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 382m 53s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux c685939563a9 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 / a2e4b9cb7c5e9dbc7d58525ca95e8c91c639a018 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/testReport/
 |
   | Max. process+thread count | 5174 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-20 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2893917187

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 47s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 38s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   5m 25s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   7m 12s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 36s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   7m 36s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   1m 17s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 18s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   5m  2s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   7m 37s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   7m 37s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   7m 37s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 56s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   8m 28s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  14m 32s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   2m 42s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 55s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 53s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  76m 42s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux 837e2ba3b1b0 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 / a2e4b9cb7c5e9dbc7d58525ca95e8c91c639a018 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 84 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/7/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-19 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2893060976

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 30s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 10s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 10s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   2m 10s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m  9s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   5m 57s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  2s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m 10s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m 10s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  9s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 55s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 33s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   2m 14s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   1m 35s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 229m 17s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 264m 37s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux e1f856d19629 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 / 39f8d25820d812da1ae91143f9ba7ecbec78ff9e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/testReport/
 |
   | Max. process+thread count | 5430 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-19 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2892756503

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 33s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 16s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   5m 21s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 12s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   5m  9s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 47s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  4s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   7m 16s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   7m 16s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   7m 16s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 36s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   5m 53s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  16m 53s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   9m 44s |  |  the patch passed  |
   | -1 :x: |  spotless  |   1m 25s |  |  patch has 1 errors when running 
spotless:check, run spotless:apply to fix.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 49s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  76m  8s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux 5b60b26832c8 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 / 39f8d25820d812da1ae91143f9ba7ecbec78ff9e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | spotless | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/artifact/yetus-general-check/output/patch-spotless.txt
 |
   | Max. process+thread count | 85 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/6/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-19 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2096593743


##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseCommonTestingUtil;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.master.MasterFileSystem;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.RegionServerTests;
+import org.apache.hadoop.hbase.util.CommonFSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test Active Cluster Suffix file.
+ */
+@Category({ RegionServerTests.class, MediumTests.class })
+public class TestActiveClusterSuffix {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+HBaseClassTestRule.forClass(TestActiveClusterSuffix.class);
+
+  private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
+
+  private JVMClusterUtil.RegionServerThread rst;
+
+  @Before
+  public void setUp() throws Exception {
+TEST_UTIL.getConfiguration().setBoolean(ShutdownHook.RUN_SHUTDOWN_HOOK, 
false);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+TEST_UTIL.shutdownMiniCluster();
+if (rst != null && rst.getRegionServer() != null) {
+  rst.getRegionServer().stop("end of test");
+  rst.join();
+}
+  }
+
+  @Test
+  public void testActiveClusterSuffixCreated() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.startMiniHBaseCluster();
+
+Path rootDir = CommonFSUtils.getRootDir(TEST_UTIL.getConfiguration());
+FileSystem fs = rootDir.getFileSystem(TEST_UTIL.getConfiguration());
+Path filePath = new Path(rootDir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+assertTrue(filePath + " should exists ", fs.exists(filePath));
+assertTrue(filePath + " should not be empty  ", 
fs.getFileStatus(filePath).getLen() > 0);
+
+MasterFileSystem mfs = 
TEST_UTIL.getHBaseCluster().getMaster().getMasterFileSystem();
+// Compute string using currently set suffix and the cluster id
+String cluster_suffix1 =
+  new String(mfs.getSuffixFileDataToCompare(), StandardCharsets.US_ASCII);
+// Compute string member variable
+String cluster_suffix2 = mfs.getActiveClusterSuffix().toString();
+assertEquals(cluster_suffix1, cluster_suffix2);
+  }
+
+  @Test
+  public void testSuffixFileOnRestart() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();
+TEST_UTIL.getConfiguration().set(HConstants.HBASE_META_TABLE_SUFFIX, 
"Test");
+
+String clusterId = HBaseCommonTestingUtil.getRandomUUID().toString();
+String cluster_suffix = clusterId + ":" + TEST_UTIL.getConfiguration()
+  .get(HConstants.HBASE_META_TABLE_SUFFIX, 
HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE);
+
+writeIdFile(clusterId, HConstants.CLUSTER_ID_FILE_NAME);
+writeIdFile(cluster_suffix, HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+boolean threwIOE = false;
+try {
+  TEST_UTIL.startMiniHBaseCluster();
+} catch (IOException ioe) {
+  threwIOE = true;
+} finally {
+  assertFalse("The master should not have thrown an exception", threwIOE);

Review Comment:
   Don't need a variable for this. You can do `fail(...)` in the catch clause.



-- 
This is an automated message from the Apache Git Service.
To resp

Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-19 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2096582619


##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.master.MasterFileSystem;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.RegionServerTests;
+import org.apache.hadoop.hbase.util.CommonFSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test Active Cluster Suffix file.
+ */
+@Category({ RegionServerTests.class, MediumTests.class })
+public class TestActiveClusterSuffix {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+HBaseClassTestRule.forClass(TestActiveClusterSuffix.class);
+
+  private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
+
+  private JVMClusterUtil.RegionServerThread rst;
+
+  @Before
+  public void setUp() throws Exception {
+TEST_UTIL.getConfiguration().setBoolean(ShutdownHook.RUN_SHUTDOWN_HOOK, 
false);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+TEST_UTIL.shutdownMiniCluster();
+if (rst != null && rst.getRegionServer() != null) {
+  rst.getRegionServer().stop("end of test");
+  rst.join();
+}
+  }
+
+  @Test
+  public void testActiveClusterSuffixCreated() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();
+TEST_UTIL.startMiniHBaseCluster();
+Path rootDir = CommonFSUtils.getRootDir(TEST_UTIL.getConfiguration());
+FileSystem fs = rootDir.getFileSystem(TEST_UTIL.getConfiguration());
+Path filePath = new Path(rootDir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+assertTrue(filePath + " should exists ", fs.exists(filePath));
+assertTrue(filePath + " should not be empty  ", 
fs.getFileStatus(filePath).getLen() > 0);

Review Comment:
   > I am getting error if I stop and start mini cluster in the same test case 
hence distributed the scenarios.
   
   That's very good idea.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-18 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2889295267

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 31s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 38s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 51s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   3m 16s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m 44s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   7m 48s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 16s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   4m 13s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m 58s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m 58s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m 40s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   7m 29s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 40s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   2m 51s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   2m  0s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 276m 36s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 322m 52s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux ac7eed4ab686 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 / 39f8d25820d812da1ae91143f9ba7ecbec78ff9e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/testReport/
 |
   | Max. process+thread count | 5217 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-18 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2889179501

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 29s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 40s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m 31s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   6m 49s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 45s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   7m  1s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   1m  4s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   4m 11s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   7m 31s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   7m 31s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   7m 31s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   2m 15s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   7m 20s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  13m  1s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   2m  1s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 50s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 37s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  69m 35s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux f718bb9270cc 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 / 39f8d25820d812da1ae91143f9ba7ecbec78ff9e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 84 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/5/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-06 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2855752858

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 31s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 10s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 17s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   2m  8s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m 10s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   5m 57s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  6s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m  8s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m  8s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  8s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 54s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 35s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | +1 :green_heart: |  unit  |   2m 17s |  |  hbase-common in the patch 
passed.  |
   | +1 :green_heart: |  unit  |   1m 35s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 225m 45s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 262m  1s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux 72fd5cb3f5d0 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 / 01430d1efcfc2a2cfccc6a2091cae60f9ff0831c |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/testReport/
 |
   | Max. process+thread count | 5259 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-06 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2855177285

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 33s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 35s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 29s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   5m  4s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 12s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   5m  2s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 46s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  1s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   5m  3s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   5m  3s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   5m  3s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 16s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   5m 30s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  12m  1s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   1m 49s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 44s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 35s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  55m  6s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux 486574b9f89a 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 / 01430d1efcfc2a2cfccc6a2091cae60f9ff0831c |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 86 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/4/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-05-06 Thread via GitHub


kabhishek4 commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2075694662


##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.master.MasterFileSystem;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.RegionServerTests;
+import org.apache.hadoop.hbase.util.CommonFSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test Active Cluster Suffix file.
+ */
+@Category({ RegionServerTests.class, MediumTests.class })
+public class TestActiveClusterSuffix {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+HBaseClassTestRule.forClass(TestActiveClusterSuffix.class);
+
+  private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
+
+  private JVMClusterUtil.RegionServerThread rst;
+
+  @Before
+  public void setUp() throws Exception {
+TEST_UTIL.getConfiguration().setBoolean(ShutdownHook.RUN_SHUTDOWN_HOOK, 
false);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+TEST_UTIL.shutdownMiniCluster();
+if (rst != null && rst.getRegionServer() != null) {
+  rst.getRegionServer().stop("end of test");
+  rst.join();
+}
+  }
+
+  @Test
+  public void testActiveClusterSuffixCreated() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();
+TEST_UTIL.startMiniHBaseCluster();
+Path rootDir = CommonFSUtils.getRootDir(TEST_UTIL.getConfiguration());
+FileSystem fs = rootDir.getFileSystem(TEST_UTIL.getConfiguration());
+Path filePath = new Path(rootDir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+assertTrue(filePath + " should exists ", fs.exists(filePath));
+assertTrue(filePath + " should not be empty  ", 
fs.getFileStatus(filePath).getLen() > 0);

Review Comment:
   Changed Tests, now
   
   Test 1
Starts with empty root creates the suffix file, existance and contents 
of the files are verified.
   
   Test 2
Starts with existing root dir with existing active cluster id and 
suffix file (we need both cluster id and suffix to write in the file)
Starts mini cluster
verify the contents as per configs set
   
   Test 3
This one is the only negative case 
   
   I am getting error if I stop and start mini cluster in the same test case 
hence distributed the scenarios.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-30 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2069420566


##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.master.MasterFileSystem;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.RegionServerTests;
+import org.apache.hadoop.hbase.util.CommonFSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test Active Cluster Suffix file.
+ */
+@Category({ RegionServerTests.class, MediumTests.class })
+public class TestActiveClusterSuffix {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+HBaseClassTestRule.forClass(TestActiveClusterSuffix.class);
+
+  private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
+
+  private JVMClusterUtil.RegionServerThread rst;
+
+  @Before
+  public void setUp() throws Exception {
+TEST_UTIL.getConfiguration().setBoolean(ShutdownHook.RUN_SHUTDOWN_HOOK, 
false);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+TEST_UTIL.shutdownMiniCluster();
+if (rst != null && rst.getRegionServer() != null) {
+  rst.getRegionServer().stop("end of test");
+  rst.join();
+}
+  }
+
+  @Test
+  public void testActiveClusterSuffixCreated() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();
+TEST_UTIL.startMiniHBaseCluster();
+Path rootDir = CommonFSUtils.getRootDir(TEST_UTIL.getConfiguration());
+FileSystem fs = rootDir.getFileSystem(TEST_UTIL.getConfiguration());
+Path filePath = new Path(rootDir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+assertTrue(filePath + " should exists ", fs.exists(filePath));
+assertTrue(filePath + " should not be empty  ", 
fs.getFileStatus(filePath).getLen() > 0);
+  }
+
+  @Test
+  public void testSuffixFileOnRestart() throws Exception {

Review Comment:
   This test could be the 2nd of two positive test cases mentioned previously.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-30 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2069418121


##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.master.MasterFileSystem;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.RegionServerTests;
+import org.apache.hadoop.hbase.util.CommonFSUtils;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test Active Cluster Suffix file.
+ */
+@Category({ RegionServerTests.class, MediumTests.class })
+public class TestActiveClusterSuffix {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+HBaseClassTestRule.forClass(TestActiveClusterSuffix.class);
+
+  private final HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil();
+
+  private JVMClusterUtil.RegionServerThread rst;
+
+  @Before
+  public void setUp() throws Exception {
+TEST_UTIL.getConfiguration().setBoolean(ShutdownHook.RUN_SHUTDOWN_HOOK, 
false);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+TEST_UTIL.shutdownMiniCluster();
+if (rst != null && rst.getRegionServer() != null) {
+  rst.getRegionServer().stop("end of test");
+  rst.join();
+}
+  }
+
+  @Test
+  public void testActiveClusterSuffixCreated() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();
+TEST_UTIL.startMiniHBaseCluster();
+Path rootDir = CommonFSUtils.getRootDir(TEST_UTIL.getConfiguration());
+FileSystem fs = rootDir.getFileSystem(TEST_UTIL.getConfiguration());
+Path filePath = new Path(rootDir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+
+assertTrue(filePath + " should exists ", fs.exists(filePath));
+assertTrue(filePath + " should not be empty  ", 
fs.getFileStatus(filePath).getLen() > 0);
+  }
+
+  @Test
+  public void testSuffixFileOnRestart() throws Exception {
+TEST_UTIL.startMiniZKCluster();
+TEST_UTIL.startMiniDFSCluster(1);
+TEST_UTIL.createRootDir();

Review Comment:
   Same here.



##
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestActiveClusterSuffix.java:
##
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.fs.FSDataOutputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.a

Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-30 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2069040971


##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +394,61 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+LOG.info("Active cluster Suffix file");

Review Comment:
   Please remove this log line. It doesn't add value.



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +394,61 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+LOG.info("Active cluster Suffix file");
+String suffix_file_name = HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME;
+boolean activeClusterSuffixFileExists =
+  FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir, suffix_file_name, 
wait);
+
+if (!isReadOnlyModeEnabled(conf)) {
+  // this is the active cluster, create active cluster suffix file if it 
does not exist
+  if (!activeClusterSuffixFileExists) {
+FSUtils.setActiveClusterSuffix(fs, rootdir, 
getSuffixFileDataToWrite(), wait);
+  } else {
+// verify the contents against the config set
+ActiveClusterSuffix acs = FSUtils.getActiveClusterSuffix(fs, rootdir);
+if (Objects.equals(acs.getActiveClusterSuffix(), 
getActiveClusterSuffix())) {
+  LOG.info("This is the active cluster on this storage location, "
++ "File Suffix {} : Suffix {} : ", acs, getActiveClusterSuffix());

Review Comment:
   Move this log entry one level up when the else branch is finished without 
error. Either we created a new active_cluster file or verified the contents of 
the existing, we're good to continue as the only active cluster.



##
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java:
##
@@ -857,6 +935,12 @@ public static void renameFile(FileSystem fs, Path src, 
Path dst) throws IOExcept
 }
   }
 
+  public static void removeFile(FileSystem fs, Path filepath) throws 
IOException {

Review Comment:
   This method is not used.



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +394,61 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void negotiateActiveClusterSuffixFile(long wait) throws IOException {
+LOG.info("Active cluster Suffix file");
+String suffix_file_name = HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME;
+boolean activeClusterSuffixFileExists =
+  FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir, suffix_file_name, 
wait);
+
+if (!isReadOnlyModeEnabled(conf)) {
+  // this is the active cluster, create active cluster suffix file if it 
does not exist
+  if (!activeClusterSuffixFileExists) {
+FSUtils.setActiveClusterSuffix(fs, rootdir, 
getSuffixFileDataToWrite(), wait);
+  } else {
+// verify the contents against the config set
+ActiveClusterSuffix acs = FSUtils.getActiveClusterSuffix(fs, rootdir);
+if (Objects.equals(acs.getActiveClusterSuffix(), 
getActiveClusterSuffix())) {
+  LOG.info("This is the active cluster on this storage location, "
++ "File Suffix {} : Suffix {} : ", acs, getActiveClusterSuffix());
+} else {
+  // throw error
+  LOG.info("rootdir {} : Active Cluster File Suffix {} ", rootdir, 
acs);
+  throw new IOException("Can not start active cluster, please check 
the value of "
++ "configuration hbase.global.readonly.enabled in hbase-site.xml, "
++ "Active Cluster Suffix : " + getActiveClusterSuffix()
++ ": Active Cluster File Suffix " + acs);

Review Comment:
   Please rephrase the error message something like:
   > Cannot start master, because another cluster is running in active 
(read-write) mode on this storage location. Active Cluster Id: ...  This 
cluster Id: ...



##
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java:
##
@@ -612,31 +668,54 @@ private static void rewriteAsPb(final FileSystem fs, 
final Path rootdir, final P
*/
   public static void setClusterId(final FileSystem fs, final Path rootdir,
 final ClusterId clusterId, final long wait) throws IOException {
-
 final Path idFile = new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME);
 final Path tempDir = new Path(rootdir, HConstants.HBASE_TEMP_DIRECTORY);
 final Path tempIdFile = new Path(tempDir, HConstants.CLUSTER_ID_FILE_NAME);
 
 LOG.debug("Create cluster 

Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-29 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2839940941

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 34s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 35s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 29s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   2m 11s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   1m  9s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   5m 55s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   2m 59s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m  6s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m  6s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  7s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 53s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 35s |  |  hbase-protocol-shaded in the 
patch passed.  |
   | -1 :x: |  unit  |   3m  4s | 
[/patch-unit-hbase-common.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-common.txt)
 |  hbase-common in the patch failed.  |
   | +1 :green_heart: |  unit  |   1m 34s |  |  hbase-client in the patch 
passed.  |
   | -1 :x: |  unit  | 372m 45s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 409m 41s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux f247271727b3 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 / 922815e199c01432829bb7cd1ee19fc82db9f34e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/testReport/
 |
   | Max. process+thread count | 4763 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-29 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2838851830

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 34s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +0 :ok: |  buf  |   0m  0s |  |  buf was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 10s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 13s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   5m  4s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m 11s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   4m 59s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  0s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   4m 57s |  |  the patch passed  |
   | +1 :green_heart: |  cc  |   4m 57s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   4m 57s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | -0 :warning: |  checkstyle  |   0m 35s | 
[/results-checkstyle-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-general-check/output/results-checkstyle-hbase-server.txt)
 |  hbase-server: The patch generated 1 new + 7 unchanged - 0 fixed = 8 total 
(was 7)  |
   | -1 :x: |  spotbugs  |   1m 42s | 
[/new-spotbugs-hbase-server.html](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-general-check/output/new-spotbugs-hbase-server.html)
 |  hbase-server generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)  |
   | +1 :green_heart: |  hadoopcheck  |  11m 44s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  hbaseprotoc  |   1m 46s |  |  the patch passed  |
   | +1 :green_heart: |  spotless  |   0m 43s |  |  patch has no errors when 
running spotless:check.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 34s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  53m 33s |  |  |
   
   
   | Reason | Tests |
   |---:|:--|
   | SpotBugs | module:hbase-server |
   |  |  Call to String.equals(org.apache.hadoop.hbase.ActiveClusterSuffix) in 
org.apache.hadoop.hbase.master.MasterFileSystem.negotiateActiveClusterSuffixFile(long)
  At MasterFileSystem.java: At MasterFileSystem.java:[line 411] |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless cc buflint bufcompat 
hbaseprotoc |
   | uname | Linux f5a6c2d7dc4a 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 / 922815e199c01432829bb7cd1ee19fc82db9f34e |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 85 (vs. ulimit of 3) |
   | modules | C: hbase-protocol-shaded hbase-common hbase-client hbase-server 
U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/3/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-23 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2056588724


##
hbase-protocol-shaded/src/main/protobuf/server/ActiveClusterSuffix.proto:
##
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+// This file contains protocol buffers that are shared throughout HBase
+package hbase.pb;
+
+option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
+option java_outer_classname = "ActiveClusterSuffixProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/active_cluster_suffix.id' file to indicate the 
active cluster.
+ */
+message ActiveClusterSuffix {
+  // This is the active cluster suffix set by the user in the config, as a 
String
+  required string active_cluster_suffix = 1;

Review Comment:
   Are you going to store only the suffix?
   Suffix is usually empty for the active cluster, so you'll write an empty 
file in that case. I'd suggest to add the cluster id as well: 
"clusterId_metasuffix".



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +392,106 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  // This API should be to be called on the 'old active cluster' before the 
switch over,
+  // to delete the associated active_cluster.id file.
+  public boolean prepareForSwitchOver() {
+boolean status = true;
+final Path idFile = new Path(rootdir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+try {
+  LOG.info("Deleting active cluster ID file");
+  FSUtils.removeFile(fs, idFile);
+} catch (IOException ioe) {
+  LOG.warn("Failed to delete the active cluster ID file due to 
IOException", ioe);
+  status = false;
+}
+return status;
+  }
+
+  // This API should be called on the 'new active cluster' to complete the 
process of switch over,
+  // to create the new active_cluster.id file.
+  public boolean performSwitchOver() {

Review Comment:
   Where do you use this method?



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +392,106 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  // This API should be to be called on the 'old active cluster' before the 
switch over,
+  // to delete the associated active_cluster.id file.
+  public boolean prepareForSwitchOver() {

Review Comment:
   Where do you use this method?



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +392,106 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  // This API should be to be called on the 'old active cluster' before the 
switch over,
+  // to delete the associated active_cluster.id file.
+  public boolean prepareForSwitchOver() {
+boolean status = true;
+final Path idFile = new Path(rootdir, 
HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME);
+try {
+  LOG.info("Deleting active cluster ID file");
+  FSUtils.removeFile(fs, idFile);
+} catch (IOException ioe) {
+  LOG.warn("Failed to delete the active cluster ID file due to 
IOException", ioe);
+  status = false;
+}
+return status;
+  }
+
+  // This API should be called on the 'new active cluster' to complete the 
process of switch over,
+  // to create the new active_cluster.id file.
+  public boolean performSwitchOver() {
+LOG.info("Creating new cluster ID file during switchover");
+boolean status = true;
+int wait = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
+try {
+  String ms = conf.get(HConstants.HBASE_META_TABLE_SUFFIX,
+HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE);
+  if (
+!FSUtils.checkFileExistsInHbaseRootDir(fs, rootdir,
+  HConstants.ACTIVE_CLUSTER_SUFFIX_FILE_NAME, wait)
+  ) {
+ 

Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-22 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2822493299

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m  0s |  |  Docker mode activated.  |
   | -1 :x: |  patch  |   0m  7s |  |  
https://github.com/apache/hbase/pull/6887 does not apply to HBASE-29081. Rebase 
required? Wrong Branch? See 
https://yetus.apache.org/documentation/in-progress/precommit-patchnames for 
help.  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/2/console 
|
   | versions | git=2.17.1 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-22 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2822489637

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m  0s |  |  Docker mode activated.  |
   | -1 :x: |  patch  |   0m  7s |  |  
https://github.com/apache/hbase/pull/6887 does not apply to HBASE-29081. Rebase 
required? Wrong Branch? See 
https://yetus.apache.org/documentation/in-progress/precommit-patchnames for 
help.  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/2/console 
|
   | versions | git=2.17.1 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-10 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2784734335

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 42s |  |  Docker mode activated.  |
    _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any 
anti-patterns.  |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m  3s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   4m 45s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  checkstyle  |   1m  8s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotbugs  |   2m 39s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  spotless  |   0m 55s |  |  branch has no errors when 
running spotless:check.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   4m  2s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   4m 41s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   4m 41s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 12s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   2m 54s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  14m  7s |  |  Patch does not cause any 
errors with Hadoop 3.3.6 3.4.0.  |
   | -1 :x: |  spotless  |   0m 19s |  |  patch has 21 errors when running 
spotless:check, run spotless:apply to fix.  |
    _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 20s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   |  51m 20s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell 
detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux 9c04949c24d7 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 / 8f500f82c9a7d3dcb75b8917c8b731bc3125d983 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | spotless | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/artifact/yetus-general-check/output/patch-spotless.txt
 |
   | Max. process+thread count | 84 (vs. ulimit of 3) |
   | modules | C: hbase-common hbase-server U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-10 Thread via GitHub


anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2031678045


##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+LOG.info("HBase cluster ID file");

Review Comment:
   Please remove this log line.



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+LOG.info("HBase cluster ID file");
+if (!FSUtils.checkClusterIdExists(fs, rootdir, 
HConstants.CLUSTER_ID_FILE_NAME, wait)) {
+  FSUtils.setClusterId(fs, rootdir, HConstants.CLUSTER_ID_FILE_NAME, new 
ClusterId(), wait);
+}
+clusterId = FSUtils.getClusterId(fs, rootdir);
+  }
+
+  private void negotiateActiveClusterIdFile(long wait) throws IOException {
+LOG.info("Active cluster ID file");

Review Comment:
   Please remove this log line.



##
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
 CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+LOG.info("HBase cluster ID file");
+if (!FSUtils.checkClusterIdExists(fs, rootdir, 
HConstants.CLUSTER_ID_FILE_NAME, wait)) {
+  FSUtils.setClusterId(fs, rootdir, HConstants.CLUSTER_ID_FILE_NAME, new 
ClusterId(), wait);
+}
+clusterId = FSUtils.getClusterId(fs, rootdir);
+  }
+
+  private void negotiateActiveClusterIdFile(long wait) throws IOException {
+LOG.info("Active cluster ID file");
+boolean isReadOnlyModeEnabled = 
conf.getBoolean(HConstants.HBASE_GLOBAL_READONLY_ENABLED_KEY,
+  HConstants.HBASE_GLOBAL_READONLY_ENABLED_DEFAULT);
+boolean activeClusterIdFileExists = FSUtils.checkClusterIdExists(
+  fs, rootdir, HConstants.ACTIVE_CLUSTER_ID_FILE_NAME, wait);
+
+if (!isReadOnlyModeEnabled) {
+  // create active_cluster.id file if it does not exist
+  if (!activeClusterIdFileExists) {
+FSUtils.setClusterId(
+  fs, rootdir, HConstants.ACTIVE_CLUSTER_ID_FILE_NAME, getClusterId(), 
wait);
+LOG.info("Active Cluster id file created, cluster ID : {}", 
getClusterId());
+  } else {
+// validate the cluster id
+ClusterId cid = FSUtils.getClusterId(fs, rootdir);
+if (cid.equals(getClusterId())) {
+  //change this to debug
+  LOG.info("Active cluster is being restarted, ID {}", cid);

Review Comment:
   No need to log this. It could have been a crash or something else and this 
could be misleading. This is normal startup anyways.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] HBASE-29228 Add support to prevent running multiple active clusters [hbase]

2025-04-07 Thread via GitHub


Apache-HBase commented on PR #6887:
URL: https://github.com/apache/hbase/pull/6887#issuecomment-2785153136

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |::|--:|:|::|:---:|
   | +0 :ok: |  reexec  |   0m 29s |  |  Docker mode activated.  |
   | -0 :warning: |  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 _ |
    _ HBASE-29081 Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 10s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 10s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  compile  |   1m 16s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  javadoc  |   0m 44s |  |  HBASE-29081 passed  |
   | +1 :green_heart: |  shadedjars  |   5m 58s |  |  branch has no errors when 
building our shaded downstream artifacts.  |
    _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m  6s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 42s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 52s |  |  patch has no errors when 
building our shaded downstream artifacts.  |
    _ Other Tests _ |
   | -1 :x: |  unit  |   2m 57s | 
[/patch-unit-hbase-common.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-common.txt)
 |  hbase-common in the patch failed.  |
   | -1 :x: |  unit  | 365m 46s | 
[/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt)
 |  hbase-server in the patch failed.  |
   |  |   | 397m  5s |  |  |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hbase/pull/6887 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux af36b7a0be28 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 / 8f500f82c9a7d3dcb75b8917c8b731bc3125d983 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/testReport/
 |
   | Max. process+thread count | 5150 (vs. ulimit of 3) |
   | modules | C: hbase-common hbase-server U: . |
   | Console output | 
https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6887/1/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.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]