-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement the ability to downgrade CouchDB versions even on header field changes #5611
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
Conversation
b44806c to
fda4dfb
Compare
7a4cb78 to
dde32ff
Compare
| ; Note that some future versions of CouchDB might not support downgrade at all, | ||
| ; whatever value this is set to. In those cases CouchDB will refuse to | ||
| ; downgrade or even open the databases in question. | ||
| ;prohibit_downgrade = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you consider using positive logic?
; allow_downgrade = false
I don't mind either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did start that way actually, the pr branch is even named allow-downgrades-option, but there was a discussion in dev to improve wording and naming and I think we settled on having something that expresses the default as a true value. I am ok either way as well, but prohibit does sound a bit stronger and more worrisome which is a good thing in this case.
iilyak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Currently, CouchDB on-disk header record allows appending new fields to it in such a way that newer versions can upgrade themselves from the old versions easily if the ?LATEST_DISK_VERSION stays the same. However, it was not possible to perform a downgrade back to an old version in case something went wrong. While in general it may not be safe to downgrade in such cases, it may be possible for some features, so allow for such an option and make it configurable. This is essentially a counterpart to this feature: ``` % As long the changes are limited to new header fields (with inline % defaults) added to the end of the record, then there is no need to increment % the disk revision number. ``` The release notes of future releases may indicate which version are downgrade safe. Then, to perform a downgrade users would enable the downgrade flag, downgrade, and then reset it back to default (prohibit = true). Implementation-wise, it's pretty basic, if the size of the new tuple is larger than the old one, it's a downgrade. Then, only use as many tuple fields as current (aka the "old" version) knows about, everything else is discarded.
dde32ff to
ce5b584
Compare
Currently, CouchDB on-disk header record allows appending new fields to it in such a way that newer versions can upgrade themselves from the old versions easily if the ?LATEST_DISK_VERSION stays the same. However, it was not possible to perform a downgrade back to an old version in case something went wrong.
While in general it may not be safe to downgrade in such cases, it may be possible for some features, so allow for such an option and make it configurable.
This is essentially a counterpart to this feature:
The release notes of future releases may indicate which version are downgrade safe. Then, to perform a downgrade users would enable the downgrade flag, downgrade, and then reset it back to default (prohibit = true).
Implementation-wise, it's pretty basic, if the size of the new tuple is larger than the old one, it's a downgrade. Then, only use as many tuple fields as current (aka the "old" version) knows about, everything else is discarded.