-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: only require reindexing when the index was on going to off #6203
feat: only require reindexing when the index was on going to off #6203
Conversation
Guix Automation has began to build this PR tagged as v21.1.0-devpr6203.c412d905. A new comment will be made when the image is pushed. |
Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v21.1.0-devpr6203.c412d905. The image should be on dockerhub soon. |
src/init.cpp
Outdated
@@ -1917,19 +1917,19 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) | |||
} | |||
|
|||
// Check for changed -addressindex state | |||
if (fAddressIndex != args.GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX)) { | |||
if (!fAddressIndex && fAddressIndex != args.GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX)) { | |||
strLoadError = _("You need to rebuild the database using -reindex to change -addressindex"); |
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.
Makes sense I guess... let's also update the error message maybe?
strLoadError = _("You need to rebuild the database using -reindex to change -addressindex"); | |
strLoadError = _("You need to rebuild the database using -reindex to enable -addressindex"); |
Same below. Will have to update tests too.
I think the title supposed to be "on going to off"? |
8ae011d
to
a58ebbe
Compare
Anything else needed here? |
|
212a38e
to
884d659
Compare
Whoops! I swear I already did that locally, just forgot to push it I guess |
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.
see below + same for 2 more tests feature_spentindex.py
and feature_timestampindex.py
@@ -42,12 +42,12 @@ def setup_network(self): | |||
def run_test(self): | |||
self.log.info("Test that settings can't be changed without -reindex...") | |||
self.stop_node(1) | |||
self.nodes[1].assert_start_raises_init_error(["-addressindex=0"], "You need to rebuild the database using -reindex to change -addressindex", match=ErrorMatch.PARTIAL_REGEX) | |||
self.nodes[1].assert_start_raises_init_error(["-addressindex=0"], "You need to rebuild the database using -reindex to enable -addressindex", match=ErrorMatch.PARTIAL_REGEX) |
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.
-addressindex=0
== disable
you don't need to reindex to disable it...
self.stop_node(1) | ||
self.nodes[1].assert_start_raises_init_error(["-addressindex=0"], "You need to rebuild the database using -reindex to change -addressindex", match=ErrorMatch.PARTIAL_REGEX) | ||
self.start_node(1, ["-addressindex=0", "-reindex"]) | ||
self.start_node(1, ["-addressindex=0"]) |
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.
-self.stop_node(1)
-self.start_node(1, ["-addressindex=0"])
+self.restart_node(1, "[-addressindex=0"])
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.
let's wait CI, also consider replacement stop+start
to restart_nodes
which has been refactored in all functional tests long time ago
84ff7b7
to
492204d
Compare
Finally pulled in your commit 🙈 I forget about too many PRs |
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.
utACK 492204d
fix: init additional indexes in AppInitMain, adjust tests Update test/functional/feature_timestampindex.py don't need to reindex to disable in tests
492204d
to
c96f9e0
Compare
no diff; squashed these 4 commits into 1 |
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.
utACK c96f9e0
What was done?
It does not seem reasonable that we need to reindex when turning indexes off. this logic was introduced in e078109
How Has This Been Tested?
Hasn't
Breaking Changes
None, basically
Checklist:
Go over all the following points, and put an
x
in all the boxes that apply.