[SERVER-15285] cleanupOrphan with invalid writeConcern is accepted Created: 17/Sep/14  Updated: 17/Sep/14  Resolved: 17/Sep/14

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

Type: Bug Priority: Minor - P4
Reporter: Jonathan Abrahams Assignee: Unassigned
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

The following writeConcerns, when specified for cleanupOrphan, do not generate an error:

  • writeConcern: { w: null }
  • writeConcern: { w: undefined }
  • writeConcern: { w: NaN }

Cleaning up orphaned on shard test-rs0 {
	"cleanupOrphaned" : "test.secondaryThrottle_cleanupOrphans",
	"startingAtKey" : {
		"shardKey" : 499
	},
	"_secondaryThrottle" : true,
	"writeConcern" : {
		"w" : null
	}
}
 m31100| 2014-09-17T10:13:34.462-0400 I SHARDING [conn233] remotely refreshing metadata for test.secondaryThrottle_cleanupOrphans based on current shard version 2|1||541996e9a9941a160764d0fb, current metadata version is 2|1||541996e9a9941a160764d0fb
 m31100| 2014-09-17T10:13:34.462-0400 I SHARDING [conn233] metadata of collection test.secondaryThrottle_cleanupOrphans already up to date (shard version : 2|1||541996e9a9941a160764d0fb, took 0ms)
 m31100| 2014-09-17T10:13:34.462-0400 I SHARDING [conn233] Deleter starting delete for: test.secondaryThrottle_cleanupOrphans from { shardKey: MinKey } -> { shardKey: 500.0 }, with opId: 13455
 m31100| 2014-09-17T10:13:34.462-0400 I SHARDING [conn233] rangeDeleter deleted 0 documents for test.secondaryThrottle_cleanupOrphans from { shardKey: MinKey } -> { shardKey: 500.0 }



 Comments   
Comment by Scott Hernandez (Inactive) [ 17/Sep/14 ]

These should not generate errors and are designed to be equiv. to w:1, as they do in all use cases:

> db.a.insert({A:1}, {writeConcern:{w:null}})
WriteResult({ "nInserted" : 1 })
> db.a.insert({A:1}, {writeConcern:{w:undefined}})
WriteResult({ "nInserted" : 1 })
> db.a.insert({A:1}, {writeConcern:{w: 1 * "te"}})
WriteResult({ "nInserted" : 1 })
> 1 * "test"
NaN

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