[
https://issues.apache.org/jira/browse/CASSANDRA-17653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17557300#comment-17557300
]
Berenguer Blasi commented on CASSANDRA-17653:
---------------------------------------------
bq. can lead us to the wrong direction if the 2 calls return different results.
Correct but the alternative is to pollute and maybe release the
{{isUpgradingFromVersionLowerThan()}} method with test debug msgs. I prefer to
try my luck on getting a lucky test run that logs what I need. Sounds
reasonable?
bq. within the synchronized block in the get method expirationNanos will always
be equals to {{ nanos}} as it cannot be equals to zero
Unless an expiration happens setting it to 0, where it will not meet the if and
return the memoized value. Leaving everything ready for the next get() to
refresh the memoized value.
bq. expire is setting expirationNanos outside of a synchronize block
Isn't all this part of the expiration + double check locking logic?
- Non-memoized instances will always have a 0, meet {{if (nanos ==
this.expirationNanos)}} and return the non-emoized value always
- Memoized instances might get an unlucky expiration breaking the if where they
will return the memoized value. The next get will force a refresh of the
memoized value.
Iiuc the only hole I see if we might be swallowing expires() when overwriting
{{expirationNanos}} inside the sync block. Geeting expire() inside a sync block
should suffice, do you agree?
> Fix flaky test -
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.testConditionalUpdate[0:
> clusterMinVersion=3.0]
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CASSANDRA-17653
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17653
> Project: Cassandra
> Issue Type: Bug
> Components: Test/dtest/java
> Reporter: Brandon Williams
> Assignee: Berenguer Blasi
> Priority: Normal
> Fix For: 4.1-beta, 4.1.x
>
>
> {code}
> junit.framework.AssertionFailedError
> at
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.lambda$data$0(InsertUpdateIfConditionTest.java:64)
> at
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.beforeSetup(InsertUpdateIfConditionTest.java:90)
> at
> org.apache.cassandra.cql3.validation.operations.InsertUpdateIfConditionTest.before(InsertUpdateIfConditionTest.java:84)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
> https://ci-cassandra.apache.org/job/Cassandra-4.1/34/testReport/org.apache.cassandra.cql3.validation.operations/InsertUpdateIfConditionTest/testConditionalUpdate_0__clusterMinVersion_3_0__3/
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]