[SERVER-27112] add a forceReload method to ShardRegistry to encompass current if (!reload()) { reload() } pattern Created: 18/Nov/16  Updated: 19/Jan/17  Resolved: 19/Jan/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.0-rc3
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Sharding 2017-01-02
Participants:

 Description   

If a reload is in progress from another thread when ShardRegistry::reload() is called, the later ShardRegistry::reload() joins the current one.

Once the current reload completes, the later call returns false to indicate that it did not perform its own reload.

This leads to using the pattern:

if (!Grid::get(txn)->shardRegistry()->reload(txn)) {
    // If the first reload joined an existing one, call reload again to ensure the reload is fresh.
    Grid::get(txn)->shardRegistry()->reload(txn);
}

This pattern should be encompassed in a forceReload() method on the ShardRegistry.



 Comments   
Comment by Andy Schwerin [ 19/Jan/17 ]

There's only one caller of this pattern, now. It's fine.

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