[SERVER-47931] Creation of *.system.profile collection should retry on WriteConflicts Created: 04/May/20  Updated: 29/Oct/23  Resolved: 14/May/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc6, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-05-18
Participants:
Linked BF Score: 15

 Description   

If concurrent operations try to create the "*.system.profile" collection at the same time, all but one will get a WriteConflictException here. This can cause a command to fail while profiling, even though the underlying operation may have actually succeeded.

The collection creation here needs a writeConflictRetry loop.



 Comments   
Comment by Dianna Hohensee (Inactive) [ 14/May/20 ]

Our commit hook didn't fire for some reason. Writing it myself
--------------------------------------
Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-47931 Retry WriteConflictExceptions when creating a *.system.profile collection

(cherry picked from commit 40c0fa9c0a3cf5d3d2ee16fe301c262946ececa8)
Branch: master
https://github.com/mongodb/mongo/commit/40c0fa9c0a3cf5d3d2ee16fe301c262946ececa8

Comment by Githook User [ 14/May/20 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-47931 Retry WriteConflictExceptions when creating a *.system.profile collection

(cherry picked from commit 40c0fa9c0a3cf5d3d2ee16fe301c262946ececa8)
Branch: v4.4
https://github.com/mongodb/mongo/commit/fa2dfbff76e8881d5585241c429c3a2667990fd8

Comment by Louis Williams [ 04/May/20 ]

This likely started happening after SERVER-47360 when we stopped taking an X database lock and instead only take a collection IX lock.

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