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

rls: update picker synchronously upon receipt of configuration update #7212

Open
easwars opened this issue May 7, 2024 · 0 comments
Open
Assignees

Comments

@easwars
Copy link
Contributor

easwars commented May 7, 2024

#5469 recommends an audit of existing LB policies to ensure that they update their pickers synchronously upon receipt of a configuration update.

rls LB policy does not update its picker synchronously in one corner case.

  • Configuration updates are handled here:
    func (b *rlsBalancer) UpdateClientConnState(ccs balancer.ClientConnState) error {
  • The LB policy inhibits picker updates until the new configuration is pushed to all child policies. See:
    b.inhibitPickerUpdates = true
  • In a blocking fashion, it does the following
    • pushes updates to child policies
    • waits for picker updates from all the child policies
    • sends a new picker
    • See:
      b.updateCh.Put(resumePickerUpdates{done: done})
  • At the end of UpdateClientConnState, the LB policy handles any changes to the data cache size here:
    if resizeCache {
    • The return value from the resize operation is ignored here:
      b.dataCache.resize(newCfg.cacheSizeBytes)
    • The return value should not be ignored. Instead if any entry with a backoff timer was evicted, then it should result in a new picker being sent upwards.

Quoting this from the design:

When removing an entry whose backoff_time_ is in the future, the backoff timer 
will be cancelled.  Note that just like when the backoff timer fires normally, a new
 picker is returned to the channel, to force it to re-process any wait-for-ready RPCs
that may still be queued if we failed them while we were in backoff.
@aranjans aranjans self-assigned this May 8, 2024
@dfawley dfawley added the P2 label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants