Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each read operation outside active transaction creates a special read only transaction and uses its tx snapshot for versions filtering.Each read operation within active READ_COMMITTED transaction creates a special read only transaction and uses its tx snapshot for versions filtering

RO transactions are added to active Tx lists on reader (near) node and MVCC coordinator.

On reaer node failure all RO txs are removed from the active Tx list on MVCC coordinator.

Each read operation within active REPEATABLE_READ transaction uses its tx snapshot for versions filtering (REPEATABLE_READ semantics).

During get operation the first passing MVCC filter item is returned.

During secondary indexes scans 'ver' field of tree item is checked, if row version is visible (the row was added by current or committed tx) 'xid_max' field of referenced data row is checked - the row considered as visible if it is the last version of row 'xid_max' is NA or ACTIVE or ABORTED or higher than assigned.

During primary indexes scans 'ver' field of tree item is checked, if row version is visible (the row was added by current or committed tx) 'xid_max' field of referenced data row is checked - the row considered as visible if it is the last version of row 'xid_max' is NA or ACTIVE or ABORTED or higher than assigned.

...

  1. obitain a lock (write current version into 'xid' field)
  2. add a row with new version.
  3. delete aborted versions of row if exist (may be omitted for performance reasons)
  4. update xid_max of previous committed row if exist
  5. delete previous committed versions (less or equal to cleanup version of tx snapshot) if exist (may be omitted for performance reasons)
  6. delete previous committed versions (less or equal to cleanup version of tx snapshot) if exist from all secondary indexes (may be omitted for performance reasons)
  7. add a row with new version to all secondary indexes.

Delete consists of next steps:

  1. obitain a lock (write current version into 'xid' field)
  2. delete aborted versions of row if exist (may be omitted for performance reasons)
  3. update xid_max of previous committed row if exist
  4. delete previous committed versions (less or equal to cleanup version of tx snapshot) if exist (may be omitted for performance reasons)

...