Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -1151,6 +1151,10 @@ EntryLogMetadata extractEntryLogMetadataFromIndex(long entryLogId) throws IOExce
+ " -- found: " + meta.getLedgersMap().size() + " -- entryLogId: " + entryLogId);
}

if (header.ledgersCount == 0) {
throw new IOException("No ledgers map found in entryLogId " + entryLogId + ", do scan to double confirm");
}

return meta;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class EntryLoggerAllocator {
// within the same JVM. All of these Bookie instances access this header
// so there can be race conditions when entry logs are rolled over and
// this header buffer is cleared before writing it into the new logChannel.
logfileHeader.setZero(0, DefaultEntryLogger.LOGFILE_HEADER_SIZE);
logfileHeader.writeBytes("BKLO".getBytes(UTF_8));
logfileHeader.writeInt(DefaultEntryLogger.HEADER_CURRENT_VERSION);
logfileHeader.writerIndex(DefaultEntryLogger.LOGFILE_HEADER_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,12 @@ protected void extractMetaFromEntryLogs() throws EntryLogMetadataMapException {
continue;
}

LOG.info("Extracting entry log meta from entryLogId: {}", entryLogId);

try {
// Read through the entry log file and extract the entry log meta
EntryLogMetadata entryLogMeta = entryLogger.getEntryLogMetadata(entryLogId, throttler);
LOG.info("Extracted entry log meta from entryLogId: {}, ledgers {}",
entryLogId, entryLogMeta.getLedgersMap().keys());
removeIfLedgerNotExists(entryLogMeta);
if (entryLogMeta.isEmpty()) {
// This means the entry log is not associated with any active
Expand Down
Loading