Update append_frames_vectored to use new encryption_ctx and apply review

This commit is contained in:
PThorpe92
2025-08-25 09:50:57 -04:00
parent daea841b47
commit 37a7ec7477
2 changed files with 9 additions and 4 deletions

View File

@@ -1291,7 +1291,12 @@ impl Pager {
if !pages.is_empty() {
let c = wal
.borrow_mut()
.append_frames_vectored(pages, page_sz, commit_frame)?;
.append_frames_vectored(pages, page_sz, commit_frame)
.inspect_err(|_| {
for c in completions.iter() {
c.abort();
}
})?;
completions.push(c);
}
Ok(completions)

View File

@@ -1442,9 +1442,9 @@ impl Wal for WalFile {
let plain = page.get_contents().as_ptr();
let data_to_write: std::borrow::Cow<[u8]> = {
let key = self.encryption_key.borrow();
if let Some(k) = key.as_ref() {
Cow::Owned(encrypt_page(plain, page_id as usize, k)?)
let ectx = self.encryption_ctx.borrow();
if let Some(ctx) = ectx.as_ref() {
Cow::Owned(ctx.encrypt_page(plain, page_id as usize)?)
} else {
Cow::Borrowed(plain)
}