Skip to content

Commit 82de07c

Browse files
authored
HADOOP-17142. Fix outdated properties of JournalNode when performing rollback. Contributed by Deegue.
1 parent 2522bf2 commit 82de07c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JNStorage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ void format(NamespaceInfo nsInfo, boolean force) throws IOException {
236236

237237
void analyzeStorage() throws IOException {
238238
this.state = sd.analyzeStorage(StartupOption.REGULAR, this);
239+
refreshStorage();
240+
}
241+
242+
void refreshStorage() throws IOException {
239243
if (state == StorageState.NORMAL) {
240244
readProperties(sd);
241245
}

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,8 @@ public synchronized void doRollback() throws IOException {
11781178
// directory will be renamed. It will be reopened lazily on next access.
11791179
IOUtils.cleanupWithLogger(LOG, committedTxnId);
11801180
storage.getJournalManager().doRollback();
1181+
// HADOOP-17142: refresh properties after rollback performed.
1182+
storage.refreshStorage();
11811183
}
11821184

11831185
synchronized void discardSegments(long startTxId) throws IOException {

0 commit comments

Comments
 (0)