fix layer download during reconcile_with_remote

reconcile_with_remote, in this PR, is supposed to download all the layer
files synchronously.
I don't know why, but, download_missing was

1. not doing the download at all for DeltaLayer
2. not using the right RelativePath for image layer

This patch fixes both.
This commit is contained in:
Christian Schwarz
2022-11-14 10:50:01 -05:00
committed by Dmitry Rodionov
parent f4daa877b5
commit 027cf22663

View File

@@ -1014,7 +1014,7 @@ impl Timeline {
});
// Are we missing some files that are present in remote storage?
// Create RemoteLayers to represent them, and add to the layer map
// Download them now.
// TODO Downloading many files this way is not efficient.
// Better to use FuturesUnordered. Maybe keep as is because:
// a) inplace download is a throw-away code, on-demand patch doesnt need that
@@ -1041,14 +1041,9 @@ impl Timeline {
}
remote_client
.download_layer_file(
&RelativePath::from_local_path(
&self.conf.timeline_path(&self.timeline_id, &self.tenant_id),
path,
)?,
&layer_metadata,
)
.await?;
.download_layer_file(&RelativePath::from_filename(path), &layer_metadata)
.await
.context("download image layer")?;
let image_layer =
ImageLayer::new(self.conf, self.timeline_id, self.tenant_id, &imgfilename);
@@ -1073,6 +1068,11 @@ impl Timeline {
continue;
}
remote_client
.download_layer_file(&RelativePath::from_filename(path), &layer_metadata)
.await
.context("download delta layer")?;
let delta_layer =
DeltaLayer::new(self.conf, self.timeline_id, self.tenant_id, &deltafilename);