scrubber: fix parsing issue with Azure (#9797)

Apparently Azure returns timelines ending with `/` which confuses the
parsing. So remove all trailing `/`s before attempting to parse.

Part of https://github.com/neondatabase/cloud/issues/19963
This commit is contained in:
Arpad Müller
2024-11-19 20:10:53 +01:00
committed by GitHub
parent 5e3fbef721
commit b092126c94

View File

@@ -60,7 +60,7 @@ pub async fn stream_tenant_shards<'a>(
first_part
.parse::<TenantShardId>()
.with_context(|| format!("Incorrect entry id str: {first_part}"))
.with_context(|| format!("Incorrect tenant entry id str: {first_part}"))
})
.collect::<Vec<_>>();
@@ -114,9 +114,10 @@ pub async fn stream_tenant_timelines<'a>(
prefix.get_path().as_str().strip_prefix(prefix_str)
})
.map(|entry_id_str| {
entry_id_str
let first_part = entry_id_str.split('/').next().unwrap();
first_part
.parse::<TimelineId>()
.with_context(|| format!("Incorrect entry id str: {entry_id_str}"))
.with_context(|| format!("Incorrect timeline entry id str: {entry_id_str}"))
});
for i in new_entry_ids {