[SERVER-84089] Bulk operation freezes if used in combination with collation and upsert Created: 12/Dec/23  Updated: 26/Jan/24

Status: Needs Scheduling
Project: Core Server
Component/s: Query Execution, Stability
Affects Version/s: 4.4.25, 6.0.12, 5.0.23, 7.0.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Denis Frenademetz Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: query-director-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

Run the following steps in the mongosh:

use test-db
 
db.createCollection('users')
 
db.users.createIndex({ 'username': 1 }, { unique: 1 })
 
db.users.insert({ "username": "LDAP"  })
 
db.users.insert({ "username": "ldap" })
 
var bulk = db.users.initializeUnorderedBulkOp()
 
bulk.find({"username":"ldap"}).collation({"locale":"en","strength":2}).upsert().updateOne({"$set":{ "username":"ldap"}})
 
bulk.execute() 

Participants:

 Comments   
Comment by Kyle Suarez [ 26/Dec/23 ]

Thank you denisfrenademetz97@gmail.com for the report and the reproducer; I've confirmed the issue on MongoDB v7.0.4. It does seem that specifying a collation causes a never-ending loop in this code where the server somehow keeps thinking the duplicate key error is retryable.

Sending this to director triage for assignment.

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