Skip to content

HBASE-29386: SnapshotProcedure and EnableTableProcedure can cause a deadlock - #7084

Merged
rmdmattingly merged 1 commit into
apache:masterfrom
hgromer:HBASE-29386
Jun 26, 2025
Merged

HBASE-29386: SnapshotProcedure and EnableTableProcedure can cause a deadlock#7084
rmdmattingly merged 1 commit into
apache:masterfrom
hgromer:HBASE-29386

Conversation

@hgromer

Copy link
Copy Markdown
Contributor

No description provided.

@hgromer

hgromer commented Jun 10, 2025

Copy link
Copy Markdown
ContributorAuthor

}

@Test
public void testItCanEnableTableWhileSnapshotProcedureIsRunning() throws Exception {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This test fails without my changes, both procedures will run forever. This also functions as the reproduction of the phenomenon.

For reproducibility, I manually set the table state to ENABLING, and then kick off the EnableTableProcedure at the stage it gets stuck on (after subprocesses finish)

this.shouldForceLockRelease = shouldForceLockRelease;
}

public boolean shouldForceLockRelease() {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The Procedure class has a holdLock method which returns true for SnapshotProcedure. This prevents us from releasing the lock even on suspension. I believe that at the stage where the deadlock could happen, it's safe to release the lock. We haven't done any snapshotting yet, so I believe there shouldn't be any weird data inconsistencies from region splits/merges.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we just modify the SnapshotProcedure.holdLock() behaviour? Afterall, this is contrary to what we say in that method comment:

protected boolean holdLock(MasterProcedureEnv env) { // In order to avoid enabling/disabling/modifying/deleting table during snapshot, // we don't release lock during suspend return true; }
And you are already modifying SnapshotProcedure execution logic to reflect the special condition when the lock should be released, so better keep this there and avoid changing ProcedureSuspendedException?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I don't think we should. If we did, we'd have potential inconsistencies. As I mention in my comment, this bypass allows us to release the lock prior to us actually snapshotting any data. Once we start snapshotting (anything in at or past SNAPSHOT_SNAPSHOT_ONLINE_REGIONS) it is unsafe to release the lock.

I think the comment still holds. We want to avoid enabling/disabling/modifying/deleting a table during a snapshot. The procedure suspension occurs prior to us starting to snapshot any data, at SNAPSHOT_WRITE_SNAPSHOT_INFO.

@hgromerhgromerJun 10, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Alternatively, maybe a less confusing option would be to return a non-static value for holdLock in SnapshotProcedure

This forces you to manage additional state at each stage though, which I why I opted for this implementation which I thought was safer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the comment still holds. We want to avoid enabling/disabling/modifying/deleting a table during a snapshot.

We may want to avoid, but now we are allowing a case where we suspend and release the lock.

Alternatively, maybe a less confusing option would be to return a non-static value for holdLock in SnapshotProcedure

That's what I meant by "modify the SnapshotProcedure.holdLock() behaviour". You are already modifying SnapshotProcedure behaviour to cause a release lock suspension via a flag in the ProcedureSuspendedException. We could keep this "flag" internally in SnapshotProcedure and use it to define what SnapshotProcedure.holdLock() returns.

This forces you to manage additional state at each stage though, which I why I opted for this implementation which I thought was safer

True. Yet, it seems more intuitive to me. But that's a personal opinion, just wanted to make sure it was also considered. Up to you to decide on the "final" solution. If going with the original, just please amend the comment in holdLock to explain the scenario where we release the lock.

TableState tableState =
env.getMasterServices().getTableStateManager().getTableState(snapshotTable);
if (tableState.isEnabled()) {
SnapshotDescriptionUtils.writeSnapshotInfo(snapshot, workingDir, workingDirFS);

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Move inside the if statements to avoid unnecessary I/O in case we need to suspend

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@charlesconnell

Copy link
Copy Markdown
Contributor

Another option, which is simpler to reason about, is to simply fail the SnapshotProcedure if the table isn't in a state it can handle. This was my approach in HBASE-29315, for the exact same reasons you're encountering here. I couldn't usefully "sleep" a SplitTableRegionProcedure because it used holdLock=true. I think it would be good to agree on a standard of what to do in these situations.

Failing a procedure is simpler and doesn't introduce more edge cases in the procedure executor state machine. However, obviously, it's a better user experience if your procedures get executed eventually.

@hgromer

hgromer commented Jun 10, 2025

Copy link
Copy Markdown
ContributorAuthor

Another option, which is simpler to reason about, is to simply fail the SnapshotProcedure if the table isn't in a state it can handle. This was my approach in HBASE-29315, for the exact same reasons you're encountering here. I couldn't usefully "sleep" a SplitTableRegionProcedure because it used holdLock=true. I think it would be good to agree on a standard of what to do in these situations.

Failing a procedure is simpler and doesn't introduce more edge cases in the procedure executor state machine. However, obviously, it's a better user experience if your procedures get executed eventually.

Agreed. The reason I opted for supsending the procedure is because this is already something we do if we are splitting or merging regions. So this procedure will already suspend and resume in the case the table state isn't optimal.

I don't think I have a very strong opinion one way or another, though. Enabling/disabling tables happens often enough that it might be fine to simply fail and force the user to manually handle the failure.

cc @Apache9 Don't know if you have any strong opinions here either way.

@rmdmattingly

Copy link
Copy Markdown
Contributor

Enabling/disabling tables happens often enough that it might be fine to simply fail and force the user to manually handle the failure.

Do you mean "happens often infrequently enough"? If so, I agree that snapshotting a disabled table should be a pretty exceptional request, and so it is fine to err on the side of simplicity and just fail the procedure

@hgromer

Copy link
Copy Markdown
ContributorAuthor

Enabling/disabling tables happens often enough that it might be fine to simply fail and force the user to manually handle the failure.

Do you mean "happens often infrequently enough"? If so, I agree that snapshotting a disabled table should be a pretty exceptional request, and so it is fine to err on the side of simplicity and just fail the procedure

Yes I did; I am happy to fail the procedure if that's the general consensus. That being said, I do think modern backups start to stress this system out. Any call to the BackupAdmin triggers an enable table procedure, so we're more likely to get into this state.

If we are okay with failing, then the user will have to manually kick off another snapshot on failure.

Another possible solution would be to reset the state of the snapshot procedure, so that it needs to run from the beginning

if (tableState.isEnabled()) {
// action 
} elseif (tableState.isDisabled) {
// action
} else {
// set up suspension timeout/persistencesetNextState(SnapshotState.SNAPSHOT_PREPARE);
}

@hgromer

Copy link
Copy Markdown
ContributorAuthor

going to proceed with the strategy of simply failing

@Apache-HBase

This comment has been minimized.

@charlesconnellcharlesconnell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When implementing this SnapshotProcedure, we decided to use shared lock and holdLock = true to prevent other table procedure jumps in in the middle of our execution while not hurting the availability because exclusive lock will also prevent region assigning.

In HBASE-28683, we introduced a new way to only allow one procedure to run at the same time for the same table, so maybe a possible way is to make SnapshotProcedure also acquire exclusive lock and set holdLock = false, so it will not be executed at the same time with Enable and Disable procedure.

Thanks.

setNextState(SnapshotState.SNAPSHOT_SNAPSHOT_CLOSED_REGIONS);
} else {
setState(ProcedureState.FAILED);
throw new ProcedureAbortedException(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just use setFailure and then return Flow.NO_MORE_STATE.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Will do, thank you for the suggestion

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@hgromer

Copy link
Copy Markdown
ContributorAuthor

When implementing this SnapshotProcedure, we decided to use shared lock and holdLock = true to prevent other table procedure jumps in in the middle of our execution while not hurting the availability because exclusive lock will also prevent region assigning.

In HBASE-28683, we introduced a new way to only allow one procedure to run at the same time for the same table, so maybe a possible way is to make SnapshotProcedure also acquire exclusive lock and set holdLock = false, so it will not be executed at the same time with Enable and Disable procedure.

Thanks.

That's good to know, thank you for the context. The issue here is that the EnableTableProcedure will release the lock after it's subprocedures finish, which allows the SnapshotProcedure to execute on a table that is enabling. The SnapshotProcedure then gets stuck continuously re-running the same state over again, and will refuse to release the lock, creating a deadlock

With all this said, I think it makes the most sense, for simplicity's sake, to fail the procedure if the table is in an invalid state.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 31sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall3m 9smaster passed
+1 💚compile0m 54smaster passed
+1 💚javadoc0m 28smaster passed
+1 💚shadedjars5m 50sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile0m 54sthe patch passed
+1 💚javac0m 54sthe patch passed
+1 💚javadoc0m 26sthe patch passed
+1 💚shadedjars5m 44spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit225m 9shbase-server in the patch passed.
250m 42s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7084/10/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#7084
JIRA IssueHBASE-29386
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 21852ab9c1d1 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 2c3f6bd
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7084/10/testReport/
Max. process+thread count4450 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7084/10/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@hgromer

Copy link
Copy Markdown
ContributorAuthor

@Apache9 I think this PR is good to go, please let me know if you think everything makes sense!

() -> procExec.getProcedure(mergeProcId).getState() == ProcedureState.RUNNABLE);
SnapshotProcedure sp = new SnapshotProcedure(procExec.getEnvironment(), snapshotProto);
long snapshotProcId = procExec.submitProcedure(sp);
TEST_UTIL.waitFor(2000, 1000, () -> procExec.getProcedure(snapshotProcId) != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mind explaining a bit why we need to remove the WAITING_TIMEOUT state check?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Sure; the SnapshotProcedure will never reach the state where it is running at the same time that the merge procedures are running because it will now require an exclusive locks of the table to run. So when we kick off the SnapshotProcedure, it will sit in the TableProcedureWaitingQueue as RUNNABLE before being scheduled. Therefore, this code path will never be executed. We can clean this code up too if we'd like

@rmdmattingly
rmdmattingly merged commit 9eb51c6 into apache:masterJun 26, 2025
rmdmattingly pushed a commit that referenced this pull request Jun 26, 2025
…adlock (#7084)
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
rmdmattingly pushed a commit that referenced this pull request Jun 26, 2025
…adlock (#7084)
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
rmdmattingly pushed a commit that referenced this pull request Jun 26, 2025
…adlock (#7084)
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
rmdmattingly added a commit that referenced this pull request Jun 27, 2025
…adlock (#7084) (#7121)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
rmdmattingly added a commit that referenced this pull request Jun 27, 2025
…adlock (#7084) (#7122)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
rmdmattingly added a commit that referenced this pull request Jun 27, 2025
…adlock (#7084) (#7123)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Jun 27, 2025
…adlock (apache#7084) (apache#7123)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
@hgromer

Copy link
Copy Markdown
ContributorAuthor

I think we need to revert this PR. This change can cause another deadlock, which can interfere with server crash procedures.

The SCP acquires a server exclusive lock, so it can run in parallel to a snapshot procedure. However the SCP will schedule SplitWALRemoteProcedure which do acquire table locks. The SplitWALRemoteProcedure won't run until the snapshot procedure finishes, however the snapshot procedure will get stuck at state SNAPSHOT_SNAPSHOT_SPLIT_REGIONS waiting for the server to go online.

2025-07-01T15:23:20,413 [PEWorker-2] WARN org.apache.hadoop.hbase.master.procedure.SnapshotRegionProcedure: pid=2365228, ppid=2365224, state=RUNNABLE, locked=true; SnapshotRegionProcedure 91f810e77abe57ea0791ea6e86ada219 can not run currently because target server of region migrate-test-1,\x7F\xFF\xFF\xFE,1751380484623.91f810e77abe57ea0791ea6e86ada219. na1-elegant-jaded-egg.iad03.hubinternal.net,60020,1751300917328 is in state SPLITTING, wait 600000 ms to retry

This puts us in a state where the children of the SCP will never finish, which means the SCP will never finish, which also blocks the snapshot procedure from finishing.

@Apache9

Copy link
Copy Markdown
Contributor

The holdLock is false for SnapshotProcedure, so unless it is blocked while execution, it will release the table lock when it can not go on. So I do not think it is the root cause for your problem.

And why SplitWALRemoteProcedure requires table locks? I haven't seen any table lock related code in SplitWALRemoteProcedure.

And the log you provided is not about SCP, it says the region is SPLITTING?

I think you have messed up SplitWALRemoteProcedure and SnapshotRegionProcedure?

Thanks.

@hgromer

hgromer commented Jul 1, 2025

Copy link
Copy Markdown
ContributorAuthor

I may have conflated the locking behavior of StateMachineProcedure and AbstractStateMachineTableProcedure, which is why I thought the SplitWALRemoteProcedure acquired a table lock. Taking a deeper look and will report back

@Apache9

Copy link
Copy Markdown
Contributor

Any updates here?

It is a bit strange that, we should have check in both SnapshotProcedure and SplitTableTableProcedure/MergeTableRegionsProcedure, to prevent they execute concurrently. So why you can see a region in SPLITTING state while executing SnapshotProcedure?

@hgromer

Copy link
Copy Markdown
ContributorAuthor

The log line indicates that the server is in a SPLITTING state, not the region. The SnapshotProcedure will check here if the target server is online and suspend the procedure if it isn't.

We were in a tricky scenario where a test cluster was trying to run various SCP, and those SCP were essentially blocking the SnapshotProcedure. I had though the SnapshotProcedure was preventing the SCP from proceeding, but it turns out SCP was failing when running a SplitWALRemoteProcedure due to memory issues

hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster 2025-07-01T17:01:38,573 [KeepAlivePEWorker-15] WARN org.apache.hadoop.hbase.master.procedure.SplitWALRemoteProcedure: Failed split of hdfs://sandbox-hb2-a-qa:8020/hbase/WALs/na1-broad-grand-falcon.iad03.hubinternal.net,60020,1751299239767-splitting/na1-broad-grand-falcon.iad03.hubinternal.net%2C60020%2C1751299239767.1751381096903, retry...
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster org.apache.hadoop.hbase.procedure2.RemoteProcedureException: java.lang.Exception: Cannot reserve 262144 bytes of direct buffer memory (allocated: 1879042125, limit: 1879048192)
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.procedure2.RemoteProcedureException.fromProto(RemoteProcedureException.java:123) ~[hbase-procedure-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.master.MasterRpcServices.lambda$reportProcedureDone$4(MasterRpcServices.java:2573) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at java.util.ArrayList.forEach(ArrayList.java:1596) ~[?:?]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1116) ~[?:?]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.master.MasterRpcServices.reportProcedureDone(MasterRpcServices.java:2568) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos$RegionServerStatusService$2.callBlockingMethod(RegionServerStatusProtos.java:16726) ~[hbase-protocol-shaded-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:443) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:105) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:85) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster Caused by: java.lang.Exception: Cannot reserve 262144 bytes of direct buffer memory (allocated: 1879042125, limit: 1879048192)
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at java.nio.Bits.reserveMemory(Bits.java:178) ~[?:?]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:111) ~[?:?]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:360) ~[?:?]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.io.compress.zstd.ZstdDecompressor.<init>(ZstdDecompressor.java:46) ~[hbase-compression-zstd-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.io.compress.zstd.ZstdCodec.createDecompressor(ZstdCodec.java:94) ~[hbase-compression-zstd-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.io.compress.CodecPool.getDecompressor(CodecPool.java:166) ~[hbase-common-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.io.compress.Compression$Algorithm.getDecompressor(Compression.java:487) ~[hbase-common-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.wal.CompressionContext$ValueCompressor.decompress(CompressionContext.java:119) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.wal.WALCellCodec$CompressedKvDecoder.readCompressedValue(WALCellCodec.java:385) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.wal.WALCellCodec$CompressedKvDecoder.parseCell(WALCellCodec.java:336) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.codec.BaseDecoder.advance(BaseDecoder.java:66) ~[hbase-common-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.wal.WALEdit.readFromCells(WALEdit.java:281) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.wal.ProtobufWALStreamReader.next(ProtobufWALStreamReader.java:84) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.wal.WALStreamReader.next(WALStreamReader.java:42) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.wal.WALSplitter.getNextLogLine(WALSplitter.java:490) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.wal.WALSplitter.splitWAL(WALSplitter.java:319) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.wal.WALSplitter.splitLogFile(WALSplitter.java:200) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.SplitLogWorker.splitLog(SplitLogWorker.java:108) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.SplitWALCallable.doCall(SplitWALCallable.java:86) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.procedure2.BaseRSProcedureCallable.call(BaseRSProcedureCallable.java:35) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.procedure2.BaseRSProcedureCallable.call(BaseRSProcedureCallable.java:23) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.regionserver.handler.RSProcedureHandler.process(RSProcedureHandler.java:56) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]
hmaster-sandbox-hb2-a-1-557d64787b-9cgkh hmaster at org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:104) ~[hbase-server-2.6-hubspot-SNAPSHOT.jar:2.6-hubspot-SNAPSHOT]

I'm still attempting to track down exactly, the entire host's memory was being eaten up by RecoveredEditsOutputSink#append. We did have a disproportionately high number of regions per host on the cluster, which likely was the cause.

Importantly, the SnapshotProcedure was not the cause of these stuck SCP

@Apache9

Copy link
Copy Markdown
Contributor

Your direct memory limit is 1.75GB, which seems too small? What is your heap size? If you enable off heap blockcache and off heap memstore, you need to configure a higher direct memory limitation, which may be greater than your heap size.

@Apache9

Copy link
Copy Markdown
Contributor

Anyway, seems we are good to close this issue and go with the 2.6.3 release.

Thanks guys!

@hgromer

Copy link
Copy Markdown
ContributorAuthor

Yes, we were running on very small instance types. A test ran awry, which caused us to run into memory issues.

Thank you for jumping in here, and apologies for the back and forth

mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…adlock (apache#7084) (apache#7122)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
hgromer added a commit to HubSpot/hbase that referenced this pull request Aug 14, 2025
…adlock (apache#7084) (apache#7122)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Hernan Romer <nanug33@gmail.com>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
hgromer added a commit to HubSpot/hbase that referenced this pull request Aug 15, 2025
…adlock (apache#7084) (apache#7122) (#195)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Ray Mattingly <rmattingly@apache.org>
Signed-off-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@apache.org>
Co-authored-by: Hernan Gelaf-Romer <hgelafromer@hubspot.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@hgromer@Apache-HBase@charlesconnell@rmdmattingly@Apache9@wchevreuil