[SERVER-18233] renameCollection command `dropTarget` parameter not a bool in oplog Created: 28/Apr/15  Updated: 06/Dec/22  Resolved: 03/Jan/20

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

Type: Bug Priority: Major - P3
Reporter: Cory Mintz Assignee: Backlog - Replication Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Operating System: ALL
Participants:

 Description   

A rename collection, run from the shell, such as:
db.test.renameCollection("test2", true)
Will result in an oplog entry that contains:

  "o": {
    "renameCollection": "XXX",
    "to": "YYY",
    "dropTarget": true
  }

The following command will still drop the target collection, I assume because
{dropTarget: true} still evalulates to true.
db.test.renameCollection("test2", {dropTarget:true})

But the resulting oplog entry contains:

  "o": {
    "renameCollection": "XXX",
    "to": "YYY",
    "dropTarget": {
      "dropTarget": true
   }



 Comments   
Comment by Judah Schvimer [ 03/Jan/20 ]

This behavior no longer exists. The shell helper validates input as of SERVER-7295. dropTarget also now writes the UUID of the collection it drops in the oplog, not a boolean or an object.

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