add missing repair-on-read for k2v range reads

This commit is contained in:
Armaël Guéneau
2026-05-13 18:52:18 +02:00
committed by Alex
parent 555e0826a2
commit a159c1c483
3 changed files with 31 additions and 9 deletions
+2
View File
@@ -114,6 +114,7 @@ async fn handle_read_batch_query(
query.limit,
Some(filter),
EnumerationOrder::from_reverse(query.reverse),
monotonic_read,
)
.await?;
@@ -222,6 +223,7 @@ async fn handle_delete_batch_query(
None,
Some(filter),
EnumerationOrder::Forward,
K2VMonotonicRead::NonMonotonic,
)
.await?;
assert!(!more);
+2
View File
@@ -4,6 +4,7 @@ use serde::Serialize;
use garage_table::util::*;
use garage_model::k2v::item_table::{BYTES, CONFLICTS, ENTRIES, VALUES};
use garage_model::k2v::rpc::K2VMonotonicRead;
use garage_api_common::helpers::*;
@@ -40,6 +41,7 @@ pub async fn handle_read_index(
limit,
Some((DeletedFilter::NotDeleted, node_id_vec)),
EnumerationOrder::from_reverse(reverse),
K2VMonotonicRead::NonMonotonic,
)
.await?;
+20 -2
View File
@@ -4,6 +4,8 @@
use std::sync::Arc;
use garage_model::k2v::rpc::K2VMonotonicRead;
use garage_table::replication::TableShardedReplication;
use garage_table::*;
@@ -23,6 +25,7 @@ pub(crate) async fn read_range<F>(
limit: Option<u64>,
filter: Option<F::Filter>,
enumeration_order: EnumerationOrder,
monotonic_read: K2VMonotonicRead,
) -> Result<(Vec<F::E>, bool, Option<String>), Error>
where
F: TableSchema<S = String> + 'static,
@@ -53,7 +56,20 @@ where
1000,
limit.map(|x| x as usize).unwrap_or(usize::MAX - 10) - entries.len() + 2,
);
let get_ret = table
let get_ret = match monotonic_read {
K2VMonotonicRead::Monotonic => {
table
.get_range_monotonic(
partition_key,
start.clone(),
filter.clone(),
n_get,
enumeration_order,
)
.await?
}
K2VMonotonicRead::NonMonotonic => {
table
.get_range(
partition_key,
start.clone(),
@@ -61,7 +77,9 @@ where
n_get,
enumeration_order,
)
.await?;
.await?
}
};
let get_ret_len = get_ret.len();