This commit is contained in:
John Spray
2023-08-30 10:37:06 +01:00
parent 4492d40c37
commit f77aa463c6
5 changed files with 7 additions and 10 deletions

View File

@@ -288,7 +288,7 @@ impl<'de> Deserialize<'de> for TenantTimelineId {
D: serde::Deserializer<'de>,
{
let str = String::deserialize(deserializer)?;
if let Some((tenant_part, timeline_part)) = str.split_once("/") {
if let Some((tenant_part, timeline_part)) = str.split_once('/') {
Ok(Self {
tenant_id: TenantId(Id::from_hex(tenant_part).map_err(|e| {
serde::de::Error::custom(format!("Malformed tenant in TenantTimelineId: {e}"))

View File

@@ -166,7 +166,7 @@ impl DeletionList {
return;
}
let key = TenantTimelineId::new(tenant.clone(), timeline.clone());
let key = TenantTimelineId::new(*tenant, *timeline);
let entry = self
.objects
.entry(key)
@@ -179,8 +179,7 @@ impl DeletionList {
fn take_paths(&mut self) -> Vec<RemotePath> {
self.objects
.drain()
.map(|(_k, v)| v.objects.into_iter())
.flatten()
.flat_map(|(_k, v)| v.objects.into_iter())
.collect()
}
}

View File

@@ -52,7 +52,7 @@ impl ExecutorWorker {
DELETION_QUEUE_ERRORS
.with_label_values(&["failpoint"])
.inc();
return Err(anyhow::anyhow!("failpoint hit"));
Err(anyhow::anyhow!("failpoint hit"))
});
self.remote_storage.delete_objects(&self.accumulator).await

View File

@@ -830,11 +830,9 @@ impl RemoteTimelineClient {
.into_iter()
.map(|l| {
let local_path = timeline_path.join(l.file_name());
let remote_path = self
.conf
self.conf
.remote_path(&local_path)
.expect("Timeline path should always convert to remote");
remote_path
.expect("Timeline path should always convert to remote")
})
.collect();
deletion_queue.push_immediate(layer_paths).await?;

View File

@@ -1775,7 +1775,7 @@ impl Timeline {
for (layer, m) in needs_upload {
rtc.schedule_layer_file_upload(&layer.layer_desc().filename(), &m)?;
}
rtc.schedule_layer_file_deletion(&needs_cleanup, &deletion_queue_client)
rtc.schedule_layer_file_deletion(&needs_cleanup, deletion_queue_client)
.await?;
rtc.schedule_index_upload_for_file_changes()?;
// Tenant::create_timeline will wait for these uploads to happen before returning, or