Skip to content
Snippets Groups Projects
  • Vladislav Shpilevoy's avatar
    77fa1736
    box: factor fiber_gc out of txn_commit · 77fa1736
    Vladislav Shpilevoy authored
    Now txn_commit is judge, jury and executioner. It both
    commits and rollbacks data, and collects it calling fiber_gc,
    which destroys the region.
    
    But SQL wants to use some transactional data after commit. It is
    autogenerated identifiers - a list of sequence values generated
    for autoincrement columns and explicit sequence:next() calls.
    
    It is possible to store the list on malloced mem inside Vdbe, but
    it complicates deallocation. Much more convenient to store all
    transactional data on the transaction memory region, so it would
    be freed together with fiber_gc.
    
    After this patch applied, Vdbe takes care of txn memory
    deallocation in a finalizer routine. Between commit and
    finalization transactional data can be serialized wherever.
    
    Needed for #2618
    77fa1736
    History
    box: factor fiber_gc out of txn_commit
    Vladislav Shpilevoy authored
    Now txn_commit is judge, jury and executioner. It both
    commits and rollbacks data, and collects it calling fiber_gc,
    which destroys the region.
    
    But SQL wants to use some transactional data after commit. It is
    autogenerated identifiers - a list of sequence values generated
    for autoincrement columns and explicit sequence:next() calls.
    
    It is possible to store the list on malloced mem inside Vdbe, but
    it complicates deallocation. Much more convenient to store all
    transactional data on the transaction memory region, so it would
    be freed together with fiber_gc.
    
    After this patch applied, Vdbe takes care of txn memory
    deallocation in a finalizer routine. Between commit and
    finalization transactional data can be serialized wherever.
    
    Needed for #2618