Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove problematic debug assertions #2010

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Nov 25, 2024

Description of Changes

The definition of FixedHeader within Page previously contained a #[cfg(debug_assertions)] member which was used for some extra assertions. This was fine originally, but now that we write pages to disk in snapshots, having the serialized format of the page vary depending on compilation profile is problematic.

This commit removes said #[cfg(debug_assertions)] conditional member from FixedHeader, so that the structure, and thus the on-disk format, of Page is consistent between debug and release builds.

This commit also removes an unrelated but unused #[cfg(debug_assertions)] conditional from the pointer map code. We never called this assertion, even in debug builds. If we want to re-enable it in the future, we can restore it from git history; for now, I would prefer not to have unused code committed.

API and ABI breaking changes

...Technically kinda, since on-disk artifacts generated by debug builds will now use a different format? But I would consider this a bug fix, not a breakage. We don't release debug builds or use them in prod, so no "real" data will be broken.

Expected complexity level and risk

1

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

None yet.

  • @mamcx was able to load a release-mode snapshot with a debug-mode host.

The definition of `FixedHeader` within `Page` previously contained
a `#[cfg(debug_assertions)]` member which was used for some extra assertions.
This was fine originally, but now that we write pages to disk in snapshots,
having the serialized format of the page vary depending on compilation profile
is problematic.

This commit removes said `#[cfg(debug_assertions)]` conditional member from `FixedHeader`,
so that the structure, and thus the on-disk format, of `Page` is consistent
between debug and release builds.

This commit also removes an unrelated but unused `#[cfg(debug_assertions)]` conditional
from the pointer map code. We never called this assertion, even in debug builds.
If we want to re-enable it in the future, we can restore it from git history;
for now, I would prefer not to have unused code committed.
@gefjon gefjon requested review from Centril and mamcx November 25, 2024 18:28
@gefjon gefjon added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit 8075567 Nov 26, 2024
10 checks passed
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