Cyrill commented on code in PR #3540:
URL: https://github.com/apache/ignite-3/pull/3540#discussion_r1559036134
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxManagerImpl.java:
##########
@@ -329,20 +334,35 @@ public TxManagerImpl(
new TxCleanupRequestSender(txMessageSender,
placementDriverHelper, txStateVolatileStorage);
}
- private CompletableFuture<Boolean>
primaryReplicaEventListener(PrimaryReplicaEventParameters eventParameters) {
+ private CompletableFuture<Boolean> primaryReplicaEventListener(
+ PrimaryReplicaEventParameters eventParameters,
+ Consumer<TablePartitionId> action
+ ) {
return inBusyLock(busyLock, () -> {
if (!(eventParameters.groupId() instanceof TablePartitionId)) {
return falseCompletedFuture();
}
TablePartitionId groupId = (TablePartitionId)
eventParameters.groupId();
- transactionInflights.cancelWaitingInflights(groupId);
+ action.accept(groupId);
return falseCompletedFuture();
});
}
+ private CompletableFuture<Boolean>
primaryReplicaElectedListener(PrimaryReplicaEventParameters eventParameters) {
+ return primaryReplicaEventListener(eventParameters, groupId -> {
Review Comment:
The busylock is actually used in primaryReplicaEventListener, no need to
have it twice
--
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]