[SERVER-62575] mongos logs incorrect nShards value Created: 12/Jan/22  Updated: 27/Oct/23  Resolved: 19/Jan/22

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

Type: Task Priority: Major - P3
Reporter: Peter Williamson Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongos.log    
Participants:

 Description   

An upsert operation that successfully inserted a document was logged in mongos.log with nShards:0, when a similar test was repeated later nShards:1 was correctly reported. 



 Comments   
Comment by Eric Sedor [ 19/Jan/22 ]

Thanks for the update peter.williamson; I'll close this out

Comment by Peter Williamson [ 12/Jan/22 ]

Just realized I was in the admin database

 

Comment by Peter Williamson [ 12/Jan/22 ]

Also happens with writeConcern 1

 

{{2022-01-12T21:34:38.115+0000 I COMMAND [conn175] command admin.deviceState appName: "MongoDB Shell" command: update

{ update: "deviceState", ordered: true, *writeConcern: \{ w: 1.0 }

*, lsid: { id: UUID("c53bb8bb-d501-444f-bc40-9080e3f3e2dd") }, $clusterTime: { clusterTime: Timestamp(1642023265, 3), signature:

{ hash: BinData(0, F2B4DCCBB4AA1F3AD9DD44F838B4C51F5DBE676A), keyId: 7000142903968268291 }

}, $db: "admin" } nShards:0 nMatched:0 nModified:0 upsert:1 numYields:0 reslen:296 protocol:op_msg 1ms}}

Comment by Peter Williamson [ 12/Jan/22 ]

From the attached log:
2022-01-12T21:33:36.078+0000 I COMMAND [conn175] command admin.deviceState appName: "MongoDB Shell" command: update { update: "deviceState", updates: [ { q:

{ accountId: 1.0, deviceId: 1.0, eventDate: new Date(1642023210173) }

, u: { $set:

{ Test: 1.0 }

, $setOnInsert: { accountId: 1.0, deviceId: 1.0, eventDate: new Date(1642023210173) } }, multi: false, upsert: true } ], ordered: true, writeConcern: { w: 0.0 }, $clusterTime: { clusterTime: Timestamp(1642023205, 3), signature:

{ hash: BinData(0, CB1ABB5F3E6DC21AD444BB387728EA053C6EC97A), keyId: 7000142903968268291 }

}, $db: "admin" } nShards:0 nMatched:0 nModified:0 numYields:0 protocol:op_msg 27ms

 

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