Skip to content

Commit

Permalink
agent: Make migration 14 more specific and robust
Browse files Browse the repository at this point in the history
- Only effect subgraphs assigned to node = 'removed'
  • Loading branch information
fordN committed Aug 23, 2024
1 parent 79227d8 commit ed18006
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Logger } from '@graphprotocol/common-ts'
import {
GraphNode,
specification,
SubgraphDeploymentAssignment,
SubgraphStatus,
} from '@graphprotocol/indexer-common'
import { QueryInterface } from 'sequelize'
Expand Down Expand Up @@ -38,9 +39,15 @@ export async function up({ context }: Context): Promise<void> {
return nodeA.deployments.length - nodeB.deployments.length
})[0]?.id || 'default'

const virtuallyPausedDeploymentAssignments =
const pausedDeploymentAssignments =
await graphNode.subgraphDeploymentsAssignments(SubgraphStatus.PAUSED)

const virtuallyPausedDeploymentAssignments =
pausedDeploymentAssignments.filter(
(assignment: SubgraphDeploymentAssignment) =>
assignment.node === 'removed',
)

logger.info(
'Reassigning paused subgraphs to valid node_id (targetNode), then pausing',
{
Expand Down

0 comments on commit ed18006

Please sign in to comment.