Skip to content
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

[Feature] A new graphman command to restart a subgraph #4742

Merged
merged 6 commits into from
Jul 12, 2023

Conversation

SozinM
Copy link
Contributor

@SozinM SozinM commented Jul 5, 2023

Closes #4715

Kept sleep param similar to rewind command

NEWS.md Outdated
@@ -7,6 +7,7 @@
- `graphman` now has two new commands `pause` and `resume` that can be used to pause and resume a deployment
- A new table `subgraph_features` is added which tracks information like spec_version, api_version, network, features, datasources etc
- The schema for the `subgraphFeatures` endpoint now includes data from the `subgraph_features` table
- `graphman` now has new command `restart` that can be used to sequenteally pause and resume a deployment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo for "sequentially"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

sleep: Duration,
) -> Result<(), Error> {
pause_or_resume(primary.clone(), sender, search, true)?;
thread::sleep(sleep);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to print out a message to console.. saying something like "Waiting for x seconds"

Actually might be good to have a "Pausing "

and a "resuming too

Copy link
Contributor Author

@SozinM SozinM Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New logs format:

pausing QmTGXDUdbYNuThTAUbeSA15BcQCRxX6qR1PyPN23e3JXFJ[210]
Operation completed
Waiting 20s to make sure pausing was processed
resuming QmTGXDUdbYNuThTAUbeSA15BcQCRxX6qR1PyPN23e3JXFJ[210]
Operation completed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, I'll test it out

Mikhail Sozin added 2 commits July 10, 2023 19:58
Add logs with sleep duration to restart command
@balakhonoff
Copy link

Great job, thanks!

@incrypto32 incrypto32 merged commit 40aba26 into graphprotocol:master Jul 12, 2023
@SozinM SozinM deleted the feature/graphman_restart branch July 18, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] A new graphman command to restart a subgraph
3 participants