Alexander Lapin created IGNITE-17582:
----------------------------------------

             Summary: Introduce mutipleReplica ReplicaRequests together with 
grouped TxCleanupReplicaRequest processing
                 Key: IGNITE-17582
                 URL: https://issues.apache.org/jira/browse/IGNITE-17582
             Project: Ignite
          Issue Type: Improvement
            Reporter: Alexander Lapin


h3. Motivation

Within the scope of tx commit process, enlisted partitions are grouped together 
by primary replica cluster node, however during the tx finish processing brand 
new TxCleanupReplicaRequest is sent to each partition even colocated ones 
within same cluster node:

 
{code:java}
public CompletableFuture<Void> cleanup(
        ClusterNode recipientNode,
        List<String> replicationGroupIds,
        UUID txId,
        boolean commit,
        HybridTimestamp commitTimestamp
) {
    // TODO: sanpwc create ticket for grouping replica requests.
    replicationGroupIds.forEach(groupId -> {
        try {
            replicaService.invoke(
                    recipientNode,
                    FACTORY.txCleanupReplicaRequest()
                            .groupId(groupId)
                            .txId(txId)
                            .commit(commit)
                            .commitTimestamp(commitTimestamp)
                            .build()
            );
        } catch (NodeStoppingException e) {
            throw new TransactionException("Failed to perform tx cleanup, node 
is stopping.");
        }
    });

    return null;
} {code}
Seems that we may introduce multipleReplicationGroups in addition to single 
ones that we already have in order to perform such collocated based requests.

 
h3. Definition of Done
 * General solution for groupping collocated replica requests is introduced.
 * TxCleanupReplicaRequests are grouped on recipient node basis.

h3. Implementation Notes

Generally speaking, it's required to:
 * Introduce new interface  MutipleReplicasReplicaRequest with 
Collection<String> groupsId() in addition to already existing ReplicaRequest 
with single String groupId();
 * Implement proper multiple replicas fun out and result aggrigation(including 
expcetion handling) within 
org.apache.ignite.network.NetworkMessageHandler#onReceived
 * Send such new TxCleanupReplicaRequests one per cluster node instead of one 
per replica, in other words rework 
org.apache.ignite.internal.tx.impl.TxManagerImpl#cleanup 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to