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. (#5381)

Co-authored-by: lvhaiping.lhp <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Pankaj Kumar <[email protected]>
  • Loading branch information
hiping-tech and lvhaiping.lhp authored Sep 13, 2023
1 parent 05449bd commit d43e682
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 d43e682

Please sign in to comment.