Skip to content

Commit

Permalink
fix(store): Fix cross shard grafting
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens committed Oct 4, 2022
1 parent 35db8fa commit 5994e64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions store/postgres/src/deployment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,23 +1305,20 @@ impl DeploymentStore {
&self,
logger: &Logger,
site: Arc<Site>,
graft_src: Option<(Arc<Layout>, BlockPtr)>,
graft_src: Option<(Arc<Layout>, BlockPtr, SubgraphDeploymentEntity)>,
) -> Result<(), StoreError> {
let dst = self.find_layout(site.cheap_clone())?;

// If `graft_src` is `Some`, then there is a pending graft.
if let Some((src, block)) = graft_src {
if let Some((src, block, src_deployment)) = graft_src {
info!(
logger,
"Initializing graft by copying data from {} to {}",
src.catalog.site.namespace,
dst.catalog.site.namespace
);

let src_manifest_idx_and_name = self
.load_deployment(&src.site)?
.manifest
.template_idx_and_name()?;
let src_manifest_idx_and_name = src_deployment.manifest.template_idx_and_name()?;
let dst_manifest_idx_and_name = self
.load_deployment(&dst.site)?
.manifest
Expand Down
3 changes: 2 additions & 1 deletion store/postgres/src/writable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ impl SyncStore {
let graft_base = match self.writable.graft_pending(&self.site.deployment)? {
Some((base_id, base_ptr)) => {
let src = self.store.layout(&base_id)?;
Some((src, base_ptr))
let deployment_entity = self.writable.load_deployment(&src.site)?;
Some((src, base_ptr, deployment_entity))
}
None => None,
};
Expand Down

0 comments on commit 5994e64

Please sign in to comment.