Repository navigation
fix(dpm): Handle case where big record cannot be stored on single page with RHDE header, but with RHD it can be stored - #9244
Open
TreeHunter9 wants to merge 2 commits into
Conversation
added 2 commits
October 26, 2026 18:02
…e with RHDE header, but with RHD it can be stored
hvlad
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem happens when record length is between
page_size - (sizeof(data_page) + RHDE_SIZE)andpage_size - (sizeof(data_page) + RHD_SIZE). It means record has transaction number >32bits and it doesn't fit on the page with RHDE header, so we need to split the record on fragments. The tail fragment happens to be all record size due to usage of RHD header, so in head we write no data at all.This case currently lead to overflow on
size -= length;, which can cause the program to crash due to corrupted while loop.I also looked at the codebase to find possible problems with record headers and found that gstat was missing some checks for record flags. I fixed that as well.
The main bug presented in v3 and v4.
In v5 and v6 there is no such problem due to differences in
store_big_recordimplementation of taking the tail, but gstat is still affected, so I will create a separate PR for these versions.