Skip to content

fix(consensus): open the store only after the execution engine is reachable - #465

Closed
ZanCorDX wants to merge 1 commit into
circlefin:mainfrom
ZanCorDX:dx/avoid-db-repair-on-startup-failure
Closed

ZanCorDX wants to merge 1 commit into
circlefin:mainfrom
ZanCorDX:dx/avoid-db-repair-on-startup-failure

Conversation

@ZanCorDX

Copy link
Copy Markdown
Contributor

App::start() opens the redb store before connecting to the execution engine.
If the CL is terminated while it waits for the EL (up to 30 s of retries), no
SIGTERM handler is installed yet, so the process dies with the store open and
without the quick-repair commit that redb performs on Drop. The next start then
runs a full repair: 1h04 on a 103 GB testnet store.

This moves open_store to just before State::builder, its first use, so the
store is not open during the EL wait. No behavior change on the success path.

Reproduce (v0.8.0, EL stopped):

  1. systemctl start arc-malachite; wait for Database opened and the
    Failed to connect to Ethereum node retries.
  2. systemctl stop arc-malachite during the retries.
  3. Start the EL, then systemctl start arc-malachite:
    Database repair in progress: 0.00% instead of Database opened.

With this patch, step 1 logs no Opening database before the EL check, and
step 3 opens the store immediately and completes the handshake.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @ZanCorDX,

Thank you for your interest in contributing to Arc Node.

This PR has been automatically closed because it does not reference a GitHub issue. All PRs must reference an existing issue using the format Closes: #XXX.

To contribute properly:

  1. Find an existing issue you'd like to work on, or open a new issue describing your proposed change
  2. Comment on the issue requesting assignment and wait for maintainer approval
  3. Only submit a PR after you have been assigned to the issue

Please see our CONTRIBUTING.md for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant