flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[Access] Add flag to reindex execution data

Open peterargue opened this issue 2 years ago • 2 comments

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:

  1. Stop the node
  2. Backup the execution-state and protocol data directories
  3. Delete the execution-state. DO NOT delete the protocol db.
  4. Set --execution-data-force-reset-indexer-height=true in node's startup config
  5. Start the node
  6. Remove --execution-data-force-reset-indexer-height from 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.

peterargue avatar Nov 07 '23 01:11 peterargue

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.

codecov-commenter avatar Nov 07 '23 01:11 codecov-commenter

refactored the logic into the indexer module. still need to add tests

peterargue avatar Nov 30 '23 00:11 peterargue