[SERVER-68851] Remove wait for collection critical section from service entry point Created: 16/Aug/22  Updated: 29/Oct/23  Resolved: 23/Aug/22

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

Type: Task Priority: Major - P3
Reporter: Allison Easton Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-56304 Log time CRUD operations spend waitin... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-08-22, Sharding EMEA 2022-09-05
Participants:

 Description   

Currently, on stale shard version on the shard, if the collection critical section is held, the shard will wait for the critical section to complete and then return stale shard version. This makes tracking the time spent in the critical section and during refreshes harder because there is a wait for the critical section outside of the onShardVersionMismatch function.

In order to make timing this region simpler, we can remove this extra wait for critical section and rely on those in onShardVersionMismatch.



 Comments   
Comment by Githook User [ 23/Aug/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-68851 Remove wait for collection critical section from service entry point
Branch: master
https://github.com/mongodb/mongo/commit/7b72555ab5c89dd4554ae1f4c7be06217e9b9de7

Comment by Allison Easton [ 18/Aug/22 ]

Currently we are returning to the router immediately after the wait in the service entry point. So you would only hit one, so there wouldn't be a noop.

The difference for accounting purposes is that we currently aren't measuring the one in the service entry point. The measuring is in the onShardVersionMismatch function.

Comment by Kaloian Manassiev [ 17/Aug/22 ]

This is a good cleanup (assuming that all SSV errors reach to the onShardVersionMismatch function). However, just curious wouldn't one of the two waits be a no-op if the first one waited? I.e., does it matter for accounting purposes?

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