1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Calculate the correct file offset when zeroing the unused tail.
This commit is contained in:
Marko Mäkelä
2026-10-09 13:20:54 +03:00
parent a91c9cb6ab
commit e0ae58b3f7

View File

@@ -909,7 +909,8 @@ public:
using tpool::pwrite;
#endif
/* Zero out the garbage part of the last log block. */
const uint64_t offset{last - ctx.first_lsn + log_sys.START_OFFSET};
const uint64_t offset{last - tracked.first_lsn +
log_sys.START_OFFSET};
const size_t o{size_t(offset) & bs_1}, s{bs_1 + 1 - o};
if (o &&
ssize_t(s) != pwrite(ctx.log_dst, field_ref_zero, s, offset))