[SERVER-38298] ReplicationCoordinator::awaitReplication should fail with correct error if called on a non-primary node Created: 28/Nov/18 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | William Schultz (Inactive) | Assignee: | Backlog - Replication Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | gm-ack, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Replication
|
| Operating System: | ALL |
| Participants: |
| Description |
|
The comments of ReplicationCoordinator::awaitReplication indicate that a NotMaster error code should be returned if called on a node that is not in primary state. The method's logic, however, does not align with this. If called from a secondary, the method will trivially fail with a PrimarySteppedDown error message, which seems incorrect. We should fix this and make sure to clarify this method's pre-condition i.e. that it is only valid to call it on a primary node, if that is the intended behavior. |
| Comments |
| Comment by Tess Avitabile (Inactive) [ 15/Jan/20 ] |
|
Leaving this ticket as-is, since it's a neweng ticket. |
| Comment by Siyuan Zhou [ 27/Sep/19 ] |
|
Thanks! My understanding of this ticket is to change the error code instead of the comments, so I'd prefer to leave this ticket as-is for now. |
| Comment by Lingzhi Deng [ 26/Sep/19 ] |
|
No, it is not covered. I didn't change any error code handling. But I can do that if all we want is to change the comment. |
| Comment by Siyuan Zhou [ 26/Sep/19 ] |
|
ldeng, do you think this is covered by your work? |
| Comment by Gregory McKeon (Inactive) [ 03/Dec/18 ] |
|
We should make sure the PrimarySteppedDown error code is the correct one to use and update the comments to indicate that this isn't intended to be called from a secondary. |
| Comment by William Schultz (Inactive) [ 28/Nov/18 ] |
|
The ReplicationCoordinatorImpl::waitUntilOpTimeForRead methods appear to serve an analogous purpose for secondary reads, though perhaps in the future it would be worth combining these interfaces into something that serves both purposes. |