denis-chudov commented on a change in pull request #709:
URL: https://github.com/apache/ignite-3/pull/709#discussion_r823492625
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/causality/VersionedValue.java
##########
@@ -228,19 +276,21 @@ public void fail(long causalityToken, Throwable
throwable) {
public T update(long causalityToken, Function<T, T> complete,
Function<Throwable, T> fail) {
long actualToken0 = actualToken;
- assert actualToken0 + 1 == causalityToken :
IgniteStringFormatter.format("Token must be greater than actual by exactly 1 "
- + "[token={}, actual={}]", causalityToken, actualToken0);
+ assert actualToken0 == NOT_INITIALIZED || actualToken0 + 1 ==
causalityToken : IgniteStringFormatter.format(
+ "Token must be greater than actual by exactly 1 [token={},
actual={}]", causalityToken, actualToken0);
Entry<Long, CompletableFuture<T>> histEntry =
history.floorEntry(actualToken0);
- CompletableFuture<T> previousFuture = histEntry.getValue();
+ CompletableFuture<T> previousFuture = histEntry == null ?
CompletableFuture.completedFuture(getDefault()) : histEntry.getValue();
Review comment:
seems that we need `previousFuture` inly when `hasUpdatedValue == false`
--
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]