lizhimins commented on code in PR #6903:
URL: https://github.com/apache/rocketmq/pull/6903#discussion_r1230464345
##########
store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java:
##########
@@ -247,11 +247,18 @@ public boolean doLoad(List<File> files) {
// ascending order
files.sort(Comparator.comparing(File::getName));
- for (File file : files) {
+ for (int i = 0; i < files.size(); i++) {
+ File file = files.get(i);
if (file.isDirectory()) {
continue;
}
+ if (file.length() == 0 && i == files.size() - 1) {
Review Comment:
We should investigate why there are files with a length of 0. Is it caused
by pre-allocation or file switching?
If any file has a length of zero, it can be considered as damaged, Not only
the last one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]