-
Notifications
You must be signed in to change notification settings - Fork 659
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
fix(forknet): Fix the state parts bucket cleanup logic #12712
base: master
Are you sure you want to change the base?
Conversation
logger.info('State dumper node found, cleaning up state parts.') | ||
state_dumper_node.run_cmd(f'gsutil -m rm -r gs://{bucket_name}/chain_id=\*', | ||
state_dumper_node.run_cmd(f'gsutil -m rm -r gs://{bucket_name}/chain_id=*', |
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.
Python complains about the \*
as it tries to parse it as an escape sequence. It should be safe to pass it here without escaping it.
@@ -253,13 +258,8 @@ def _clear_state_parts_if_exists(location, nodes): | |||
# bucket where it dumped the parts. | |||
bucket_name = location['GCS']['bucket'] | |||
|
|||
state_dumper_node = next(filter(lambda n: n.want_state_dump, nodes), None) |
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.
Why did you move this block to line 247?
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.
In this function _clear_state_parts_if_exists
, we want to check if the state parts exist and then clear them.
Previously, we assumed that if we are in a localtest, we always dump the parts, but is not the case.
With this change, we will make it clear to the mirror.py
user if the parts were deleted or not.
baf3857
to
01789f1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12712 +/- ##
==========================================
- Coverage 70.64% 70.63% -0.01%
==========================================
Files 848 848
Lines 173732 173730 -2
Branches 173732 173730 -2
==========================================
- Hits 122725 122713 -12
- Misses 45875 45883 +8
- Partials 5132 5134 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM
Allow
reset
command to run without--gcs...
parameter.