[SERVER-80863] Centralise cached oplog pointer initialization to collection registering in catalog Created: 07/Sep/23  Updated: 06/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: car-qw, techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-80789 Make AutoGetOplog behave consistently... Closed
Assigned Teams:
Catalog and Routing
Participants:
Story Points: 3

 Description   

There's several calls to acquireOplogCollectionForLogging and establishOplogCollectionForLogging in different parts of the code, attempting to fetch the oplog Collection pointer and cache it. 

If the Collection object exists and is available, it must have been registered in the collection catalog. There already is onDeregisterFromCatalog call which basically clears the cached oplog pointer. We could do the same for the register path, and register the created instance. Ending up with a single call to establishOplogCollectionForLogging.

The drawback is some tests manually creating the oplog collection have to be fixed. (Mainly due to global write lock requirement / invariant). More generally, we'd have to address a user attempting to create local.oplog.rs (but this probably shouldn't be allowed in the first place).

(Split off from SERVER-80789 to ease backportability)


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