Assume snapshot isolation unless otherwise noted. * Basic Timestamp - Single | Session | |----------------------| | Begin | | Write A 1 | | Commit :commit 10 | | | | Begin :readAt 9 | | Read A (NOT_FOUND) | | Rollback | | | | Begin :readAt 10 | | Read A (1) | * Basic Timestamp - Multiple | Session | |----------------------| | Begin | | Timestamp :commit 10 | | Write A 1 | | Timestamp :commit 20 | | Write A 2 | | Commit | | | | Begin :readAt 10 | | Read A (1) | | Rollback | | | | Begin :readAt 20 | | Read A (2) | * Insert | Session | |------------------------| | Begin | | Write A 1 | | Timestamp :commit 10 | | Write Oplog | | Commit | | | | Begin :readAt 9 | | Read A (NOT_FOUND) | | Read Oplog (NOT_FOUND) | | Rollback | | | | Begin :readAt 10 | | Read A (1) | | Read Oplog (FOUND) | * Bad Composition (WT Behavior, erroring/crashing also acceptable?) | Session | |----------------------| | Begin | | Write A 1 | | Timestamp :commit 10 | | Write B 1 | | Timestamp :commit 20 | | Write C 1 | | Commit | | | | Begin :readAt 10 | | Read A (NOT_FOUND) | | Read B (1) | | Read C (NOT_FOUND) | | Rollback | | | | Begin :readAt 20 | | Read A (1) | | Read B (1) | | Read C (1) | * WriteConflict - Read timestamp hides visibility | Session | |--------------------| | Begin | | Write A 1 | | Commit :commit 10 | | | | Begin :readAt 9 | | Read A (NOT_FOUND) | | Write A 1 (WCE) | * Concurrent operations under snapshot isolation blocks visibility | Session 1 | Session 2 | |-------------------+--------------------------------------| | Begin | | | | Begin :readAt 20 :isolation snapshot | | Write A 1 | | | Commit :commit 10 | | | | Read A (NOT_FOUND) | * Commit behind stable | Session | GlobalActor | |---------------------------------+----------------------------| | | GlobalTimestamp :stable 20 | | Begin | | | Write A 1 | | | Timestamp :commit 10 (ROLLBACK) | | * Commit at stable | Session | GlobalActor | |---------------------------------+----------------------------| | | GlobalTimestamp :stable 10 | | Begin | | | Write A 1 | | | Timestamp :commit 10 (ROLLBACK) | | * Zero timestamp | Session | |-------------------| | Begin | | Write A 1 | | Commit :commit 10 | | | | Begin | | Write A 2 | | Commit | | | | Begin | | Read A (2) | | Rollback | | | | Begin :readAt 5 | | Read A (2) | | Rollback | | | | Begin :readAt 15 | | Read A (2) | * Pinned oldest timestamp | Session | GlobalActor | |-----------------------------+----------------------------| | Begin | | | Write A 1 | | | Commit :commit 10 | | | | | | Begin :readAt 15 | | | | GlobalTimestamp :oldest 20 | | Read A (1) | | | Rollback | | | | | | Begin :readAt 15 (ROLLBACK) | | * All durable | Session 1 | Session 2 | GlobalActor | |----------------------+----------------------+----------------------------------| | Begin | | | | Commit :commit 10 | | | | | | QueryTimestamp :all_durable (10) | | Begin | | | | Timestamp :commit 20 | | | | | | QueryTimestamp :all_durable (19) | | | Begin | | | | Timestamp :commit 30 | | | | Commit | | | | | QueryTimestamp :all_durable (19) | | Commit | | | | | | QueryTimestamp :all_durable (30) | | Begin | | | | Timestamp :commit 25 | | | | | | QueryTimestamp :all_durable (24) | // WT behavior, returning 30 is preferred * Prepare | Session 1 | Session 2 | |-------------------------------+----------------------------| | Begin | | | Insert A 1 | | | Prepare 10 | | | | Begin | | | Read A (PREPARE_CONFLICT) | | | Rollback | | | | | | Begin :readAt 9 | | | Read A (NOT_FOUND) | | | Rollback | | Commit :commit 20 :durable 30 | | | | Begin :readAt 15 | | | Read A (NOT_FOUND) | | | Rollback | | | | | | Begin :readAt 25 | | | Read A (1) | | | Rollback | | | | | | GlobalTimestamp :stable 25 | | | RollbackToStable | | | | | | Begin :readAt 25 | | | Read A (NOT_FOUND) | * Illegal ignore_prepare | Session 1 | Session 2 | |-------------------------------+-----------------------| | Begin | | | Insert A 1 | | | Prepare 10 | | | Commit :commit 10 :durable 10 | | | | Begin :ignore_prepare | | | Read A (1) | | | Rollback | | Begin | | | Insert A 2 | | | Prepare 20 | | | | Begin :ignore_prepare | | | Read A (1) | | | Write A 3 (invariant) | * ignore_prepare and txnid visibility? (unsure how WT behaves) | Session 1 | Session 2 | Session 3 | |-------------------------------+---------------------------+----------------------------------------------------------| | Begin | | | | Insert A 1 | | | | Prepare 10 | | | | | Begin :ignore_prepare | Begin :readAt 20 :ignore_prepare (Illegal combination??) | | | Read A (NOT_FOUND) | Read A (NOT_FOUND) | | Commit :commit 20 :durable 30 | | | | | Read A (NOT_FOUND or 1??) | Read A (1??) |