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
Fix create db options on secondary shard creation #2690
Conversation
BTW... I believe this issue also extends to PSE databases created while a node was out of rotation. Basically anything that relies on database creation config options, which is PSE and PQ (anything else?). |
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.
We need to add tests for options actually being applied as well.
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.
Super important change here.
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
6b965de
to
119bbc0
Compare
119bbc0
to
7c831f6
Compare
Shouldn't this and #2672 target the |
yes. :) |
828d331
to
73bf2c9
Compare
73bf2c9
to
9c95667
Compare
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
Fix create db options on secondary shard creation
Fix create db options on secondary shard creation
Fix create db options on secondary shard creation
Fix create db options on secondary shard creation
Fix create db options on secondary shard creation
Overview
This is a continuation of the work in #2672 to fix issues around secondary shard creation when nodes re-enter a cluster after a database was created while the node was down (or potentially in maintenance mode).
This PR introduces logic to handle the following four scenarios while opening a db in context of
fabric_rpc
andmem3_rpc
:- just return the db as normal
- load the db create options and create the local shard
- just create the local db as expected
- throw an error and prevent creating the db with incomplete settings
This PR changes the behavior of scenario 2) by loading the appropriate config and creating the db with the desired parameters, and of scenario 4) by no longer allowing the db to be created inappropriately.
For scenario three, I've taken the approach of not loading config as a non sharded db won't have a dbs db doc. In particular here, we want to properly handle updates to internal dbs like
_dbs
and alsosys_dbs
like_users
.Another open item here is the merging of the db create options and the provided options. Right now, I'm just doing
DbOpts ++ Opts
basically, but I wrote a functionsopts_merge/{2,3}
that will merge two proplists, prioritizing the first list of items, and supports atoms. It's... a bit gnarly, and I'm not convinced we should use it. So we need to figure out what to do with the options lists here, but I think we might be ok just combining the two.While in the general neighborhood, I took the opportunity to de-duplicate some of the shards_db config lookups as well. I've isolated those changes to a dedicated commit.
Testing recommendations
This needs more testing. I've got a WIP commit for adding a test suite here that is not yet complete. I figured it was worthwhile to get this PR out for feedback while continuing to work on the tests.
Related Issues or Pull Requests
#2672
Checklist
rel/overlay/etc/default.ini