fix(startup + remote_timeline_client): no-op deletion ops scheduled during startup (#6825)

Before this PR, if remote storage is configured, `load_layer_map`'s call
to `RemoteTimelineClient::schedule_layer_file_deletion` would schedule
an empty UploadOp::Delete for each timeline.

It's jsut CPU overhead, no actual interaction with deletion queue
on-disk state or S3, as far as I can tell.

However, it shows up in the "RemoteTimelineClient calls started
metrics", which I'm refining in an orthogonal PR.
This commit is contained in:
Christian Schwarz
2024-02-20 14:06:25 +01:00
committed by GitHub
parent 21a86487a2
commit a48b23d777

View File

@@ -823,6 +823,10 @@ impl RemoteTimelineClient {
}
// schedule the actual deletions
if with_metadata.is_empty() {
// avoid scheduling the op & bumping the metric
return;
}
let op = UploadOp::Delete(Delete {
layers: with_metadata,
});