[
https://issues.apache.org/jira/browse/BOOKKEEPER-251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272285#comment-13272285
]
Sijie Guo commented on BOOKKEEPER-251:
--------------------------------------
@Ivan, I would change isLogExisted to logExists.
@Flavio,
before the patch, extractMetaFromEntryLogs would scan entry log files from 0,
if the log file has been scanned but not deleted, it would skip scanning. but
if the log file has been garbage collected, it is not in entryLogMetaMap. it
would be scanned again, so it would hit try-catch block to print the error
message.
the patch did two things:
1) it would check the log file existed or not before proceeding scanning the
file. if the log file is not existed, it means that the log file is garbage
collected. we skip it. actually I don't think we need to keep a list of garbage
collected entry logs, since the non-existed entry log file might be garbage
collected before.
2) it records the last entry log id that we have scanned, so we don't need to
start from zero again. just improve 1) to avoid checking the existence of entry
log file again and again.
After applying this patch, the message only occurred when failed to scan an
entry log due to IOException. it might be due to data corruption in that entry
log file. I think the log message is OK, but if you have a better one to
suggest, it would be great to change it.
> Noise error message printed when scanning entry log files those have been
> garbage collected.
> --------------------------------------------------------------------------------------------
>
> Key: BOOKKEEPER-251
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-251
> Project: Bookkeeper
> Issue Type: Improvement
> Components: bookkeeper-server
> Affects Versions: 4.1.0
> Reporter: Sijie Guo
> Assignee: Sijie Guo
> Fix For: 4.1.0
>
> Attachments: BK-251.diff
>
>
> currently, due to the messy scan mechanism deployed by garbage collector
> thread. following noise error message would be printed when scanning those
> entry log files has been garbage collected.
> {quote}
> 2012-05-09 15:58:52,742 - INFO
> [GarbageCollectorThread:GarbageCollectorThread@466] - Extracting entry log
> meta from entryLogId: 0
> 2012-05-09 15:58:52,743 - WARN [GarbageCollectorThread:EntryLogger@386] -
> Failed to get channel to scan entry log: 0.log
> 2012-05-09 15:58:52,743 - WARN
> [GarbageCollectorThread:GarbageCollectorThread@473] - Premature exception
> when processing 0recovery will take care of the problem
> java.io.FileNotFoundException: No file for log 0
> at
> org.apache.bookkeeper.bookie.EntryLogger.findFile(EntryLogger.java:366)
> at
> org.apache.bookkeeper.bookie.EntryLogger.getChannelForLogId(EntryLogger.java:340)
> at
> org.apache.bookkeeper.bookie.EntryLogger.scanEntryLog(EntryLogger.java:384)
> at
> org.apache.bookkeeper.bookie.GarbageCollectorThread.extractMetaFromEntryLog(GarbageCollectorThread.java:485)
> at
> org.apache.bookkeeper.bookie.GarbageCollectorThread.extractMetaFromEntryLogs(GarbageCollectorThread.java:470)
> at
> org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:189)
> {quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira