-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Fully Compatible
-
v4.2
-
Repl 2019-06-03, Repl 2019-06-17, Repl 2019-07-01
Original Description:
Replica set config documents look like:
{ _id: 'rs name', members: [ {_id: 0, host: 'host1:27017'}, {_id: 1, host: 'host2:27017'} ] }
The "_id" field in member subdocuments isn't useful in any way I know, but requires extra typing and it must be chosen to obey certain rules (it must be unique and between 0 and 255 inclusive). If we handle it incorrectly it can cause bugs (SERVER-40355). In summary, the _id field has cost but perhaps no benefit: uniqueness is provided by members' addresses and order is provided by their array position.
Let's consider deprecating _id, and eventually ignoring it completely.
New Description:
Since this has diagnostic value, we'd prefer to change the type of the "_id" field to avoid introducing bugs.
- is related to
-
SERVER-40355 rs.config that contains an _id greater than the number of nodes will crash
- Closed