Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-20005

Move commitTimestamp generation to the txn coordinator side.

    XMLWordPrintableJSON

Details

    Description

      Motivation

      Please check the context in IGNITE-20033 and IGNITE-20034

      After implemention writeIntentResolution coordinator path it'll be nessessary to move commitTimestamp generation to the txn coordinator side.

      Definition of Done

      • Easy-breezy, calculate commitTimestamp as coordinator.now().

      Implementation Notes

      Nothing to update on the "client" side, we already have everything we need.

      public CompletableFuture<Void> finish() {
          ...
          HybridTimestamp commitTimestamp = commit ? clock.now() : null;
      
          TxFinishReplicaRequest req = FACTORY.txFinishReplicaRequest()
                   ...
                  .commitTimestampLong(hybridTimestampToLong(commitTimestamp)) // 2
         ...
      } 

      On the "server" side, we will adjust and simplify code in org.apache.ignite.internal.table.distributed.replicator.PartitionReplicaListener#finishTransaction

      private CompletableFuture<Object> finishTransaction(List<TablePartitionId> aggregatedGroupIds, UUID txId, boolean commit) {
          // TODO: IGNITE-17261 Timestamp from request is not using until the issue has not been fixed (request.commitTimestamp())
          var fut = new CompletableFuture<TxMeta>();
      
          txTimestampUpdateMap.put(txId, fut);
      
          HybridTimestamp currentTimestamp = hybridClock.now();
          HybridTimestamp commitTimestamp = commit ? currentTimestamp : null; 

      Attachments

        Issue Links

          Activity

            People

              Denis Chudov Denis Chudov
              alapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: