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

Revert bbolt database to version 1. #391

Merged
merged 7 commits into from
Sep 26, 2023
Merged

Conversation

jholdstock
Copy link
Member

@jholdstock jholdstock commented Sep 22, 2023

This PR removes all bbolt database upgrades and reverts the database version to 1. All associated tests and test databases are also removed. I have left the upgrade framework and the testing framework in place so as not to lose the baby with the bathwater.

To support this change, I'd like to propose we label the next dcrpool release 2.0.0.

I believe we should take the opportunity to do this because there are no known public deployments of dcrpool at the moment, this could be the last chance to wipe the slate clean in this way. I don't believe there are any drawbacks to this plan, but there are several notable benefits:

  • It allows more flexibility if we want to make further database changes before cutting the 2.0.0 release. Changes can be made freely without worrying about old database versions and without having to write update code (for example, this suggested UUID change).
  • It's a significant amount of code which no longer needs to be maintained.
  • It removes any uncertainty about inconsistent data, e.g. fields which may be in a different format/empty if they were stored before a certain db version (transactionIDUpgrade and paymentSourceUpgrade were real examples of this kind of issue). Consistent data means a lot of potential bugs/support issues which could be avoided down the line.

This upgrade added a new bucket "hashdatabkt" to the database. This
bucket is already being created in InitBoltDB so no additional changes
are necessary. On top of that, because BoltDBVersion was never updated
to 7, this upgrade was never being run anyway.
This upgrade set the UUID field on every entry in the payments and
archived payments buckets. I have confirmed that payments/archived
payments are never persisted without their UUID set, so this upgrade is
no longer necessary and no additional changes are required.
This upgrade set the CreatedOn field on every entry in the share bucket.
I have confirmed that shares are never persisted without their CreatedOn
set, so this upgrade is no longer necessary and no additional changes
are required.
This upgrade removed the value "txfeereserve" from the pool bucket. I
have confirmed this value is no longer being inserted to the database
anywhere, so this upgrade is no longer necessary and no additional
changes are required.
This upgrade changed the ID format and set the Source for every
payment/archived payment. I have confirmed that the new ID format is
already used everywhere, and the Source is always set before
payments/archived payments are persisted, so this upgrade is no longer
necessary and no additional changes are required.
This upgrade changed the ID format and removed the CreatedOn field from
shares. The new key is already in use throughout the code, and the
CreatedOn field was actually restored in an upgrade which came after
this one, so no additional changes are required..
This upgrade set the TransactionID for every payment and archived
payment. I have confirmed that TransactionID is always set before
payments/archived payments are persisted, so this upgrade is no longer
necessary and no additional changes are required.
@jholdstock jholdstock merged commit 3e5f073 into decred:master Sep 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants