Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,41 @@ async fn list_runner_config_enabled_dcs_inner(
ctx: &OperationCtx,
input: &Input,
) -> Result<Vec<u16>> {
futures_util::stream::iter(ctx.config().topology().datacenters.clone())
.map(|dc| async move {
let runner_config_key = keys::runner_config::GlobalDataKey::new(
dc.datacenter_label,
input.namespace_id,
input.runner_name.clone(),
);
let res = ctx
.op(epoxy::ops::kv::get_optimistic::Input {
replica_id: ctx.config().epoxy_replica_id(),
key: namespace::keys::subspace().pack(&runner_config_key),
caching_behavior: CachingBehavior::Optimistic,
target_replicas: None,
save_empty: true,
})
.await;
Ok(
futures_util::stream::iter(ctx.config().topology().datacenters.clone())
.map(|dc| async move {
let runner_config_key = keys::runner_config::GlobalDataKey::new(
dc.datacenter_label,
input.namespace_id,
input.runner_name.clone(),
);
let res = ctx
.op(epoxy::ops::kv::get_optimistic::Input {
replica_id: ctx.config().epoxy_replica_id(),
key: namespace::keys::subspace().pack(&runner_config_key),
caching_behavior: CachingBehavior::Optimistic,
target_replicas: None,
save_empty: true,
})
.await;

match res {
Ok(res) => res.value.map(|_| dc.datacenter_label),
Err(err) => {
tracing::warn!(
?err,
namespace_id=?input.namespace_id,
runner_name=%input.runner_name,
dc_label=dc.datacenter_label,
"failed to read runner config from dc"
);
None
match res {
Ok(res) => res.value.map(|_| dc.datacenter_label),
Err(err) => {
tracing::warn!(
?err,
namespace_id=?input.namespace_id,
runner_name=%input.runner_name,
dc_label=dc.datacenter_label,
"failed to read runner config from dc"
);
None
}
}
}
})
.buffer_unordered(512)
.filter_map(std::future::ready)
.collect::<Vec<_>>()
.await
})
.buffer_unordered(512)
.filter_map(std::future::ready)
.collect::<Vec<_>>()
.await,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ async fn backfill_chunk(ctx: &ActivityCtx, input: &BackfillChunkInput) -> Result
};

new_last_key = [entry.key(), &[0xff]].concat();
if let Ok((_, (_, _, leaf))) =
if let Ok((_, _, leaf)) =
runner_config_subspace.unpack::<(Id, String, usize)>(entry.key())
{
if leaf == keys::runner_config::PROTOCOL_VERSION {
if leaf == universaldb::utils::keys::PROTOCOL_VERSION {
continue;
}
}
Expand Down
Loading