rpuch commented on code in PR #5209:
URL: https://github.com/apache/ignite-3/pull/5209#discussion_r1988981790
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxManagerImpl.java:
##########
@@ -1110,7 +1110,7 @@ private CompletableFuture<Void> verifyCommitTimestamp(
currentPrimaryReplica
);
} else {
- assert
commitTimestamp.compareTo(currentPrimaryReplica.getExpirationTime()) <= 0 :
+ assert
commitTimestamp.compareTo(currentPrimaryReplica.getExpirationTime()) <=
USE_CONFIGURED_TIMEOUT_DEFAULT :
Review Comment:
This change also needs to be reverted
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/PublicApiThreadingTransaction.java:
##########
@@ -151,7 +151,7 @@ public long getTimeout() {
@Override
public long getTimeoutOrDefault(long defaultTimeout) {
- return getTimeout() == 0 ? defaultTimeout : getTimeout();
+ return getTimeout() == USE_CONFIGURED_TIMEOUT_DEFAULT ? defaultTimeout
: getTimeout();
Review Comment:
Why doesn't it just delegate to the wrapped tx's `getTimeoutOrDefault()`?
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxManagerImpl.java:
##########
@@ -525,12 +525,12 @@ private static long
physicalExpirationTimeMillis(HybridTimestamp beginTimestamp,
}
private static long sumWithSaturation(long a, long b) {
- assert a >= 0 : a;
- assert b >= 0 : b;
+ assert a >= USE_CONFIGURED_TIMEOUT_DEFAULT : a;
+ assert b >= USE_CONFIGURED_TIMEOUT_DEFAULT : b;
long sum = a + b;
- if (sum < 0) {
+ if (sum < USE_CONFIGURED_TIMEOUT_DEFAULT) {
Review Comment:
In this code, 0 means just zero (it's an arithmetic operation), so this
change should probably be reverted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]