[SERVER-78310] move change stream pre-image logic out of OpObserverImpl Created: 21/Jun/23  Updated: 29/Oct/23  Resolved: 13/Jul/23

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

Type: Improvement Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-78400 improve OnDeleteOutputsTest handling ... Closed
related to SERVER-78401 re-order change streams collection wr... Closed
related to SERVER-78675 TransactionParticipant generates appl... Closed
related to SERVER-78733 TransactionParticipant generates appl... Closed
related to SERVER-79048 move retryable findAndModify image lo... Closed
is related to SERVER-74100 Streamline logical branches in opObse... Backlog
is related to SERVER-74121 Streamline logical branches in opObse... Backlog
Backwards Compatibility: Fully Compatible
Sprint: Execution NAMR Team 2023-06-26, Execution NAMR Team 2023-07-10, Execution NAMR Team 2023-07-24
Participants:

 Description   

Currently the logic for writing pre-images for change streams is embedded in the OpObserverImpl implementions for updates/deletes. We also write pre-images as part of commiting unprepared multi-document transactions and preparing multi-document transaction. It would be nice to extract and separate this logic for accessing the pre-images collection in a separate OpObserver implementation or move the logic up to the caller as a post-OpObserver action.

Affected functions in OpObserverImpl include:

  • writeChangeStreamPreImagesForTransaction()
  • writeChangeStreamPreImagesForApplyOpsEntries()
  • writeChangeStreamPreImageEntry

Because this work affects onUpdate and onDelete, this ticket has some overlap with SERVER-74100 and SERVER-74121.



 Comments   
Comment by Githook User [ 13/Jul/23 ]

Author:

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

Message: SERVER-78310 add function comment for OpObserverImpl::writeToImageCollection()
Branch: master
https://github.com/mongodb/mongo/commit/f489033c0544267767fbf40ebbfe983bf527f592

Comment by Githook User [ 12/Jul/23 ]

Author:

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

Message: SERVER-78310 move change streams pre-image collection writes for unprepared transactions from OpObserverImpl to ChangeStreamPreImagesOpObserver
Branch: master
https://github.com/mongodb/mongo/commit/cb891c3541bc26d406b232daab8807bda70f9a67

Comment by Githook User [ 12/Jul/23 ]

Author:

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

Message: SERVER-78310 move change streams pre-image collection writes for prepared transactions from OpObserverImpl to ChangeStreamPreImagesOpObserver
Branch: master
https://github.com/mongodb/mongo/commit/aae006fa5ebf7f2cc8930710890b689a9ea5d32b

Comment by Githook User [ 11/Jul/23 ]

Author:

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

Message: SERVER-78310 move change streams pre-image collection writes for updates from OpObserverImpl to ChangeStreamPreImagesOpObserver
Branch: master
https://github.com/mongodb/mongo/commit/d2e9e4368f510624d4ba14d9f0e5757c97de401a

Comment by Githook User [ 11/Jul/23 ]

Author:

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

Message: SERVER-78310 move change streams pre-image collection writes for deletes from OpObserverImpl to ChangeStreamPreImagesOpObserver
Branch: master
https://github.com/mongodb/mongo/commit/d68ab97ae96896124b6e21c71ce0525796f1c634

Comment by Githook User [ 10/Jul/23 ]

Author:

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

Message: SERVER-78310 add stub ChangeStreamPreImagesOpObserver
Branch: master
https://github.com/mongodb/mongo/commit/ff153540925286e546ce29f77474810213b3fca2

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