-
Notifications
You must be signed in to change notification settings - Fork 107
Speculative execution fixes #979
Changes from 1 commit
e3c47c6
af8923b
8d06e78
dbb9bf6
6690299
3428869
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,7 +390,7 @@ func (s *Server) peerQuerySpeculative(ctx context.Context, data cluster.Traceabl | |
|
||
case <-tickChan: | ||
// Check if it's time to speculate! | ||
percentReceived := 1 - (float64(len(pendingResponses)) / float64(len(peerGroups))) | ||
percentReceived := float64(len(receivedResponses)) / float64(len(peerGroups)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's changing the logic, but it's actually making it correct, so that's good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the change in logic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this particular line should not change logic. but the line below it does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that was my analysis as well 👍 |
||
if percentReceived >= speculationThreshold { | ||
// kick off speculative queries to other members now | ||
ticker.Stop() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
pendingResponses
still worth anything? It seems superfluous. The current uses are:for len(pendingResponses) > 0
) which could befor len(receivedResponses) < len(peerGroups)
peerGroups
and continue if inrecievedResponses
.I'm not sure it's worth the extra allocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks