mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-23 16:10:37 +00:00
@@ -193,9 +193,9 @@ impl BlobWriter {
|
||||
|
||||
const CAPACITY: usize = 64 * 1024;
|
||||
|
||||
/// Writes the given buffer directly to the underlying `VirtualFile`.
|
||||
/// You need to make sure that the internal buffer is empty, otherwise
|
||||
/// data will be written in wrong order.
|
||||
// /// Writes the given buffer directly to the underlying `VirtualFile`.
|
||||
// /// You need to make sure that the internal buffer is empty, otherwise
|
||||
// /// data will be written in wrong order.
|
||||
// #[inline(always)]
|
||||
// async fn write_all_unbuffered<Buf: IoBuf + Send>(
|
||||
// &mut self,
|
||||
@@ -244,7 +244,6 @@ impl BlobWriter {
|
||||
.await
|
||||
.map(|len| {
|
||||
self.offset += len as u64;
|
||||
()
|
||||
});
|
||||
|
||||
(src_buf, res)
|
||||
|
||||
@@ -165,6 +165,7 @@ pub struct SplitImageLayerWriter {
|
||||
}
|
||||
|
||||
impl SplitImageLayerWriter {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn new(
|
||||
conf: &'static PageServerConf,
|
||||
timeline_id: TimelineId,
|
||||
@@ -183,7 +184,7 @@ impl SplitImageLayerWriter {
|
||||
tenant_shard_id,
|
||||
&(start_key..Key::MAX),
|
||||
lsn,
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?,
|
||||
@@ -216,7 +217,7 @@ impl SplitImageLayerWriter {
|
||||
self.tenant_shard_id,
|
||||
&(key..Key::MAX),
|
||||
self.lsn,
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
@@ -323,7 +324,7 @@ impl SplitDeltaLayerWriter {
|
||||
self.tenant_shard_id,
|
||||
key,
|
||||
self.lsn_range.clone(),
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?,
|
||||
@@ -342,7 +343,7 @@ impl SplitDeltaLayerWriter {
|
||||
self.tenant_shard_id,
|
||||
key,
|
||||
self.lsn_range.clone(),
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -423,7 +423,7 @@ impl DeltaLayerWriterInner {
|
||||
let file = Arc::new(VirtualFile::create(&path, ctx).await?);
|
||||
|
||||
// Start at PAGE_SZ, make room for the header block
|
||||
let blob_writer = BlobWriter::new(file, PAGE_SZ as u64, &gate, ctx)?;
|
||||
let blob_writer = BlobWriter::new(file, PAGE_SZ as u64, gate, ctx)?;
|
||||
|
||||
// Initialize the b-tree index builder
|
||||
let block_buf = BlockBuf::new();
|
||||
|
||||
@@ -771,7 +771,7 @@ impl ImageLayerWriterInner {
|
||||
};
|
||||
|
||||
// Start at `PAGE_SZ` to make room for the header block.
|
||||
let blob_writer = BlobWriter::new(file, PAGE_SZ as u64, &gate, ctx)?;
|
||||
let blob_writer = BlobWriter::new(file, PAGE_SZ as u64, gate, ctx)?;
|
||||
|
||||
// Initialize the b-tree index builder
|
||||
let block_buf = BlockBuf::new();
|
||||
@@ -996,7 +996,7 @@ impl ImageLayerWriter {
|
||||
tenant_shard_id,
|
||||
key_range,
|
||||
lsn,
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?,
|
||||
|
||||
@@ -758,7 +758,7 @@ impl InMemoryLayer {
|
||||
self.tenant_shard_id,
|
||||
Key::MIN,
|
||||
self.start_lsn..end_lsn,
|
||||
&gate,
|
||||
gate,
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -154,30 +154,30 @@ impl KeyHistoryRetention {
|
||||
};
|
||||
stat.produce_image_key(img);
|
||||
if let Some(image_writer) = image_writer.as_mut() {
|
||||
image_writer.put_image(key, img.clone(), &gate, ctx).await?;
|
||||
image_writer.put_image(key, img.clone(), gate, ctx).await?;
|
||||
} else {
|
||||
delta_writer
|
||||
.put_value(key, cutoff_lsn, Value::Image(img.clone()), &gate, ctx)
|
||||
.put_value(key, cutoff_lsn, Value::Image(img.clone()), gate, ctx)
|
||||
.await?;
|
||||
}
|
||||
} else {
|
||||
for (lsn, val) in logs {
|
||||
stat.produce_key(&val);
|
||||
delta_writer.put_value(key, lsn, val, &gate, ctx).await?;
|
||||
delta_writer.put_value(key, lsn, val, gate, ctx).await?;
|
||||
}
|
||||
}
|
||||
first_batch = false;
|
||||
} else {
|
||||
for (lsn, val) in logs {
|
||||
stat.produce_key(&val);
|
||||
delta_writer.put_value(key, lsn, val, &gate, ctx).await?;
|
||||
delta_writer.put_value(key, lsn, val, gate, ctx).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
let KeyLogAtLsn(above_horizon_logs) = self.above_horizon;
|
||||
for (lsn, val) in above_horizon_logs {
|
||||
stat.produce_key(&val);
|
||||
delta_writer.put_value(key, lsn, val, &gate, ctx).await?;
|
||||
delta_writer.put_value(key, lsn, val, gate, ctx).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -61,10 +61,6 @@ impl<const A: usize> RawAlignedBuffer<ConstAlign<A>> {
|
||||
align,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn const_align() -> usize {
|
||||
A
|
||||
}
|
||||
}
|
||||
|
||||
impl<A: Alignment> RawAlignedBuffer<A> {
|
||||
|
||||
Reference in New Issue
Block a user