flow-go
flow-go copied to clipboard
[Access] Add flag to reindex execution data
Closes: https://github.com/onflow/flow-go/issues/4939
This PR adds a new flag to Access nodes (--execution-data-force-reset-indexer-height) that allows an operator to reindex execution data starting from the root block. This is helpful when a bug is discovered, or the data is found to be corrupt.
Steps to recover:
- Stop the node
- Backup the
execution-stateandprotocoldata directories - Delete the
execution-state. DO NOT delete the protocol db. - Set
--execution-data-force-reset-indexer-height=truein node's startup config - Start the node
- Remove
--execution-data-force-reset-indexer-heightfrom the startup config so it's not used on future reboots. You do not need to restart the node again.
The node will load the checkpoint into the execution-state db, then reset the indexer's current height value, causing it to reindex from the root block.
Note: This is OK with the current node software because the events/tx results data indexed from execution data is not used. Eventually, we will start to use it in the API, at which point we may need another method to ensure it is not returned in queries while reindexing.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
38484eb) 56.49% compared to head (fdb8747) 57.84%.
Additional details and impacted files
@@ Coverage Diff @@
## master #4943 +/- ##
==========================================
+ Coverage 56.49% 57.84% +1.34%
==========================================
Files 980 806 -174
Lines 93192 77608 -15584
==========================================
- Hits 52649 44892 -7757
+ Misses 36640 29360 -7280
+ Partials 3903 3356 -547
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 57.84% <ø> (+1.34%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
refactored the logic into the indexer module. still need to add tests