Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: join peer list only after refinery is ready to accept traffic #1309

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Sep 4, 2024

Which problem is this PR solving?

Currently, Refinery announces its presence to peers immediately upon startup. This causes the sharding algorithm to direct other peers to forward traces to the newly added Refinery instance, even though it might not be ready to process them. As a result, any spans forwarded before the Refinery is fully operational are lost. This fix ensures that Refinery only announces itself to peers once it is fully ready to accept and process traffic, preventing any loss of spans during startup.​

Alternatives:
I have tried to use the health module as a signal to indicate when the router is ready for the peers module. However, due to the way the injection library works, the router starts after the peers module. As a result, when peers checks in with the health system, the router may not have registered itself yet. This can cause IsReady to return true prematurely, before the router is included in the health checks.

Short description of the changes

  • Add a Ready method on Peers
  • call Peers.Ready() once all components have started

@VinozzZ VinozzZ requested a review from a team as a code owner September 4, 2024 00:48
@VinozzZ VinozzZ self-assigned this Sep 4, 2024
@VinozzZ VinozzZ added the type: bug Something isn't working label Sep 4, 2024
@VinozzZ VinozzZ added this to the v2.8 milestone Sep 4, 2024
@VinozzZ VinozzZ force-pushed the yingrong.only_join_peer_list_when_refinery_is_ready branch from 8eb881f to 6273eac Compare September 4, 2024 00:48
@VinozzZ VinozzZ merged commit 5c27d84 into main Sep 4, 2024
5 checks passed
@VinozzZ VinozzZ deleted the yingrong.only_join_peer_list_when_refinery_is_ready branch September 4, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants