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

Implement tx coordination

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      This ticket implies the implementation of tx coordination, as described in [1].
      This includes:

      • TxManager - top-level manager for tx state and coordination
      • pre-writes - each tx write is pre-written to partition store in special format
      • replicated tx state - tx state is stored in the partition's raft group
      • integration with lock manager (see precaution chapter in [1])

      The example of single key tx:

      Tx client               TxCoordinator                                               Partition leaseholder.    
      tx.start
                  --------->  
      			assign timestamp (id)
      		        txstate = PENDING
                  <---------		   	               
      table.put(k,v)   
                  --------->   
                              enlist(partition(k));
      			lh = getLeaseholder(partition(k))
                              send UpsertCommand(k) to lh
      				                                      ------------>
                                                                                           replicate txstate = PENDING
                                                                                           lockManager.tryAcquire(k,timestamp);
                                                                                           wait for completion async
                                                                                           prewrite(k, v) -- replicate to all replicas
                              repeat for each enlisted partition...
                  <---------
      tx.finish - commit or rollback
                  --------->  
                              send finish request to all remote enlisted nodes
                                                                            ------------>
                                                                                           replicate txstate = COMMITTED/ABORTED
                              txState = COMMITTED/ABORTED                                  lockManager.tryRelease(k, timestamp)
      							              <------------ 
                              		
      			when all leasholders are replied,
      			reply to initiator
      	    <--------	
      

      [1] https://github.com/apache/ignite-3/tree/main/modules/transactions

      Attachments

        Issue Links

          Activity

            People

              ascherbakov Alexey Scherbakov
              ascherbakov Alexey Scherbakov
              Alexander Lapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 10.5h
                  10.5h