Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ private void doCheckpoint(boolean sendCheckpoint) throws InterruptedException, I
// Acquire cpLock to make sure no one is modifying the name system.
// It does not need the full namesystem write lock, since the only thing
// that modifies namesystem on standby node is edit log replaying.
// checkpoint是namespace的一个快照,所以在dump快照的时候需要锁,避免修改namespace的内容,
// 这也是checkpoint要在snn上执行的一个原因
namesystem.cpLockInterruptibly();
try {
assert namesystem.getEditLog().isOpenForRead() :
Expand Down Expand Up @@ -265,8 +267,8 @@ public TransferFsImage.TransferResult call()
//Update only when response from remote about success or
lastUploadTime = monotonicNow();
// we are primary if we successfully updated the ANN
this.isPrimaryCheckPointer = success;
}
this.isPrimaryCheckPointer = success;
// cleaner than copying code for multiple catch statements and better than catching all
// exceptions, so we just handle the ones we expect.
if (ie != null || ioe != null) {
Expand Down