This is an automated email from the ASF dual-hosted git repository.
chenhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 8357e4b00f [log] Add journal file path that caused failure in
multi-journal config (#3623)
8357e4b00f is described below
commit 8357e4b00f0b2244dbe7648302dd02d930e5ecb7
Author: Rajan Dhabalia <[email protected]>
AuthorDate: Tue Nov 8 17:08:59 2022 -0800
[log] Add journal file path that caused failure in multi-journal config
(#3623)
### Motivation
Right now, if bookie fails to replay the journal then it logs
journal-txn-id but it doesn't log journal dir path. It will be useful if bookie
prints journal path along with journal-dir in case if user is using
multi-journal directories so, user can troubleshoot the issue and fix it
correctly.
```
2022-11-07T18:29:07,205+0000 [main] ERROR
org.apache.bookkeeper.bookie.Bookie - Exception while replaying journals,
shutting down
java.io.IOException: Recovery log 1667603421612 is missing
at org.apache.bookkeeper.bookie.Bookie.replay(Bookie.java:932)
~[org.apache.bookkeeper-bookkeeper-server-4.12.jar:4.12]
at org.apache.bookkeeper.bookie.Bookie.readJournal(Bookie.java:911)
~[org.apache.bookkeeper-bookkeeper-server-4.12.jar]
```
### Changes
Add journal dir file path in journal replay failure.
---
.../src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
index 5822fecc10..8f2a65dad8 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
@@ -617,7 +617,8 @@ public class BookieImpl extends BookieCriticalThread
implements Bookie {
// validate filtered log ids only when we have markedLogId
if (markedLog.getLogFileId() > 0) {
if (logs.size() == 0 || logs.get(0) != markedLog.getLogFileId()) {
- throw new IOException("Recovery log " +
markedLog.getLogFileId() + " is missing");
+ String path = journal.getJournalDirectory().getAbsolutePath();
+ throw new IOException("Recovery log " +
markedLog.getLogFileId() + " is missing at " + path);
}
}