[SERVER-35172] dropCollection can duplicate fields in its command response Created: 22/May/18  Updated: 29/Oct/23  Resolved: 05/Jun/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.0.0-rc5, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Ben Judd
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2018-06-04, Storage NYC 2018-06-18
Participants:

 Description   

If dropCollection gets a WCE and retries, the 'ns' field can be duplicated in the BSON response object.



 Comments   
Comment by Githook User [ 08/Jun/18 ]

Author:

{'username': 'Icantjuddle', 'name': 'Ben Judd', 'email': 'ben.judd@10gen.com'}

Message: SERVER-35172 'ns' field is no longer duplicated in response to dropCollection with WCE

(cherry picked from commit 315d216282d9182078e7ae8a994747caab812dc9)
Branch: v4.0
https://github.com/mongodb/mongo/commit/b949f46b0542d6fa7be6d0d7174f338e23c059cf

Comment by Githook User [ 05/Jun/18 ]

Author:

{'name': 'Ben Judd', 'email': 'ben.judd@10gen.com'}

Message: SERVER-35172 'ns' field is no longer duplicated in response to dropCollection with WCE
Branch: master
https://github.com/mongodb/mongo/commit/315d216282d9182078e7ae8a994747caab812dc9

Comment by Eric Milkie [ 31/May/18 ]

I ran into it by simply using the failpoint that causes more WCE's to occur, and running in debug mode (which does BSON validation on all outgoing messages.) The server will crash if it ends up with a command response with duplicate fields.

The failpoint is WTWriteConflictException, and in partial_unique_indexes.js you can see an example of how to use it. You can't turn it on 100% of the time because then the server will simply retry forever and never make progress.

Comment by Ben Judd [ 31/May/18 ]

Besides the reproduction script mentioned in SERVER-18420 is there another way this has been reproduced?

Comment by Eric Milkie [ 22/May/18 ]

This was fixed once before in SERVER-18420 but in a way that was fragile.

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