-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Currently, subgraphs get paused and resumed by exploiting a side-effect of how graph-node handles assignments: assigning to a nonexistent node pauses a subgraph and assigning it back to a real node resumes it. That is clunky UX and makes it impossible for graph-node to decide what to do when a paused subgraph is deployed again (as in issue #4242)
A better design is to make graph-node aware of pausing/resuming subgraphs. To this end, we should make the following changes:
- add commands
graphman pause/graphman resume - change the assignment messages we send internally to make sure subgraphs stop indexing when paused and start when resumed (this can probably happen with the existing add/remove messages)
- have index nodes ignore paused subgraphs when they start up
Backing this would require a small schema change in subgraph_deployment_assignment to add a column paused_at timstamptz where a null value means 'the subgraph should be indexed'. While we're at it, we should also add a column assigned_at - it's not really needed for this functionality, but can be useful for auditing.
In addition, the subgraph_deploy request should get a new parameter that controls whether redeploying an existing subgraph will resume it if it exists and is paused.