-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.19
-
Component/s: Replication
-
Labels:None
-
ALL
-
Repl 2019-07-01
-
15
Access to _localOplogCollection is not synchronized on 3.4. We take a Global X lock when setting the pointer to null, an IX lock on local.oplog.rs when setting the pointer to a non-null value, and no lock when reading the pointer. This means that we can read that the pointer is non-null, then call a function on a null pointer, leading to an invalid access.
This issue is fixed on versions 3.6 and later by SERVER-30639. This commit ensures that we only set the pointer to null when dropping the local database, which is not allowed when replication is enabled. The pointer is only used when replication is enabled.