[SERVER-76271] Remove OpObserverShardingImpl Dependency on OpObserverImpl Created: 19/Apr/23  Updated: 29/Oct/23  Resolved: 05/Jun/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: Matt Kneiser Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-76369 Accumulate state among early OpObservers Closed
Related
related to SERVER-66612 Split up OpObserverImpl Open
related to SERVER-77121 move OpObserverShardingImpl::isMigrat... Closed
related to SERVER-77157 move OpObserverShardingImpl::assertIn... Closed
related to SERVER-77258 move assertNoMovePrimaryInProgress() ... Closed
related to SERVER-77284 move OpObserverShardingImpl multi-doc... Closed
related to SERVER-77366 add OpAccumulator to OpObserver::abou... Closed
related to SERVER-77418 restrict ShardingWriteRouter scope in... Closed
related to SERVER-77482 move OpObserverShardingImpl::shardObs... Closed
related to SERVER-77484 migrate OperationContext decorations ... Closed
related to SERVER-77731 merge OpStateAccumulator and InsertsO... Closed
is related to SERVER-74121 Streamline logical branches in opObse... Backlog
is related to SERVER-49086 Fail with MovePrimaryInProgress error... Closed
is related to SERVER-36084 Remove sharding runtime from embedded Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2023-05-29, Execution Team 2023-06-12
Participants:

 Description   

OpObserverShardingImpl inherits from OpObserverImpl, yet doesn't override any methods, it also has OpObserverImpl (its parent) aware of and calling into child methods. This breaks many aspects of good design and modularity.

 

For sharded nodes, OpObserverImpl should be registered and perform its usual behavior explicitly.

For the few actual dependencies on OpTime acquisition in OpObserverImpl, OpObserverImpl will call into OpObserverShardingImpl which will no longer be a child class.



 Comments   
Comment by Githook User [ 04/Jun/23 ]

Author:

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

Message: SERVER-76271 remove OpObserverShardingImpl

All the functionnality in this class has been moved to MigrationChunkClonerSourceOpObserver.
Branch: master
https://github.com/mongodb/mongo/commit/81f7b92ba4125b350cdddea253cddb578884f71f

Comment by Githook User [ 04/Jun/23 ]

Author:

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

Message: SERVER-76271 move OpObserverShardingImpl::shardObserveInsertOps() logic to MigrationChunkClonerSourceOpObserver

Co-authored-by: Matt Kneiser <matt.kneiser@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/18170b4af4909fa31fe49f8ee3a5abbce0757e0d

Comment by Githook User [ 04/Jun/23 ]

Author:

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

Message: SERVER-76271 move OpObserverShardingImpl::shardObserveUpdateOp() logic to MigrationChunkClonerSourceOpObserver

Co-authored-by: Matt Kneiser <matt.kneiser@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/5525c0d66609d4b57c3c615ec47a46bb871f6dfc

Comment by Githook User [ 03/Jun/23 ]

Author:

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

Message: SERVER-76271 support passing ShardingWriteRouter between OpObserver callbacks as an op accumulator decoration
Branch: master
https://github.com/mongodb/mongo/commit/73e94842afb1d7b71324c66aa431fd965a7ddeea

Comment by Githook User [ 03/Jun/23 ]

Author:

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

Message: SERVER-76271 defer retrieving doc key in MigrationChunkClonerSourceOpObserver::onDelete()
Branch: master
https://github.com/mongodb/mongo/commit/87d48e1143964aee16f069d950c29ca4c04d0825

Comment by Githook User [ 03/Jun/23 ]

Author:

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

Message: SERVER-76271 migrate op_observer_util.h from mongo::repl to mongo namespace
Branch: master
https://github.com/mongodb/mongo/commit/1d0be827e37742b931076d71033305e196fd1199

Comment by Benety Goh [ 11/May/23 ]

Thanks for the suggestion. We will take that into account as we try to simplify the current structure. The current state is not ideal either.

Comment by Kaloian Manassiev [ 10/May/23 ]

Given that we will not have "non-sharded" nodes why bother with decoupling these libraries at all rather than putting them in the same library?

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