denis-chudov commented on code in PR #2585:
URL: https://github.com/apache/ignite-3/pull/2585#discussion_r1327300181
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -2527,34 +2524,33 @@ private CompletableFuture<BinaryRow>
resolveWriteIntentAsync(
/**
* Resolve the actual tx state.
*
- * @param commitGrpId Commit partition id.
* @param txId Transaction id.
+ * @param commitGrpId Commit partition id.
* @param timestamp Timestamp.
* @return The future completes with true when the transaction is not
completed yet and false otherwise.
*/
private CompletableFuture<Boolean> resolveTxState(
- TablePartitionId commitGrpId,
UUID txId,
+ TablePartitionId commitGrpId,
HybridTimestamp timestamp
) {
- boolean readLatest = timestamp == null;
-
- return transactionStateResolver.sendMetaRequest(commitGrpId,
FACTORY.txStateReplicaRequest()
- .groupId(commitGrpId)
- .readTimestampLong((readLatest ?
HybridTimestamp.MIN_VALUE : timestamp).longValue())
- .txId(txId)
- .build())
- .thenApply(txMeta -> {
- if (txMeta == null) {
- return true;
- } else if (txMeta.txState() == COMMITED) {
- return !readLatest &&
txMeta.commitTimestamp().compareTo(timestamp) > 0;
- } else {
- assert txMeta.txState() == ABORTED : "Unexpected
transaction state [state=" + txMeta.txState() + ']';
+ return transactionStateResolver.resolveTxState(txId, commitGrpId,
timestamp).thenApply(txMeta -> {
+ if (txMeta == null) {
+ return true;
Review Comment:
Added TODO with a link to https://issues.apache.org/jira/browse/IGNITE-20427
--
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]