[SERVER-41361] Do not read at lastApplied while already holding the PBWM lock on secondaries Created: 29/May/19  Updated: 29/Oct/23  Resolved: 12/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.0.11, 4.2.0-rc2, 4.3.1

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

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-44489 When i add index on primary the SECON... Closed
Problem/Incident
Related
related to SERVER-41582 Investigate disallowing DBDirectClien... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Execution Team 2019-06-17
Participants:
Case:
Linked BF Score: 47

 Description   

When secondary reads must take the PBWM lock to read without a timestamp, all writes become visible. At this point, an operation holding the PBWM lock should not be allowed to start reading with a timestamp in a different snapshot, because writes and catalog operations may appear to vanish.



 Comments   
Comment by Kelsey Schubert [ 21/Jul/19 ]

This issue can result in the following invariant:

2018-07-06T17:59:54.562+0000 F - [conn24] Invariant failure params.descriptor src/mongo/db/query/stage_builder.cpp 99
2018-07-06T17:59:54.562+0000 F - [conn24] ***aborting after invariant() failure
2018-07-06T17:59:54.591+0000 F - [conn24] Got signal: 6 (Aborted).

Comment by Githook User [ 14/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries

(cherry picked from commit ce740566543792bfa4402d278a23e5cb4b1a80fe)
(cherry picked from commit 45053fb3aa9e423cc44b478728dbf9fa8d6a94bd)
Branch: v4.0
https://github.com/mongodb/mongo/commit/2a60fc34dc02d39df8791f20a54c318cc8c1d6a8

Comment by Githook User [ 14/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries

(cherry picked from commit ce740566543792bfa4402d278a23e5cb4b1a80fe)
Branch: v4.2
https://github.com/mongodb/mongo/commit/45053fb3aa9e423cc44b478728dbf9fa8d6a94bd

Comment by Githook User [ 12/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries
Branch: master
https://github.com/mongodb/mongo/commit/ce740566543792bfa4402d278a23e5cb4b1a80fe

Comment by Louis Williams [ 11/Jun/19 ]

I reverted this change because it did not work correctly with non-document-locking storage engines (i.e. MMAP and ephemeralForTest).

Comment by Githook User [ 11/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: Revert "SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries"

This reverts commit 1f7ff3efd432541a1490b108ffb8461dcbbdfcd5.
Branch: v4.2
https://github.com/mongodb/mongo/commit/6b893a49227f87c6c5580e9c59ca59b28ca75ffb

Comment by Githook User [ 11/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: Revert "SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries"

This reverts commit b6ad5c431b8a1272617a3eff58872808afa53e31.
Branch: master
https://github.com/mongodb/mongo/commit/01e68d5ac26a64b5b2d3a836428c07e3874488bf

Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries

(cherry picked from commit b6ad5c431b8a1272617a3eff58872808afa53e31)
Branch: v4.2
https://github.com/mongodb/mongo/commit/1f7ff3efd432541a1490b108ffb8461dcbbdfcd5

Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-41361 Do not read at lastApplied while already holding the PBWM lock on secondaries
Branch: master
https://github.com/mongodb/mongo/commit/b6ad5c431b8a1272617a3eff58872808afa53e31

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