Skip to content

Commit 25244e8

Browse files
committed
Document behavior change for zero speculative execution delay
JAVA-1490 breaks legacy policy implementations if they returned 0 to mean "no execution" (the workaround is to return a negative value instead).
1 parent 3ad44d7 commit 25244e8

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

driver-core/src/main/java/com/datastax/driver/core/policies/SpeculativeExecutionPolicy.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ interface SpeculativeExecutionPlan {
6666
*
6767
* @param lastQueried the host that was just queried.
6868
* @return the time (in milliseconds) before a speculative query is sent to the next host. If
69-
* negative, no speculative query will be sent. If zero it will immediately send the
70-
* execution.
69+
* negative, no speculative query will be sent. If zero, it will immediately send the
70+
* execution. <em>Note that, prior to version 3.3.1, zero meant "no speculative query", so
71+
* custom policies written at that time may now start to schedule more executions than
72+
* expected; make sure you use a negative value, not zero, to stop executions.</em>
7173
*/
7274
long nextExecution(Host lastQueried);
7375
}

upgrade_guide/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ you were accessing these methods using reflection in which case you need to
7979
account for these new parameter types.
8080

8181

82+
### 3.3.1
83+
84+
Speculative executions can now be scheduled without delay: if
85+
`SpeculativeExecutionPlan.nextExecution()` returns 0, the next execution will be fired immediately.
86+
This allows aggressive policies that hit multiple replicas right away, in order to get the fastest
87+
response possible. Note that this may break existing policies that used 0 to mean "no execution";
88+
make sure you use a negative value instead.
89+
90+
8291
### 3.2.0
8392

8493
The `SSLOptions` interface is now deprecated in favor of

0 commit comments

Comments
 (0)