HADOOP-17142. Fix outdated properties of JournalNode when performing rollback. Contributed by Deegue.
(cherry picked from commit82de07c794
) (cherry picked from commit12bfd9194a
)
This commit is contained in:
parent
4af5f55623
commit
52c2ce53c2
|
@ -236,6 +236,10 @@ class JNStorage extends Storage {
|
||||||
|
|
||||||
void analyzeStorage() throws IOException {
|
void analyzeStorage() throws IOException {
|
||||||
this.state = sd.analyzeStorage(StartupOption.REGULAR, this);
|
this.state = sd.analyzeStorage(StartupOption.REGULAR, this);
|
||||||
|
refreshStorage();
|
||||||
|
}
|
||||||
|
|
||||||
|
void refreshStorage() throws IOException {
|
||||||
if (state == StorageState.NORMAL) {
|
if (state == StorageState.NORMAL) {
|
||||||
readProperties(sd);
|
readProperties(sd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1178,6 +1178,8 @@ public class Journal implements Closeable {
|
||||||
// directory will be renamed. It will be reopened lazily on next access.
|
// directory will be renamed. It will be reopened lazily on next access.
|
||||||
IOUtils.cleanupWithLogger(LOG, committedTxnId);
|
IOUtils.cleanupWithLogger(LOG, committedTxnId);
|
||||||
storage.getJournalManager().doRollback();
|
storage.getJournalManager().doRollback();
|
||||||
|
// HADOOP-17142: refresh properties after rollback performed.
|
||||||
|
storage.refreshStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void discardSegments(long startTxId) throws IOException {
|
synchronized void discardSegments(long startTxId) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue