-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add json-rpc api support for dropping subgraphs #5651
base: master
Are you sure you want to change the base?
Conversation
Perhaps explore Indexer Agent-based solution to avoid |
Not sure I understand the argument here. This is a private endpoint, it's as dangerous as letting someone add subgraphs unboundedly and fill up the disks, taking down the graph-node. It is also a basic operational task that currently cannot be automated because it's not exposed in any api. |
d235309
to
15f1e69
Compare
self.remove_subgraph( | ||
SubgraphName::new(deployment.clone()) | ||
.map_err(|_| StoreError::DeploymentNotFound(deployment))?, | ||
)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont this delete both the pending and current version of a subgraph that belongs to the same name as hash
provided? Thought we are moving away from that behaviour?
async fn remove_deployment(&self, id: &DeploymentHash) -> Result<(), SubgraphRegistrarError> { | ||
self.store.drop_subgraph(id)?; | ||
|
||
debug!(self.logger, "Removing deployment(s)"; "hash" => id.to_string()); | ||
|
||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the debug logs supposed to be before the self.store.drop_subgraph(id)?;
?
Add json-rpc method for dropping subgraphs. Using this endpoint will remove all the subgraphs for the deployment_id and will delete the underlying data.
docker/bin/drop
is a helper script to use the new endpoint.Adding some sane defaults as discussed: