You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns on automated master discovery in a replica set if set to ``auto``.
183
+
Applicable only to the configuration of a router; the storage configuration ignores this parameter.
184
+
185
+
The parameter should be specified per replica set and is not compatible with manual master selection.
186
+
187
+
**Examples**
188
+
189
+
Correct configuration:
190
+
191
+
.. code-block:: kconfig
192
+
:emphasize-lines: 4
193
+
194
+
config = {
195
+
sharding = {
196
+
<replicaset uuid> = {
197
+
master = 'auto',
198
+
replicas = {...},
199
+
},
200
+
...
201
+
},
202
+
...
203
+
}
204
+
205
+
Incorrect configuration:
206
+
207
+
.. code-block:: kconfig
208
+
:emphasize-lines: 4, 7, 11
209
+
210
+
config = {
211
+
sharding = {
212
+
<replicaset uuid> = {
213
+
master = 'auto',
214
+
replicas = {
215
+
<replica uuid1> = {
216
+
master = true,
217
+
...
218
+
},
219
+
<replica uuid2> = {
220
+
master = false,
221
+
...
222
+
},
223
+
},
224
+
},
225
+
...
226
+
},
227
+
...
228
+
}
229
+
230
+
If configuration is incorrect configuration, it is not applied, and the ``vshard.router.cfg()`` call throws an error.
231
+
232
+
233
+
If the ``master`` parameter is set to ``auto`` for some replica sets, the router goes to these replica sets, discovers the master in each of them, and periodically checks if the master instance still has its master status.
234
+
When the master in the replica set stops being a master, the router goes around all the nodes of the replica set and finds out which one is the new master.
235
+
236
+
Without this setting, the router cannot detect master nodes in the configured replica sets on its own.
237
+
It relies only on how they are specified in the configuration.
238
+
This becomes a problem when the master changes and the change is not delivered to the router's configuration:
239
+
for instance, in case the router doesn't rely on a central configuration provider
240
+
or the provider cannot deliver a new configuration due to some reason.
0 commit comments