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

Channel能否支持只重试SelectServer #2186

Closed
FancyJan opened this issue Mar 29, 2023 · 3 comments
Closed

Channel能否支持只重试SelectServer #2186

FancyJan opened this issue Mar 29, 2023 · 3 comments

Comments

@FancyJan
Copy link
Contributor

FancyJan commented Mar 29, 2023

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)
lalb在节点少的时候容易触发Fail to select server,可能与这个issue的部分触发条件一致 #699
触发条件:SelectServer按照加权随机选择到了最后一个节点,但是这个节点因为inflight delay可能会导致降权所以无法选择到,select失败。https://github.com/apache/brpc/blob/master/src/brpc/policy/locality_aware_load_balancer.h#L199

Describe the solution you'd like (描述你期望的解决方法)
ChannelOptions能否新增一个参数,表示lb select的重试次数。

  • 虽然现在已经有了max_retry这个参数,但这个参数可能会导致请求数放大,对于没有限流保护的下游可能会造成雪崩。
  • 我理解SelectServer应该是一个比较轻的操作,重试一般不会引入性能问题

Describe alternatives you've considered (描述你想到的折衷方案)
调整punish_inflight_ratio或者类似的参数,让惩罚不要太严重。

Additional context/screenshots (更多上下文/截图)

@wwbmmm
Copy link
Contributor

wwbmmm commented Mar 29, 2023

可以自定义 RetryPolicy

@FancyJan
Copy link
Contributor Author

大佬的意思是实现一个RetryPolicy,然后这个RetryPolicy只对EHOSTDOWN做重试吗?

@wwbmmm
Copy link
Contributor

wwbmmm commented Mar 29, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants