[SERVER-75438] Persist rename coordinator document only after checking preconditions Created: 29/Mar/23 Updated: 19/Apr/23 Resolved: 19/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Pierlauro Sciarelli | Assignee: | Marcos José Grillo Ramirez |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | shardingemea-qw | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Sharding EMEA
|
| Sprint: | Sharding EMEA 2023-05-01 |
| Participants: | |
| Story Points: | 6 |
| Description |
|
The first checks part of the check precondition phase can be performed before even persisting the coordinator document similarly to the way the drop collection coordinator checks for preconditions. |
| Comments |
| Comment by Marcos José Grillo Ramirez [ 19/Apr/23 ] |
|
pierlauro.sciarelli@mongodb.com after having another look at the code, you're right, we need an steady state shard to perform the checks, closing this as won't do. |
| Comment by Marcos José Grillo Ramirez [ 18/Apr/23 ] |
|
pierlauro.sciarelli@mongodb.com I think we could move some of the checks to the command as a fast path check to fail early, we've used this pattern before, specially when we can fail early before holding locks or doing expensive operations. |
| Comment by Pierlauro Sciarelli [ 18/Apr/23 ] |
|
I just realized that it is not possible to check the preconditions BEFORE persisting the coordinator document because we may end up not releasing the target critical section in case of crashes. Given that, I believe we should close this ticket also because it's a very tiny and irrelevant performance improvement. |