10000 JAVA-1247: Disable idempotence warnings (#810) · kecmu/java-driver@0dbfaab · GitHub
[go: up one dir, main page]

Skip to content

Commit 0dbfaab

Browse files
adutraolim7t
authored andcommitted
JAVA-1247: Disable idempotence warnings (apache#810)
In 3.1.0, we added a warning when the first non-idempotent statement is not retried (see JAVA-1225), as a way to ease the transition to the new behavior. By 3.2.0 users should be more familiar with this, so this commit removes the warning.
1 parent dfbdcbe commit 0dbfaab

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

changelog/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [improvement] JAVA-1287: Add CDC to TableOptionsMetadata and Schema Builder.
1414
- [improvement] JAVA-1392: Reduce lock contention in RPTokenFactory.
1515
- [improvement] JAVA-1328: Provide compatibility with Guava 20.
16+
- [improvement] JAVA-1247: Disable idempotence warnings.
1617

1718
Merged from 3.1.x branch:
1819

driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
import java.util.Iterator;
3535
import java.util.List;
3636
import java.util.Set;
37-
import java.util.concurrent.*;
37+
import java.util.concurrent.ConcurrentHashMap;
38+
import java.util.concurrent.ConcurrentMap;
39+
import java.util.concurrent.CopyOnWriteArrayList;
40+
import java.util.concurrent.TimeUnit;
3841
import java.util.concurrent.atomic.AtomicBoolean;
3942
import java.util.concurrent.atomic.AtomicInteger;
4043
import java.util.concurrent.atomic.AtomicReference;
@@ -45,7 +48,6 @@
4548
*/
4649
class RequestHandler {
4750
private static final Logger logger = LoggerFactory.getLogger(RequestHandler.class);
48-
private static final AtomicBoolean WARNED_IDEMPOTENT = new AtomicBoolean();
4951

5052
final String id;
5153

@@ -377,7 +379,6 @@ private RetryPolicy.RetryDecision computeRetryDecisionOnRequestError(DriverExcep
377379
if (statement.isIdempotentWithDefault(manager.cluster.getConfiguration().getQueryOptions())) {
378380
decision = retryPolicy().onRequestError(statement, request().consistency(), exception, retriesByPolicy);
379381
} else {
380-
logIdempotenceWarning();
381382
decision = RetryPolicy.RetryDecision.rethrow();
382383
}
383384
if (metricsEnabled()) {
@@ -537,7 +538,6 @@ public void onSet(Connection connection, Message.Response response, long latency
537538
wte.getReceivedAcknowledgements(),
538539
retriesByPolicy);
539540
else {
540-
logIdempotenceWarning();
541541
retry = RetryPolicy.RetryDecision.rethrow();
542542
}
543543
if (metricsEnabled()) {
@@ -800,15 +800,6 @@ private void setFinalResult(Connection connection, Message.Response response) {
800800
}
801801
}
802802

803-
private void logIdempotenceWarning() {
804-
if (WARNED_IDEMPOTENT.compareAndSet(false, true))
805-
logger.warn("Not retrying statement because it is not idempotent (this message will be logged only once). " +
806-
"Note that this version of the driver changes the default retry behavior for non-idempotent " +
807-
"statements: they won't be automatically retried anymore. The driver marks statements " +
808-
"non-idempotent by default, so you should explicitly call setIdempotent(true) if your statements " +
809-
"are safe to retry. See http://goo.gl/4HrSby for more details.");
810-
}
811-
812803
/**
813804
* The state of a SpeculativeExecution.
814805
* <p/>

upgrade_guide/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ are now deprecated in favor of `RemoteEndpointAwareJdkSSLOptions`
1313
and `RemoteEndpointAwareNettySSLOptions` respectively (see
1414
[JAVA-1364](https://datastax-oss.atlassian.net/browse/JAVA-1364)).
1515

16+
In 3.1.0, the driver would log a warning the first time it would skip
17+
a retry for a non-idempotent request; this warning has now been
18+
removed as users should now have adjusted their applications accordingly.
19+
1620

1721
### 3.1.0
1822

0 commit comments

Comments
 (0)
0