abenn135 commented on PR #1943:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1943#issuecomment-4454044134

   > Forgive me if this is me not following well, but what does "index" mean in 
this case? For example:
   >
   > * First attempt failed and RetryPolicy said to re-attempt
   
   First attempt:
   `Attempts: 0 SpeculativeExecutionCount: -1`
   
   > Second attempt taking longer than 
(gocql.SpeculativeExecutionPolicy).Delay()
   
   Second attempt:
   `Attempts: 1 SpeculativeExecutionCount: -1`
   
   > Assume (gocql.SpeculativeExecutionPolicy).Attempts() returns 2
   > Third attempt is a hedge and is taking longer than the delay
   
   Well, here you have two goroutines that might be executing concurrently. But 
the first hedge call will see `Attempts: 2 SpeculativeExecutionCount: 1`.
   
   > Fourth attempt is a hedge
   
   Again, each speculation spawns its own goroutine, so based on your 
description I think there may now be as many as three concurrent attempts. 
Either way, if the fourth attempt is another hedge, it would see `Attempts: 3 
SpeculativeExecutionCount: 2`
   
   Attempts is incremented each time `attemptQuery()` is called. It may 
increment due to any of:
   
   * per-host timeout or something (`GetRetryType()` returns `Retry`)
   * host says "go away" and we try the next eligible host (`GetRetryType()` 
returns `RetryNextHost`)
   * speculation attempts
   
   Maybe there is a better word than "index" here, but "index" pretty much 
describes "which speculation this is", i.e. is this the first speculative 
attempt/goroutine, the second, or so forth.
   
   I avoided zero to minimize confusion (customers might test on <0 or <=0 to 
test whether this is a non-speculative attempt) but if you'd like to start 
counting at 0 we can do that instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to