[SERVER-51334] Primary must only permit creating temporary resharding collection when in FCV >= 4.7 Created: 02/Oct/20  Updated: 29/Oct/23  Resolved: 24/Mar/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: PM-234-M3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-50248 Make the reshardCollection command no... Closed
Related
related to SERVER-55716 fcv_gate_resharding_collection.js sho... Closed
is related to SERVER-51333 setFeatureCompatibilityVersion should... Closed
is related to SERVER-49914 Disable the TTL monitor for "<databas... Closed
is related to SERVER-55470 Remove `fcv_gate_resharding_collectio... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-03-08, Sharding 2021-03-22, Sharding 2021-04-05
Participants:
Linked BF Score: 22
Story Points: 1

 Description   

It is otherwise possible for a create oplog entry for a temporary resharding collection to replicate to a 4.4 binary.

[js_test:repro_bf18512] 2020-10-02T21:59:04.841+0000 d20021| {"t":{"$date":"2020-10-02T21:59:04.841+00:00"},"s":"F",  "c":"REPL",     "id":21235,   "ctx":"OplogApplier-0","msg":"Failed to apply batch of operations","attr":{"numOperationsInBatch":1,"firstOperation":{"op":"c","ns":"test.$cmd","ui":{"$uuid":"5b816f8b-137f-47fc-b27d-a80a954fb1f1"},"o":{"create":"system.resharding.test","idIndex":{"v":2,"key":{"_id":1},"name":"_id_"}},"ts":{"$timestamp":{"t":1601675944,"i":2}},"t":1,"wall":{"$date":"2020-10-02T21:59:04.840Z"},"v":2},"lastOperation":{"op":"c","ns":"test.$cmd","ui":{"$uuid":"5b816f8b-137f-47fc-b27d-a80a954fb1f1"},"o":{"create":"system.resharding.test","idIndex":{"v":2,"key":{"_id":1},"name":"_id_"}},"ts":{"$timestamp":{"t":1601675944,"i":2}},"t":1,"wall":{"$date":"2020-10-02T21:59:04.840Z"},"v":2},"failedWriterThread":3,"error":"InvalidNamespace: cannot write to 'test.system.resharding.test'"}}
[js_test:repro_bf18512] 2020-10-02T21:59:04.841+0000 d20021| {"t":{"$date":"2020-10-02T21:59:04.841+00:00"},"s":"F",  "c":"-",        "id":23095,   "ctx":"OplogApplier-0","msg":"Fatal assertion","attr":{"msgid":34437,"error":"InvalidNamespace: cannot write to 'test.system.resharding.test'","file":"src/mongo/db/repl/oplog_applier_impl.cpp","line":509}}
[js_test:repro_bf18512] 2020-10-02T21:59:04.841+0000 d20021| {"t":{"$date":"2020-10-02T21:59:04.841+00:00"},"s":"F",  "c":"-",        "id":23096,   "ctx":"OplogApplier-0","msg":"\n\n***aborting after fassert() failure\n\n"}



 Comments   
Comment by Githook User [ 24/Mar/21 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-51334: Only allow the temporary resharding collection on FCV 4.7+
Branch: master
https://github.com/mongodb/mongo/commit/7c850a9595c4cc1a719c93f9328920645f9e5ff8

Comment by Max Hirschhorn [ 02/Oct/20 ]

Checking the feature compatibility version in DatabaseImpl::_checkCanCreateCollection() would lead to an issue for initial sync similar to the one described in SERVER-51333. One idea from gregory.wlodarek is to also check that the node is a primary.

Generated at Thu Feb 08 05:25:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.