[SERVER-66098] Investigate read only mode for column indexes Created: 29/Apr/22  Updated: 29/Oct/23  Resolved: 07/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Ian Boros Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: pm2646-m4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

There's a TODO that was left here.

 

However, the flag seems to be ignored. This task is to see if there's any special behavior that standard indexes or collections do for read-only mode, and whether CSI has to mirror that behavior.



 Comments   
Comment by Githook User [ 07/Dec/22 ]

Author:

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

Message: SERVER-66098 Remove readOnly from the WTColumnStore constructor: column store is an index and RecordStore writes already check for readOnly
Branch: master
https://github.com/mongodb/mongo/commit/402b2fac002941eeb67da425fc16264259226267

Comment by Dianna Hohensee (Inactive) [ 05/Dec/22 ]

Ah, one thing maybe. RecordStore validates not readOnly mode for every write. I suspect WTColumnStore is a variant of record store? (the class is undocumented). So maybe that should be added. Why doesn't WTColumnStore inherit from RecordStore?

UPDATE:

Ah, WTColumnStore is more like a variant of SortedDataInterface (index equiv of RecordStore). Therefore, WTColumnStore need not do any checks because all writes will hit the RecordStore and then whatever indexes – WTColumnStores and SortedDataInterfaces. So the RecordStore will always invariant and destroy the operation also trying to do index writes.

Comment by Dianna Hohensee (Inactive) [ 05/Dec/22 ]

ian.boros@mongodb.com steve.tarzia@mongodb.com Unless there's something particular either of you have in mind for column store regarding readOnly mode, I will go ahead and close this ticket.

Comment by Dianna Hohensee (Inactive) [ 05/Dec/22 ]

The WTColumnStore readOnly flag is not used in the WTColumnStore constructor, which explains why it does not work.

I don't believe that there is any work to be done in this ticket. The readOnly flag is actively used in the write path, and ensured for any write path via a combination of checks in the WriteUnitOfWork and RecoveryUnit. The readOnly flag is initialized via the ServiceContext and OperationContext, and thus is present for every WUOW done on the server. There are means of bypassing the flag, by specially unsetting the opCtx I would expect, for special internal operations as they arise, but that is irrelevant to column store details.

Comment by Ian Boros [ 02/Dec/22 ]

Updated description.

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