mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-24 20:53:00 +00:00
rename IoConcurrency::{todo=>serial} and remove deprecation warning
This commit is contained in:
@@ -209,7 +209,7 @@ impl Timeline {
|
||||
.get_rel_page_at_lsn_batched(
|
||||
pages.iter().map(|(tag, blknum)| (tag, blknum)),
|
||||
effective_lsn,
|
||||
IoConcurrency::todo(),
|
||||
IoConcurrency::serial(),
|
||||
ctx,
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -6639,7 +6639,7 @@ mod tests {
|
||||
.get_vectored_impl(
|
||||
aux_keyspace.clone(),
|
||||
read_lsn,
|
||||
&mut ValuesReconstructState::new(IoConcurrency::todo()),
|
||||
&mut ValuesReconstructState::new(IoConcurrency::serial()),
|
||||
&ctx,
|
||||
)
|
||||
.await;
|
||||
@@ -6787,7 +6787,7 @@ mod tests {
|
||||
.get_vectored_impl(
|
||||
read.clone(),
|
||||
current_lsn,
|
||||
&mut ValuesReconstructState::new(IoConcurrency::todo()),
|
||||
&mut ValuesReconstructState::new(IoConcurrency::serial()),
|
||||
&ctx,
|
||||
)
|
||||
.await?;
|
||||
@@ -6922,7 +6922,7 @@ mod tests {
|
||||
ranges: vec![child_gap_at_key..child_gap_at_key.next()],
|
||||
},
|
||||
query_lsn,
|
||||
&mut ValuesReconstructState::new(IoConcurrency::todo()),
|
||||
&mut ValuesReconstructState::new(IoConcurrency::serial()),
|
||||
&ctx,
|
||||
)
|
||||
.await;
|
||||
@@ -7421,7 +7421,7 @@ mod tests {
|
||||
.get_vectored_impl(
|
||||
keyspace.clone(),
|
||||
lsn,
|
||||
&mut ValuesReconstructState::new(IoConcurrency::todo()),
|
||||
&mut ValuesReconstructState::new(IoConcurrency::serial()),
|
||||
&ctx,
|
||||
)
|
||||
.await?
|
||||
@@ -7611,7 +7611,7 @@ mod tests {
|
||||
lsn: Lsn,
|
||||
ctx: &RequestContext,
|
||||
) -> anyhow::Result<(BTreeMap<Key, Result<Bytes, PageReconstructError>>, usize)> {
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
let res = tline
|
||||
.get_vectored_impl(keyspace.clone(), lsn, &mut reconstruct_state, ctx)
|
||||
.await?;
|
||||
@@ -7900,7 +7900,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// test vectored scan on parent timeline
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
let res = tline
|
||||
.get_vectored_impl(
|
||||
KeySpace::single(Key::metadata_key_range()),
|
||||
@@ -7926,7 +7926,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// test vectored scan on child timeline
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
let res = child
|
||||
.get_vectored_impl(
|
||||
KeySpace::single(Key::metadata_key_range()),
|
||||
@@ -7964,7 +7964,7 @@ mod tests {
|
||||
lsn: Lsn,
|
||||
ctx: &RequestContext,
|
||||
) -> Result<Option<Bytes>, GetVectoredError> {
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
let mut res = tline
|
||||
.get_vectored_impl(
|
||||
KeySpace::single(key..key.next()),
|
||||
@@ -10056,7 +10056,7 @@ mod tests {
|
||||
|
||||
let keyspace = KeySpace::single(get_key(0)..get_key(10));
|
||||
let results = tline
|
||||
.get_vectored(keyspace, delta_layer_end_lsn, IoConcurrency::todo(), &ctx)
|
||||
.get_vectored(keyspace, delta_layer_end_lsn, IoConcurrency::serial(), &ctx)
|
||||
.await
|
||||
.expect("No vectored errors");
|
||||
for (key, res) in results {
|
||||
|
||||
@@ -203,9 +203,10 @@ impl std::fmt::Debug for SelectedIoConcurrency {
|
||||
}
|
||||
|
||||
impl IoConcurrency {
|
||||
#[deprecated]
|
||||
pub(crate) fn todo() -> Self {
|
||||
// To test futuresunordered, we can create a gate guard here and Box::leak it
|
||||
/// TODO: over time, work towards removing this method.
|
||||
/// Requires finding a long-lived root for the IoConcurrency and funneling it through
|
||||
/// to the place that does the get_values_reconstruct_data call.
|
||||
pub(crate) fn serial() -> Self {
|
||||
Self::spawn(SelectedIoConcurrency::Serial)
|
||||
}
|
||||
pub(crate) fn spawn_from_env(gate_guard: GateGuard) -> IoConcurrency {
|
||||
|
||||
@@ -58,7 +58,7 @@ async fn smoke_test() {
|
||||
};
|
||||
|
||||
let img_before = {
|
||||
let mut data = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut data = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
layer
|
||||
.get_values_reconstruct_data(
|
||||
controlfile_keyspace.clone(),
|
||||
@@ -93,7 +93,7 @@ async fn smoke_test() {
|
||||
|
||||
// on accesses when the layer is evicted, it will automatically be downloaded.
|
||||
let img_after = {
|
||||
let mut data = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut data = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
layer
|
||||
.get_values_reconstruct_data(
|
||||
controlfile_keyspace.clone(),
|
||||
|
||||
@@ -1001,7 +1001,7 @@ impl Timeline {
|
||||
ranges: vec![key..key.next()],
|
||||
};
|
||||
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
|
||||
let vectored_res = self
|
||||
.get_vectored_impl(keyspace.clone(), lsn, &mut reconstruct_state, ctx)
|
||||
@@ -1135,7 +1135,7 @@ impl Timeline {
|
||||
.get_vectored_impl(
|
||||
keyspace.clone(),
|
||||
lsn,
|
||||
&mut ValuesReconstructState::new(IoConcurrency::todo()),
|
||||
&mut ValuesReconstructState::new(IoConcurrency::serial()),
|
||||
ctx,
|
||||
)
|
||||
.await;
|
||||
@@ -4174,7 +4174,7 @@ impl Timeline {
|
||||
.get_vectored(
|
||||
key_request_accum.consume_keyspace(),
|
||||
lsn,
|
||||
IoConcurrency::todo(),
|
||||
IoConcurrency::serial(),
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
@@ -4257,7 +4257,7 @@ impl Timeline {
|
||||
start: Key,
|
||||
) -> Result<ImageLayerCreationOutcome, CreateImageLayersError> {
|
||||
// Metadata keys image layer creation.
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_state = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
let begin = Instant::now();
|
||||
let data = self
|
||||
.get_vectored_impl(partition.clone(), lsn, &mut reconstruct_state, ctx)
|
||||
@@ -5757,7 +5757,7 @@ impl Timeline {
|
||||
for layer in guard.layer_map()?.iter_historic_layers() {
|
||||
if !layer.is_delta() && layer.image_layer_lsn() == lsn {
|
||||
let layer = guard.get_from_desc(&layer);
|
||||
let mut reconstruct_data = ValuesReconstructState::new(IoConcurrency::todo());
|
||||
let mut reconstruct_data = ValuesReconstructState::new(IoConcurrency::serial());
|
||||
layer
|
||||
.get_values_reconstruct_data(
|
||||
KeySpace::single(Key::MIN..Key::MAX),
|
||||
|
||||
Reference in New Issue
Block a user