Skip to content

Commit

Permalink
[ISSUE #8409] Fix tiered storage roll file logic if committing the la…
Browse files Browse the repository at this point in the history
…st part of a file failed (#8410)

Co-authored-by: zhaoyuhan <zhaoyuhan@xiaomi.com>
  • Loading branch information
bxfjb and bxfjb authored Jul 23, 2024
1 parent 0e56d87 commit 6fb455a
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@ public AppendResult append(ByteBuffer buffer, long timestamp) {
FileSegment fileSegment = this.getFileToWrite();
result = fileSegment.append(buffer, timestamp);
if (result == AppendResult.FILE_FULL) {
fileSegment.commitAsync().join();
return this.rollingNewFile(this.getAppendOffset()).append(buffer, timestamp);
boolean commitResult = fileSegment.commitAsync().join();
log.info("FlatAppendFile#append not successful for the file {} is full, commit result={}",
fileSegment.getPath(), commitResult);
if (commitResult) {
return this.rollingNewFile(this.getAppendOffset()).append(buffer, timestamp);
} else {
return AppendResult.UNKNOWN_ERROR;
}
}
} finally {
fileSegmentLock.writeLock().unlock();
Expand Down

0 comments on commit 6fb455a

Please sign in to comment.