mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-06 13:02:55 +00:00
refactor(pageserver): propagate RequestContext to layer downloads (#11001)
For some reason the layer download API never fully got `RequestContext`-infected. This PR fixes that as a precursor to - https://github.com/neondatabase/neon/issues/6107
This commit is contained in:
committed by
GitHub
parent
c92a36740b
commit
f09843ef17
@@ -307,7 +307,7 @@ where
|
||||
let mut layer_ids: Vec<LayerId> = Vec::new();
|
||||
for layer_id in &job.input_layers {
|
||||
let layer = &self.layers[layer_id.0].layer;
|
||||
if let Some(dl) = self.executor.downcast_delta_layer(layer).await? {
|
||||
if let Some(dl) = self.executor.downcast_delta_layer(layer, ctx).await? {
|
||||
deltas.push(dl.clone());
|
||||
layer_ids.push(*layer_id);
|
||||
}
|
||||
@@ -536,7 +536,7 @@ where
|
||||
let mut deltas: Vec<E::DeltaLayer> = Vec::new();
|
||||
for layer_id in &job.input_layers {
|
||||
let l = &self.layers[layer_id.0];
|
||||
if let Some(dl) = self.executor.downcast_delta_layer(&l.layer).await? {
|
||||
if let Some(dl) = self.executor.downcast_delta_layer(&l.layer, ctx).await? {
|
||||
deltas.push(dl.clone());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ pub trait CompactionJobExecutor {
|
||||
fn downcast_delta_layer(
|
||||
&self,
|
||||
layer: &Self::Layer,
|
||||
ctx: &Self::RequestContext,
|
||||
) -> impl Future<Output = anyhow::Result<Option<Self::DeltaLayer>>> + Send;
|
||||
|
||||
// ----
|
||||
|
||||
@@ -487,6 +487,7 @@ impl interface::CompactionJobExecutor for MockTimeline {
|
||||
async fn downcast_delta_layer(
|
||||
&self,
|
||||
layer: &MockLayer,
|
||||
_ctx: &MockRequestContext,
|
||||
) -> anyhow::Result<Option<Arc<MockDeltaLayer>>> {
|
||||
Ok(match layer {
|
||||
MockLayer::Delta(l) => Some(l.clone()),
|
||||
|
||||
Reference in New Issue
Block a user