[SERVER-29802] Non-atomic applyOps command should not take out a global exclusive lock Created: 22/Jun/17  Updated: 30/Oct/23  Resolved: 07/Aug/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.4.9, 3.5.12

Type: Improvement Priority: Major - P3
Reporter: Steve Briskin (Inactive) Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to TOOLS-1886 oplog restore triggers server log war... Accepted
related to SERVER-43458 Remove TempRelease in dropDatabase Closed
related to SERVER-59750 Clean up todo of TempRelease in dropD... Closed
related to SERVER-30536 disallow applyOps non-atomic mode whe... Closed
related to SERVER-30554 relax locking mode in applyOps when a... Closed
is related to SERVER-23326 applyOps should use a single WriteUni... Closed
is related to SERVER-28594 non-atomic applyOps should log each i... Closed
is related to SERVER-29874 Two Phase Drops: dropDatabase does no... Closed
is related to SERVER-7452 Add an upsert flag to the applyOps co... Closed
is related to SERVER-23892 Do periodic replicated writes every 1... Closed
is related to SERVER-29224 Move applyOps out of db/catalog/ and ... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Repl 2017-07-31, Repl 2017-08-21
Participants:

 Description   

The applyOps command currently takes out a global exclusive lock and applies operations serially. This limits the number of operations that can be applied due to the lack of concurrency. Having applyOps (when in non-atomic mode) not take out a global lock would allow us to parallelize applyOps calls and take advantage of collection- and document-level locking.



 Comments   
Comment by Githook User [ 10/Aug/17 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: SERVER-29802 add applyOps 'allowAtomic' flag.

This flag supports non-atomic application of CRUD operations if set to false.
Defaults to true.
Branch: master
https://github.com/mongodb/mongo/commit/e7de30308564cead80857592ed27d938f73a91f1

Comment by Githook User [ 10/Aug/17 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: SERVER-29802 add applyOpsPauseBetweenOperations fail point
Branch: master
https://github.com/mongodb/mongo/commit/948776e76550e4ddf4a3d0f50b729f15bef0a97b

Comment by Githook User [ 09/Aug/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-29802 non-atomic applyOps does not acquire global lock

(cherry picked from commit 8671b6e7ea799312ece35cd90f8cf480d4f56ce8)
Branch: v3.4
https://github.com/mongodb/mongo/commit/9ea7ad5950415500142a41eb07cf8cb131ed52de

Comment by Githook User [ 09/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 add test for concurrent non-atomic applyOps

(cherry picked from commit b519114cb9bc72c17c60761cad369f2d8e18f472)
Branch: v3.4
https://github.com/mongodb/mongo/commit/da1f687d7d91bb0568a109b940f4395dc672db81

Comment by Githook User [ 08/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 clean up applyOps precondition checking

(cherry picked from commit c6f9f146b15b6f84613ee5f6b97572c6f9f5a1ba)
Branch: v3.4
https://github.com/mongodb/mongo/commit/b4cc5f23666a5d3790abe7c9548e515de47a0bc9

Comment by Githook User [ 08/Aug/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-29802 add applyOpsPauseBetweenOperations fail point

(cherry picked from commit 948776e76550e4ddf4a3d0f50b729f15bef0a97b)
Branch: v3.4
https://github.com/mongodb/mongo/commit/3c2b2dbf124ff5c891f41ccc5a81eb340d32e4b0

Comment by Githook User [ 08/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 add applyOps 'allowAtomic' flag.

This flag supports non-atomic application of CRUD operations if set to false.
Defaults to true.

(cherry picked from commit e7de30308564cead80857592ed27d938f73a91f1)
Branch: v3.4
https://github.com/mongodb/mongo/commit/a62fae74434fcdd90b94eb526dec7d43f116b16c

Comment by Githook User [ 08/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 rename txn to opCtx (apply_ops.cpp)
Branch: v3.4
https://github.com/mongodb/mongo/commit/28029005b4cc277ecf902989e249c49354e21447

Comment by Githook User [ 07/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 non-atomic applyOps does not acquire global lock
Branch: master
https://github.com/mongodb/mongo/commit/8671b6e7ea799312ece35cd90f8cf480d4f56ce8

Comment by Githook User [ 07/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 add test for concurrent non-atomic applyOps
Branch: master
https://github.com/mongodb/mongo/commit/b519114cb9bc72c17c60761cad369f2d8e18f472

Comment by Benety Goh [ 05/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 add applyOpsPauseBetweenOperations fail point
Branch: master
https://github.com/mongodb/mongo/commit/948776e76550e4ddf4a3d0f50b729f15bef0a97b

Comment by Githook User [ 05/Aug/17 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-29802 clean up applyOps precondition checking
Branch: master
https://github.com/mongodb/mongo/commit/c6f9f146b15b6f84613ee5f6b97572c6f9f5a1ba

Comment by Benety Goh [ 29/Jun/17 ]

SERVER-29874 adds a TempRelease to work around the global lock issue described in this ticket. When the applyOps stops taking out a global lock when dropping a database, we can remove the use of TempRelease from drop_database.cpp.

Generated at Thu Feb 08 04:21:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.