fix: check rotate_segment return value; use uint32_t for CRC fields

- In persist_wal_async(), check rotate_segment() return value and propagate -EIO on failure (MEDIUM)
- Change last_crc and last_replicated_crc fields from uint64_t to uint32_t to match CRC32 width (LOW)

Both fixes address code review issues in commit b0a5fbb.
This commit is contained in:
Rongsong Shen 2026-05-07 10:04:43 +00:00
parent b0a5fbb4e9
commit 1fe79ff934
2 changed files with 8 additions and 4 deletions

View file

@ -89,8 +89,8 @@ struct persist_s {
/* WAL state */
int wal_fd;
uint64_t current_lsn;
uint64_t last_crc;
uint64_t last_replicated_crc;
uint32_t last_crc;
uint32_t last_replicated_crc;
uint64_t term;
uint32_t seg_offset;
uint64_t checkpoint_lsn;