Deprecate configuring Praefect virtual storage's nodes in the the virtual storage's root config object
While adding a new configuration value for virtual storages in Praefect, I noticed that the configuration structure used in Omnibus deviated from how Praefect actually structured its configuration. Omnibus configured nodes directly under the virtual storage's name. This left no room for other virtual storage scoped configuration values, such as the default_replication_factor
. !4988 (merged) implemented a workaround, which moves unknown keys from the virtual storage's config under the 'nodes' key. This retains backwards compatibility but I think we'd like to deprecate configuring the nodes directly under the virtual storage.
Old format:
praefect['virtual_storages'] = {
'default' => {
'default_replication_factor' => 3,
'praefect-internal-0' => {
'address' => 'tcp://10.23.56.78:8075',
'token' => 'abc123'
},
'praefect-internal-1' => {
'address' => 'tcp://10.76.23.31:8075',
'token' => 'xyz456'
}
}
}
New format:
praefect['virtual_storages'] = {
'default' => {
'default_replication_factor' => 3,
'nodes' => {
'praefect-internal-0' => {
'address' => 'tcp://10.23.56.78:8075',
'token' => 'abc123'
},
'praefect-internal-1' => {
'address' => 'tcp://10.76.23.31:8075',
'token' => 'xyz456'
}
}
}
}
There are some further disparities. Praefect uses the singular ´virtual_storage´ as the key and omnibus uses plural virtual_storages
. Same for the Praefect's node
vs Omnibus' nodes
. Omnibus' keys sound more accurate, so we should likely leave them as is and consider changing them in Praefect if we want to fix the disparity.
Praefect structures the virtual storages as an array:
[
{
name: string
default_replication_factor: int
nodes: [
{
storage: string
address: string
token: string
}
]
}
]
This also deviates from the structure in Omnibus which is a hash. Using a hash makes sense, as the virtual storage and nodes are uniquely keyed by their name and order does not matter. I'd suggest we leave them as they are in Omnibus and consider whether we want to change this in Praefect to match.