[SERVER-47750] ismaster server response now returns a string instead of a boolean Created: 24/Apr/20  Updated: 29/Oct/23  Resolved: 24/Apr/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Bug Priority: Major - P3
Reporter: Matt Broadstone Assignee: Pavithra Vetriselvan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-46955 Create the MongosTopologyCoordinator Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2020-05-04
Participants:

 Description   

Recently the value type for the ismaster property of an ismaster command response changed from a boolean to a string. I believe this change is responsible.



 Comments   
Comment by Matt Broadstone [ 27/Apr/20 ]

thanks pavithra.vetriselvan!

Comment by Pavithra Vetriselvan [ 27/Apr/20 ]

matt.broadstone, I ended up filing SERVER-47798, which we didn't get to in Triage today. It should be triaged next Monday.

Comment by Matt Broadstone [ 25/Apr/20 ]

Whatever you think is best. I would just like us to have coverage around this considering it it's critical "public API" between server and drivers.

Comment by Pavithra Vetriselvan [ 24/Apr/20 ]

The unittests in SERVER-46956 will only apply to mongos isMaster responses. So, I'm happy to file a ticket to audit our existing isMaster tests (for mongod as well) and ensure/add testing for validation of the response fields.

Comment by Pavithra Vetriselvan [ 24/Apr/20 ]

Agreed, I checked my changes locally by adding a check to awaitable_ismaster.js, which seems to validate the isMaster request. It was more of a sanity check than a full fledged addition. I didn't end up submitting this for review because I thought it'd be more valuable to add a test that validates the types of all isMaster response fields, as you mentioned offline.

I think ideally, we would have used the IDL for MongosIsMasterResponse, but I think that's currently out of scope (could definitely be an additional code cleanup ticket though!).

We planned on adding unittests in SERVER-46956, meant to be done after SERVER-46955, which introduces behavioral changes. We relied on our existing tests for SERVER-46955 since it was intended to be more of a refactor. Clearly, there was some oversight here on our part.

Comment by Matt Broadstone [ 24/Apr/20 ]

Hey y'all, I see there weren't any tests added for this change. Seems like it would go a long way to prevent these types of issues in the future.

Comment by Githook User [ 24/Apr/20 ]

Author:

{'name': 'Pavi Vetriselvan', 'email': 'pvselvan@umich.edu', 'username': 'pvselvan'}

Message: SERVER-47750 mongos isMaster response should return boolean
Branch: master
https://github.com/mongodb/mongo/commit/cfbd4d0186cd69ba36ed6a9622198b1b36ae177c

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