Skip to content

Commit 9a51f3b

Browse files
authored
Use correct store when loading indexes for graft base (#5616)
Previously, we were trying to load indexes from the store corresponding to the subgraph being deployed. This was the wrong shard, resulting in deployment failures when a subgraph is on a different shard from its graft based. This updates the call to use the correct store.
1 parent e2e6925 commit 9a51f3b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

store/postgres/src/subgraph_store.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,12 @@ impl SubgraphStoreInner {
579579

580580
let index_def = if let Some(graft) = &graft_base.clone() {
581581
if let Some(site) = self.sites.get(graft) {
582-
Some(deployment_store.load_indexes(site)?)
582+
let store = self
583+
.stores
584+
.get(&site.shard)
585+
.ok_or_else(|| StoreError::UnknownShard(site.shard.to_string()))?;
586+
587+
Some(store.load_indexes(site)?)
583588
} else {
584589
None
585590
}

0 commit comments

Comments
 (0)