Skip to content

Commit

Permalink
[ISSUE #6904] Fix fail to start broker if mapped file size is 0 (#6903)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuz10 committed Jun 22, 2023
1 parent 1f0cdc8 commit 4e09a9c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
boolean ok = file.delete();
log.warn("{} size is 0, auto delete. is_ok: {}", file, ok);
continue;
}

if (file.length() != this.mappedFileSize) {
log.warn(file + "\t" + file.length()
+ " length not matched message store config value, please check it manually");
Expand Down

0 comments on commit 4e09a9c

Please sign in to comment.