[SERVER-64215] Interrupt OplogBufferMock::waitForData on shutdown Created: 04/Mar/22  Updated: 29/Oct/23  Resolved: 05/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0, 5.0.10

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: testing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-03-07
Participants:

 Description   

tenant_oplog_applier_test takes ~36 seconds to run. This slowness is due to the shutdown & join of the TenantOplogApplier that is done at the end of every test case.

In particular as part of the shutdown of the TenantOplogApplier we shutdown also the underlying _oplogBatcher.

The problem is that when we shutdown the TenantOplogBatcher, the batcher won't actually move to the kComplete state until the last call to _oplogBuffer->waitForData(Seconds(1)) complete.
So practically every time a test case end it will block 1 seconds waiting to join the TenantOplogApplier.

In order to reduce this delay we should shutdown the oplogBuffer before to join the TenantOplogApplier that is using it and make that this shoutdown interrupts also the waiForData function.

With the proposed changes the test run time drop from ~36 seconds to ~2 seconds.



 Comments   
Comment by Githook User [ 22/Jun/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-64215 Interrupt OplogBufferMock::waitForData on shutdown

(cherry picked from commit a66c6e95cda3a4bdb8a3ab2e5f253c4635a6dd5b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/4ea21c1a749099fca07cad1fa5d76c0acaa4b030

Comment by Matthew Russotto [ 14/Jun/22 ]

The oplog buffer changes (allowing shutdown to interrupt oplog buffer wais) were backported to make SERVER-65723 backport cleanly.

Comment by Githook User [ 04/Mar/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-64215 Interrupt OplogBufferMock::waitForData on shutdown
Branch: master
https://github.com/mongodb/mongo/commit/a66c6e95cda3a4bdb8a3ab2e5f253c4635a6dd5b

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