Skip to content

Fix wal api ffi#2128

Merged
sivukhin merged 3 commits intomainfrom
fix-wal-api-ffi
Jul 14, 2025
Merged

Fix wal api ffi#2128
sivukhin merged 3 commits intomainfrom
fix-wal-api-ffi

Conversation

@sivukhin
Copy link
Copy Markdown
Contributor

@sivukhin sivukhin commented Jul 14, 2025

Basically, right now, embedded replica will fail if WAL reached size of more than 4120 frame (familiar number, huh?).

The issue is that in the Rust API we pass frame.len() as a frame_no and 0 as a frame.len() 🤪
The failure happens because wal_insert C code will check frame for conflict in case when if (iFrame <= mxFrame) and then try to allocate nBuf - 24 bytes (where nBuf equals to 0 due to bug)

This PR fixes this bug and also added simple test to check the API.

@sivukhin sivukhin added this pull request to the merge queue Jul 14, 2025
Merged via the queue into main with commit 864a029 Jul 14, 2025
19 checks passed
@sivukhin sivukhin deleted the fix-wal-api-ffi branch July 14, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants