[SERVER-8099] use condition instead of hard loop for SSV waiting for critical section to finish Created: 07/Jan/13 Updated: 11/Jul/16 Resolved: 07/Jan/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | 2.3.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
The setShardVersion command makes sure that the mongod isn't in the critical section before running. If it is in the critical section, it blocks until the critical section terminates. In 2.2 and prior we go into a loop, releasing and re-acquiring the global write lock until we are no longer in the critical section. Instead, we should block on a condition variable that we notify on when the critical section has terminated. |
| Comments |
| Comment by Spencer Brody (Inactive) [ 07/Jan/13 ] |
|
https://github.com/mongodb/mongo/commit/f08ff7bfc7fd4eb3f2e7d73625520221773c9f72 - use condition instead of hard loop for critical section. |