Skip to content
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

[Bug]: Fail gracefully if loaded network-history DB version does not match current #11708

Closed
wwestgarth opened this issue Sep 25, 2024 · 1 comment

Comments

@wwestgarth
Copy link
Contributor

Problem encountered

When loading from network history across DB schema version, the data-node will migrate through the schema versions as it loads history segments.

For example if history segment n has schema version 10 and history segment n+1 has schema version 11, then when loading the segments the flow is as follows:

  • migrate the schema from versions 0 -> 10
  • load history segment n
  • migrate the schema from version 10 -> 11
  • load history segment n+1

The problem is that if a protocol upgrade has just happened, and we are using the latest code version but the last network history segment we find to pull is from the older version, the data node will still start successfully. This means that the schema version will mismatch the sqlstore queries and weird failures will occurr.

Observed behaviour

If the DB schema is older than it should be for whatever reason, strange errors can occur when making queries.

Expected behaviour

The data node should not start if there is a schema mismatch.

Steps to reproduce

1. Submit `xyz` transaction
2. With this payload
3. Query `abc` API
4. Observe the error

Software version

develop

Failing test

No response

Jenkins run

No response

Configuration used

No response

Relevant log output

No response

@wwestgarth
Copy link
Contributor Author

Closed via an accidental push to develop:
35c14ad

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

No branches or pull requests

1 participant