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

Implement durable unlock on primary partition re-election

    XMLWordPrintableJSON

Details

    Description

      Motivation

      It's required to release all acquired locks on transaction finish in a durable way. Such durability consists of two parts:

      • Durable unlock within same primary.
      • Durable unlock on primary change.

      This ticket is about second part only. There's a counterpart ticket for the first part IGNITE-20004

      Definition of Done

      • All unreleased locks for the transactions that were finished are released in case of primary re-election, including old primary failure and cluster restart.

      Implementation Notes

      • We may start with adding onPrimaryElected callback.
      • Within this callback, it's required to scan `org.apache.ignite.internal.tx.storage.state.TxStateStorage#scan` local TxStateStorage and call `org.apache.ignite.internal.tx.TxManager#cleanup` for all transactions that have false in TxMeta.locksReleased. TxManager#cleanup is an idempotent operation, thus it's safe to run it multiple time, even from different nodes, e.g. old primary and new primary.
      • It's required to add locksReleased field to TxMeta with default value false.
      • It's required to set locksReleases to true when all cleanup txCleanupReplicaRequest returns successfully. That extra "updateTxnState(locksReleased == true) should be asynchronous.
      • Tests will be non-trivial here, because it'll be required to kill old primary after txnStateChanged but before sending cleanup request.

       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m