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

Add PageHeader::unmodified_hash, a BLAKE3 hash for snapshotting #1249

Merged
merged 1 commit into from
May 20, 2024

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 17, 2024

Description of Changes

Fixes #1244.

API and ABI breaking changes

None

Expected complexity level and risk

2

Testing

Tests are amended to cover clearing the hash and whatnot.

@Centril Centril requested a review from gefjon May 17, 2024 20:46
Comment on lines +1651 to +1657
// Hash the `FixedHeader`, first copy out the fixed part save for the bitset into an array.
let fixed = &self.header.fixed;
let mut fixed_bytes = [0u8; 6];
fixed_bytes[0..2].copy_from_slice(&fixed.next_free.next.0.to_le_bytes());
fixed_bytes[2..4].copy_from_slice(&fixed.last.0.to_le_bytes());
fixed_bytes[4..6].copy_from_slice(&fixed.num_rows.to_le_bytes());
hasher.update(&fixed_bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, neat, this is a smart way to do this.

@gefjon
Copy link
Contributor

gefjon commented May 20, 2024

Testing locally under miri, then will merge.

@gefjon
Copy link
Contributor

gefjon commented May 20, 2024

Miri tests passed; merging.

@gefjon gefjon added this pull request to the merge queue May 20, 2024
Merged via the queue into master with commit 91f7e8c May 20, 2024
7 checks passed
@Centril Centril deleted the centril/page_unmodified_hash branch May 20, 2024 18:05
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.

Implement page dirty marks.
2 participants