HDFS-7042. Upgrade fails for Windows HA cluster due to file locks held during rename in JournalNode. Contributed by Chris Nauroth.
(cherry picked from commit 80ac6aabcea9f808fd55504cdaef2da7b50da7f1)
This commit is contained in:
parent
6f8b2a8e2e
commit
ac296f9522
@ -493,6 +493,9 @@ Release 2.6.0 - UNRELEASED
|
||||
HDFS-6776. Using distcp to copy data between insecure and secure cluster via webdhfs
|
||||
doesn't work. (yzhangal via tucu)
|
||||
|
||||
HDFS-7042. Upgrade fails for Windows HA cluster due to file locks held during
|
||||
rename in JournalNode. (cnauroth)
|
||||
|
||||
Release 2.5.1 - UNRELEASED
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -994,6 +994,9 @@ synchronized void discardSegments(long startTxId) throws IOException {
|
||||
}
|
||||
|
||||
public synchronized void doPreUpgrade() throws IOException {
|
||||
// Do not hold file lock on committedTxnId, because the containing
|
||||
// directory will be renamed. It will be reopened lazily on next access.
|
||||
committedTxnId.close();
|
||||
storage.getJournalManager().doPreUpgrade();
|
||||
}
|
||||
|
||||
@ -1043,7 +1046,10 @@ public Boolean canRollBack(StorageInfo storage, StorageInfo prevStorage,
|
||||
targetLayoutVersion);
|
||||
}
|
||||
|
||||
public void doRollback() throws IOException {
|
||||
public synchronized void doRollback() throws IOException {
|
||||
// Do not hold file lock on committedTxnId, because the containing
|
||||
// directory will be renamed. It will be reopened lazily on next access.
|
||||
committedTxnId.close();
|
||||
storage.getJournalManager().doRollback();
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,7 @@ private void lazyOpen() throws IOException {
|
||||
public void close() throws IOException {
|
||||
if (ch != null) {
|
||||
ch.close();
|
||||
ch = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user