kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 6ad6548d975cddfd606cf0442b24d2e4f323152d9dc35b92a099c12ab6e0a7fb |
|---|---|
| Author | Kevin Gallardo <kevin.gallardo@datastax.com> · 2015-06-05 12:13 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-06-22 15:55 +02:00 |
| Parents | b6818eac6aa3 |
3 files changed
modified changelog/README.md +1 −0
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | - [improvement] Suppress unnecessary warning at shutdown (JAVA-710) |
| 7 | 7 | - [improvement] Allow DNS name with multiple A-records as contact point (#340) |
| 8 | 8 | - [bug] Allow tracing across multiple result pages (JAVA-794) |
| 9 | +- [bug] DowngradingConsistencyRetryPolicy ignores write timeouts (JAVA-737) | |
| 9 | 10 | |
| 10 | 11 | Merged from 2.0.10_fixes branch: |
| 11 | 12 |
modified driver-core/src/main/java/com/datastax/driver/core/policies/DefaultRetryPolicy.java +1 −1
| @@ -83,7 +83,7 @@ | ||
| 83 | 83 | * the nodes in that subset were alive but the coordinator hasn't |
| 84 | 84 | * detected them as dead. By the time we get the timeout the dead |
| 85 | 85 | * nodes will likely have been detected as dead and the retry has thus a |
| 86 | - * high change of success. | |
| 86 | + * high chance of success. | |
| 87 | 87 | * |
| 88 | 88 | * @param statement the original query that timed out. |
| 89 | 89 | * @param cl the original consistency level of the write that timed out. |
modified driver-core/src/main/java/com/datastax/driver/core/policies/DowngradingConsistencyRetryPolicy.java +4 −4
| @@ -133,9 +133,9 @@ | ||
| 133 | 133 | * and at least one replica acknowledged, the write is retried with a |
| 134 | 134 | * lower consistency level (with unlogged batch, a write timeout can |
| 135 | 135 | * <b>always</b> mean that part of the batch haven't been persisted at |
| 136 | - * all, even if {@code receivedAcks > 0}). For other {@code writeType}, | |
| 137 | - * if we know the write has been persisted on at least one replica, we | |
| 138 | - * ignore the exception. Otherwise, an exception is thrown. | |
| 136 | + * all, even if {@code receivedAcks > 0}). For other {@code WriteType.SIMPLE} | |
| 137 | + * and {@code WriteType.BATCH} types, if we know the write has been persisted on at | |
| 138 | + * least one replica, we ignore the exception. Otherwise, an exception is thrown. | |
| 139 | 139 | * |
| 140 | 140 | * @param statement the original query that timed out. |
| 141 | 141 | * @param cl the original consistency level of the write that timed out. |
| @@ -156,7 +156,7 @@ | ||
| 156 | 156 | case SIMPLE: |
| 157 | 157 | case BATCH: |
| 158 | 158 | // Since we provide atomicity there is no point in retrying |
| 159 | - return RetryDecision.ignore(); | |
| 159 | + return requiredAcks > 0 ? RetryDecision.ignore() : RetryDecision.rethrow(); | |
| 160 | 160 | case UNLOGGED_BATCH: |
| 161 | 161 | // Since only part of the batch could have been persisted, |
| 162 | 162 | // retry with whatever consistency should allow to persist all |