NanoLog
NanoLog copied to clipboard
Fix decompression failures for compressed logs under O_DIRECT direct write mode
When compressing log files in the mode of direct write to O-DIECT, there may be a problem of log compression errors that cannot be correctly decompressed. The issue was fixed by modifying the padding.
Problem
The original code erroneously placed a 512-byte padding area at the front of the buffer. This overwrote the data structures written at the front, leading to file corruption and failure in decompression.
Solution
Move the 512-byte padding area to the end of the buffer instead of the front.
Impact
This fixes the file corruption issue and ensures correct decompression.