[SERVER-20708] getMore and killCursors commands should ignore the value of the slaveOk bit received from the client Created: 30/Sep/15  Updated: 17/Mar/16  Resolved: 07/Oct/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on DRIVERS-211 New commands for find, getMore, and k... Closed
Related
related to SERVER-23219 DBCommandCursor doesn't route getMore... Closed
is related to SERVER-21601 Increase test coverage for querying w... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QuInt A (10/12/15)
Participants:

 Description   

Currently, the server will fail these commands if an internal or external client attempts to execute them on a secondary node without the slaveOk bit set.



 Comments   
Comment by Jeffrey Yemin [ 07/Oct/15 ]

david.storch some drivers have already pushed code to master with special handling of slaveOk for getMore and killCursors. That code can be ripped out due to this change.

Comment by David Storch [ 07/Oct/15 ]

jeff.yemin, should this really be "Drivers Changes: Needed"? This should make getMore and killCursors commands match the behavior of OP_GET_MORE and OP_KILLCURSORS, so I don't think drivers necessarily need to do anything.

Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-20708 make getMore and killCursors commands ignore the slaveOk bit

These commands will now succeed on secondaries even if slaveOk=0.
Branch: master
https://github.com/mongodb/mongo/commit/2904bb4a308e8056ccacb562a662c9353e35c73a

Comment by David Storch [ 01/Oct/15 ]

OP_GET_MORE does not include a slaveOk bit, so the server has no slaveOk value to respect. This means that if a cursor is established on a primary (without slaveOk), a stepdown occurs, and a client issues an OP_GET_MORE against the cursor on the now-secondary node, the operation will not fail. Our thinking is that both OP_GET_MORE and getMore command should respect the original slaveOk value sent with the find operation in this case rather than associating a new slaveOk bit with each getMore. schwerin, do you agree?

Comment by Andy Schwerin [ 01/Oct/15 ]

Remind me, what's the behavior of OP_GETMORE?

Generated at Thu Feb 08 03:55:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.