Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions crates/table/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,8 +1837,16 @@ impl Page {
/// The reset page supports `max_rows_in_page` at most.
pub fn reset_for(&mut self, max_rows_in_page: usize) {
self.header.reset_for(max_rows_in_page);
// SAFETY: We just reset the page header.
unsafe { self.zero_data() };

// NOTE(centril): We previously zeroed pages when resetting.
// This had an adverse performance impact.
// The reason why we previously zeroed was for security under a multi-tenant setup
// when exposing a module ABI that allows modules to memcpy whole pages over.
// However, we have no such ABI for the time being, so we can soundly avoid zeroing.
// If we ever decide to add such an ABI, we must start zeroing again.
//
// // SAFETY: We just reset the page header.
// unsafe { self.zero_data() };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do not need to zero pages as long as the pages aren't shared between modules. If the page pool is specific to a single tenant, we're okay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's true, but in our current setup, we do share pages between modules.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The page pool is very much global right now. We don't currently expose pages' raw bytes to customers, as we don't expose a way to download snapshots nor have a raw page ABI for modules. We would like to do both of those things in the future, though, and so we'll need to either revert this change, or make it configurable. I'll make a ticket.

}

/// Sets the header and the row data.
Expand Down
Loading