Skip to content

Commit

Permalink
Use correct store when loading indexes for graft base (#5616)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
encalypto authored Aug 28, 2024
1 parent e2e6925 commit 9a51f3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion store/postgres/src/subgraph_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,12 @@ impl SubgraphStoreInner {

let index_def = if let Some(graft) = &graft_base.clone() {
if let Some(site) = self.sites.get(graft) {
Some(deployment_store.load_indexes(site)?)
let store = self
.stores
.get(&site.shard)
.ok_or_else(|| StoreError::UnknownShard(site.shard.to_string()))?;

Some(store.load_indexes(site)?)
} else {
None
}
Expand Down

0 comments on commit 9a51f3b

Please sign in to comment.