-
Notifications
You must be signed in to change notification settings - Fork 980
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
graphman: Add simpler chain rewind
command to delete blocks
#5645
base: master
Are you sure you want to change the base?
Conversation
This rewinds all subgraphs on a chain to a specified block. It has most of the same arguments as `graphman rewind`, but takes a chain name instead of a list of deployments.
.execute(conn) | ||
.map_err(Error::from) | ||
} | ||
Storage::Private(Schema { blocks, .. }) => { |
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.
Would be great to ensure this can work when the block cache shard is not the primary. Would also be awesome if we could have some integration tests for this functionality
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.
I think it does work because the ChainStore should already always have the right pool when it gets created. If you already tested that's great otherwise maybe rewind something in staging
ethereum_networks::table.filter(ethereum_networks::name.eq(&self.chain)), | ||
) | ||
.set(( | ||
ethereum_networks::head_block_number.eq(block_ptr_to.number as i64), |
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.
I think there is somewhere we keep the firehose cursor, I think this table has a firehose cursor too, that should be set to empty string.
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.
same here regarding tests
This is a simpler version of #5486, which adds a command to delete blocks past a certain point:
Note that deployments are not rewound here.