[SERVER-34578] remove CommandInvocation::secondaryAllowed Created: 19/Apr/18  Updated: 29/Oct/23  Resolved: 23/Apr/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.7.6

Type: Bug Priority: Minor - P4
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2018-04-23
Participants:

 Description   

The slaveOk,slaveOverrideOk properties of each command are informed by the "secondaryAllowed" result enum. For some commands the correct answer would depend on what the request payload is. So when "listCommands" prints out an array of all the commands and their "slaveOk", "slaveOverrideOK" bool properties, it has no way of telling the truth right now.

This is user-facing.

So now we have a secondaryAllowed virtual function on Command and another on CommandInvocation. The one on Command gives a Request-insensitive answer, and the one on CommandInvocation gives a Request-sensitive answer. For the majority of commands these will give the same answer and CommandInvocation's default implementation will be to call its Command's secondaryAllowed member.

This ticket only covers removing secondaryAllowed from CommandInvocation, with the understanding that listCommands may have to be addressed at some point.



 Comments   
Comment by Billy Donahue [ 23/Apr/18 ]

After that commit, secondaryAllowed can never depend on a request object's state.
We still should fix listCommands, but it's not part of the TypedCommand refactor.

Comment by Githook User [ 23/Apr/18 ]

Author:

{'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue', 'name': 'Billy Donahue'}

Message: SERVER-34578 remove CommandInvocation::secondaryAllowed
Branch: master
https://github.com/mongodb/mongo/commit/916b24d822b0a776ca7c5aaa11cfaafe3b963e93

Comment by Billy Donahue [ 20/Apr/18 ]

https://mongodbcr.appspot.com/194950001/

Generated at Thu Feb 08 04:37:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.