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

Quorum-based Series() query short circuit #137

Open
wants to merge 4 commits into
base: db_main
Choose a base branch
from

Conversation

yuchen-db
Copy link

cancel the last store if all other stores returns no error

@yuchen-db yuchen-db requested review from jnyi and hczhu-db March 7, 2025 02:37
Copy link
Collaborator

@hczhu-db hczhu-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@@ -655,6 +665,9 @@ func newEagerRespSet(
resp, err := cl.Recv()
if err != nil {
if err == io.EOF {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also check if this is response stream is canceled by another stream because the quorum is reached.

if err == context.Canceled {
  log something

@@ -665,6 +678,8 @@ func newEagerRespSet(
<-t.C // Drain the channel if it was already stopped.
}
rerr = errors.Wrapf(err, "failed to receive any data in %s from %s", l.frameTimeout, storeName)
} else if qg != nil && qg.counter.Load() >= qg.quorum {
rerr = errors.Wrapf(err, "quorum reached and canceled %s", storeName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better error message .. cancelled all other pending response streams.

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

Successfully merging this pull request may close these issues.

2 participants