From 3297fa9ae82161911ed0b1b0f12094b08f5a5d60 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Mon, 11 Nov 2024 14:00:37 -0800 Subject: [PATCH] all: release-0.21.7 bump, paused migration fix --- docs/networks/arbitrum-sepolia.md | 4 ++-- lerna.json | 2 +- packages/indexer-agent/package.json | 4 ++-- .../14-use-new-deployment-pause-mechanism.ts | 13 +++++++++---- packages/indexer-cli/package.json | 4 ++-- packages/indexer-common/package.json | 2 +- packages/indexer-service/package.json | 4 ++-- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/networks/arbitrum-sepolia.md b/docs/networks/arbitrum-sepolia.md index 14c010454..b94159e72 100644 --- a/docs/networks/arbitrum-sepolia.md +++ b/docs/networks/arbitrum-sepolia.md @@ -7,8 +7,8 @@ The Graph Network's testnet is on Arbitrum Sepolia (eip155:421614). Sepolia netw | Component | Release | | ------------------ | ------------------------------------------------------------------------------------ | | contracts | [5.3.3](https://github.com/graphprotocol/contracts/releases/tag/v5.3.3) | -| indexer-agent | [0.21.6-2](https://github.com/graphprotocol/indexer/releases/tag/v0.21.6-2) | -| indexer-cli | [0.21.6-2](https://github.com/graphprotocol/indexer/releases/tag/v0.21.6-2) | +| indexer-agent | [0.21.7](https://github.com/graphprotocol/indexer/releases/tag/v0.21.7) | +| indexer-cli | [0.21.7](https://github.com/graphprotocol/indexer/releases/tag/v0.21.7) | | indexer-service-rs | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) | | tap-agent | [1.0.0](https://github.com/graphprotocol/indexer-rs/releases/tag/v1.0.0) | | graph-node | [0.35.1](https://github.com/graphprotocol/graph-node/releases/tag/v0.35.1) | diff --git a/lerna.json b/lerna.json index bff2576e3..3b5ee92d5 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.21.6-2" + "version": "0.21.7" } diff --git a/packages/indexer-agent/package.json b/packages/indexer-agent/package.json index 03337bd80..acf7e1b53 100644 --- a/packages/indexer-agent/package.json +++ b/packages/indexer-agent/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/indexer-agent", - "version": "0.21.6-2", + "version": "0.21.7", "description": "Indexer agent", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -30,7 +30,7 @@ }, "dependencies": { "@graphprotocol/common-ts": "2.0.11", - "@graphprotocol/indexer-common": "^0.21.6-2", + "@graphprotocol/indexer-common": "^0.21.7", "@thi.ng/heaps": "^1.3.1", "@uniswap/sdk": "3.0.3", "axios": "0.26.1", diff --git a/packages/indexer-agent/src/db/migrations/14-use-new-deployment-pause-mechanism.ts b/packages/indexer-agent/src/db/migrations/14-use-new-deployment-pause-mechanism.ts index e4886f645..6d8d7e737 100644 --- a/packages/indexer-agent/src/db/migrations/14-use-new-deployment-pause-mechanism.ts +++ b/packages/indexer-agent/src/db/migrations/14-use-new-deployment-pause-mechanism.ts @@ -34,11 +34,15 @@ export async function up({ context }: Context): Promise { indexNodes, }) - const targetNode = + const specifiedTargetNode = process.env.INDEXER_PAUSED_TARGET_NODE + const leastDeploymentsNode = indexNodes.sort((nodeA, nodeB) => { return nodeA.deployments.length - nodeB.deployments.length })[0]?.id || 'default' + // If the target node is specified, use it. Otherwise, use the node with the least deployments + const targetNode = specifiedTargetNode || leastDeploymentsNode + const pausedDeploymentAssignments = await graphNode.subgraphDeploymentsAssignments(SubgraphStatus.PAUSED) @@ -49,7 +53,7 @@ export async function up({ context }: Context): Promise { ) logger.info( - 'Reassigning paused subgraphs to valid node_id (targetNode), then pausing', + 'Pausing subgraphs, then reassigning them to valid node_id (targetNode)', { pausedSubgraphs: virtuallyPausedDeploymentAssignments.map( details => details.id, @@ -59,9 +63,10 @@ export async function up({ context }: Context): Promise { ) for (const deploymentAssignment of virtuallyPausedDeploymentAssignments) { - await graphNode.reassign(deploymentAssignment.id, targetNode) + // Here we first pause the subgraph to ensure it does not start indexing await graphNode.pause(deploymentAssignment.id) - logger.debug('Successfully reassigned and paused deployment', { + await graphNode.reassign(deploymentAssignment.id, targetNode) + logger.debug('Successfully paused and reassigned deployment', { deployment: deploymentAssignment.id.ipfsHash, }) } diff --git a/packages/indexer-cli/package.json b/packages/indexer-cli/package.json index 0809c562e..61f989529 100644 --- a/packages/indexer-cli/package.json +++ b/packages/indexer-cli/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/indexer-cli", - "version": "0.21.6-2", + "version": "0.21.7", "description": "Indexer CLI for The Graph Network", "main": "./dist/cli.js", "files": [ @@ -27,7 +27,7 @@ }, "dependencies": { "@graphprotocol/common-ts": "2.0.11", - "@graphprotocol/indexer-common": "^0.21.6-2", + "@graphprotocol/indexer-common": "^0.21.7", "@iarna/toml": "2.2.5", "@thi.ng/iterators": "5.1.74", "@urql/core": "3.1.0", diff --git a/packages/indexer-common/package.json b/packages/indexer-common/package.json index eaa64fe2e..f23c714cb 100644 --- a/packages/indexer-common/package.json +++ b/packages/indexer-common/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/indexer-common", - "version": "0.21.6-2", + "version": "0.21.7", "description": "Common library for Graph Protocol indexer components", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/indexer-service/package.json b/packages/indexer-service/package.json index dc0ec995c..b133c6c44 100644 --- a/packages/indexer-service/package.json +++ b/packages/indexer-service/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/indexer-service", - "version": "0.21.6-2", + "version": "0.21.7", "description": "Indexer service", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -33,7 +33,7 @@ "dependencies": { "@google-cloud/profiler": "6.0.1", "@graphprotocol/common-ts": "2.0.11", - "@graphprotocol/indexer-common": "^0.21.6-2", + "@graphprotocol/indexer-common": "^0.21.7", "@graphprotocol/indexer-native": "0.21.6", "@graphql-tools/load": "8.0.0", "@graphql-tools/url-loader": "8.0.0",