[SERVER-30765] Don't allow txnNumbers in commands for standalone mongods Created: 21/Aug/17 Updated: 30/Oct/23 Resolved: 14/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.5.11 |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jack Mulrow | Assignee: | Jack Mulrow |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||||||
| Sprint: | Sharding 2017-10-02 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||
| Description |
|
If a standalone mongod receives a write command with a valid txn number and logical session id, it will assign a statement id to each write, but because isOplogDisabledFor will always return false, since replication is not enabled, this invariant will be hit here. I'm not completely sure the invariant even needs to stay, since statement ids are only used after this check for inserting to the oplog, but regardless, since retryable writes aren't supported on standalone mongods, a command with a txn number should return a bad status instead of crashing the node. |
| Comments |
| Comment by Ramon Fernandez Marina [ 14/Sep/17 ] |
|
Author: {'username': u'jsmulrow', 'name': u'Jack Mulrow', 'email': u'jack.mulrow@mongodb.com'}Message: |
| Comment by Andy Schwerin [ 25/Aug/17 ] |
|
I think that mongorestore needs applyOps to work with oplog entries that have txnNums even when the restore target is a standalone node. Otherwise, this seems OK. |
| Comment by Mira Carey [ 21/Aug/17 ] |
|
I wonder if it's worthwhile adding a top level feature object to check against in initializeOperationSessionInfo (that's the function which scoops the txn and lsid out of the command pre-dispatch in mongod/mongos). We already do a check there for requiresAuth (sessions and retryable writes are disabled for non-auth'd commands) |