kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 109fb4626797e1f0db1d805b9b3c55d1c0d09d42d5ae1efbc45d906e43e7190e |
|---|---|
| Author | Alexandre Dutra <alexdut@gmail.com> · 2015-06-19 17:30 +02:00 |
| Committer | Alexandre Dutra <alexdut@gmail.com> · 2015-06-19 17:30 +02:00 |
| Parents | c414999e47ea, dacbafbfe74b |
2 files changed
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 write types ({@code WriteType.SIMPLE} | |
| 137 | + * and {@code WriteType.BATCH}), 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 |