mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-20 06:30:43 +00:00
review: create follow-up issue for changing BlockBuf::blocks
https://github.com/neondatabase/neon/pull/10063/files#r1880401785 Signed-off-by: Yuchen Liang <yuchen@neon.tech>
This commit is contained in:
@@ -117,6 +117,8 @@ impl From<&DeltaLayer> for Summary {
|
||||
impl Summary {
|
||||
/// Serializes the summary header into an aligned buffer of lenth `PAGE_SZ`.
|
||||
pub fn ser_into_page(&self) -> Result<IoBuffer, SerializeError> {
|
||||
let mut buf = bytes::BytesMut::with_capacity(PAGE_SZ);
|
||||
Self::ser_into(&self, &mut buf);
|
||||
let mut buf = IoBufferMut::with_capacity(PAGE_SZ);
|
||||
Self::ser_into(&self, &mut buf)?;
|
||||
// Pad zeroes to the buffer so the length is a multiple of the alignment.
|
||||
|
||||
@@ -887,9 +887,11 @@ impl ImageLayerWriterInner {
|
||||
let file = self.blob_writer.into_inner(ctx).await?;
|
||||
|
||||
// Write out the index
|
||||
// TODO(yuchen): should we just replace BlockBuf::blocks with one big buffer?
|
||||
let mut offset = index_start_blk as u64 * PAGE_SZ as u64;
|
||||
let (index_root_blk, block_buf) = self.tree.finish()?;
|
||||
|
||||
// TODO(yuchen): https://github.com/neondatabase/neon/issues/10092
|
||||
// Should we just replace BlockBuf::blocks with one big buffer?
|
||||
for buf in block_buf.blocks {
|
||||
let (_buf, res) = file.write_all_at(buf.slice_len(), offset, ctx).await;
|
||||
res?;
|
||||
|
||||
Reference in New Issue
Block a user