Skip to content

HBASE-29279 Allow throttling alter operation via table configuration #6951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

junegunn
Copy link
Member

@junegunn junegunn commented Apr 30, 2025

See https://issues.apache.org/jira/browse/HBASE-29279

Examples

# Use global defaults
alter 't', { NAME => 'd', COMPRESSION => 'GZ' }

# Apply custom throttling for this alter operation
alter 't', { NAME => 'd', COMPRESSION => 'GZ' },
      {
        CONFIGURATION => {
          'hbase.reopen.table.regions.progressive.batch.size.max' => 32,
          'hbase.reopen.table.regions.progressive.batch.backoff.ms' => 500
        }
      }

# Future alter operations on this table will reuse the throttling configuration
alter 't', { NAME => 'd', COMPRESSION => 'GZ' }

public static final int PROGRESSIVE_BATCH_SIZE_MAX_DISABLED = -1;
private static final int PROGRESSIVE_BATCH_SIZE_MAX_DEFAULT_VALUE = Integer.MAX_VALUE;
Copy link
Member Author

Choose a reason for hiding this comment

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

This one was unused.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@junegunn
Copy link
Member Author

junegunn commented May 1, 2025

Hi @rmdmattingly, when you have a moment, could you take a look at this? It's a simple change but I believe it makes the throttling feature much more useful in production.

public static final long PROGRESSIVE_BATCH_BACKOFF_MILLIS_DEFAULT = 0L;
public static final String PROGRESSIVE_BATCH_SIZE_MAX_KEY =
"hbase.reopen.table.regions.progressive.batch.size.max";
ConfigKey.INT("hbase.reopen.table.regions.progressive.batch.size.max");
Copy link
Member Author

Choose a reason for hiding this comment

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

Type checks are now necessary.

@junegunn junegunn force-pushed the HBASE-29279 branch 3 times, most recently from 31c0c8d to 5529cb4 Compare May 5, 2025 11:33
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Add ReopenTableRegionsProcedure.throttled to create a procedure
with the throttling configuration.
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 26s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+1 💚 mvninstall 3m 14s master passed
+1 💚 compile 3m 16s master passed
+1 💚 checkstyle 0m 35s master passed
+1 💚 spotbugs 1m 36s master passed
+1 💚 spotless 0m 47s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 5s the patch passed
+1 💚 compile 3m 17s the patch passed
+1 💚 javac 3m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 spotbugs 1m 40s the patch passed
+1 💚 hadoopcheck 11m 54s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 44s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
38m 42s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6951/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6951
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux e55aefbad18d 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3f520a4
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 86 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6951/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.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 16s master passed
+1 💚 compile 0m 58s master passed
+1 💚 javadoc 0m 28s master passed
+1 💚 shadedjars 5m 53s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 7s the patch passed
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
+1 💚 javadoc 0m 26s the patch passed
+1 💚 shadedjars 5m 51s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 211m 33s hbase-server in the patch passed.
237m 35s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6951/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6951
Optional Tests javac javadoc unit compile shadedjars
uname Linux c047c7f27940 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 3f520a4
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6951/4/testReport/
Max. process+thread count 5445 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6951/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.

*/
public static ReopenTableRegionsProcedure throttled(final Configuration conf,
final TableDescriptor desc) {
long backoffMillis = Optional.ofNullable(desc.getValue(PROGRESSIVE_BATCH_BACKOFF_MILLIS_KEY))
Copy link
Contributor

Choose a reason for hiding this comment

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

Pity we do not return Optional for desc.getValue...

@junegunn junegunn merged commit 145972f into apache:master Jun 13, 2025
1 check passed
@junegunn
Copy link
Member Author

@Apache9 Thanks for the approval. I've opened a PR to backport this to branch-2. But do you think it's okay to backport this to branch-2.6 as well? I personally think it's a great enhancement of the feature, and it's safe to backport because it's completely backward compatible, but I'm curious how you see it.

@NihalJain
Copy link
Contributor

Hi @junegunn welcome to hbase committers' group. I noticed you have merged a few PRs and missed to mention signed-off to those. Not a problem, even I did same when I became a new committer.

But this doc helped me understand how-to's specific to Apache HBase, might be useful to you as well. I wish this (HBASE-21701) was part of our official book!

CC: @chandrasekhar-188k @guluo2016 @charlesconnell

@junegunn
Copy link
Member Author

Thank you @NihalJain for helping me out, and apologies for missing that part! Could you share your process of adding the "Signed-off-by" and "Reviewed-by" lines to the commit message? Do I have to manually collect the email addresses of the reviewers and write the lines, or is there an easier way to do it?

@NihalJain
Copy link
Contributor

Thank you @NihalJain for helping me out, and apologies for missing that part! Could you share your process of adding the "Signed-off-by" and "Reviewed-by" lines to the commit message? Do I have to manually collect the email addresses of the reviewers and write the lines, or is there an easier way to do it?

I think its all manual, I usually refer hbase teams https://hbase.apache.org/team.html page, or old commits to get email id for a user; if still cant find it, I check their github homepage. If neither of these help, I skip adding it.

@junegunn
Copy link
Member Author

I see, thanks. I guess it'll get easier once I get used to the process. I can imagine writing up a script to automate as much of it as possible. Could it be a good candidate for a dev-support script? I'll let you know of the progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants