Skip to content

Commit

Permalink
HBASE-28058 Adjust the order of acquiring the takeSnapshot locks to r…
Browse files Browse the repository at this point in the history
……esolve the deadlock issue. (apache#5381)

Co-authored-by: lvhaiping.lhp <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Pankaj Kumar <[email protected]>
(cherry picked from commit d43e682)
  • Loading branch information
hiping-tech authored and wchevreuil committed Nov 2, 2023
1 parent 3d0d515 commit f6fdda0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ public void takeSnapshot(SnapshotDescription snapshot) throws IOException {
}
}

public synchronized long takeSnapshot(SnapshotDescription snapshot, long nonceGroup, long nonce)
public long takeSnapshot(SnapshotDescription snapshot, long nonceGroup, long nonce)
throws IOException {
this.takingSnapshotLock.readLock().lock();
try {
Expand All @@ -680,8 +680,8 @@ public synchronized long takeSnapshot(SnapshotDescription snapshot, long nonceGr
}
}

private long submitSnapshotProcedure(SnapshotDescription snapshot, long nonceGroup, long nonce)
throws IOException {
private synchronized long submitSnapshotProcedure(SnapshotDescription snapshot, long nonceGroup,
long nonce) throws IOException {
return MasterProcedureUtil
.submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(master, nonceGroup, nonce) {
@Override
Expand Down

0 comments on commit f6fdda0

Please sign in to comment.