Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/dbinc/txn.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ struct __db_txnregion { /* SHARED */
u_int32_t last_txnid; /* last transaction id given out */
u_int32_t cur_maxid; /* current max unused id. */


db_mutex_t mtx_ckp; /* Single thread checkpoints. */
DB_LSN last_ckp; /* lsn of the last checkpoint */
time_t time_ckp; /* time of last checkpoint */
Expand Down Expand Up @@ -280,6 +281,26 @@ struct __db_txnregion { /* SHARED */
SH_TAILQ_HEAD(__tdfree) free_txn;
};

/*
* TXN_SI_CONCURRENT --
* SSI: TRUE when a committed reader R (detail rtd) is concurrent with a
* writer W (detail wtd) for an rw-antidependency R --rw--> W: R committed
* strictly after W took its snapshot, visible_lsn(R) > read_lsn(W).
*
* Strict, on purpose. read_lsn is assigned lazily at first page access
* and an aborting SSI txn writes no log record, so under retry pressure
* the log end stops moving and a committed reader's visible_lsn equals
* every new writer's read_lsn. An inclusive test (">=") turned each such
* tie into an edge and livelocked SSI (#257: 22 commits vs 482k UNSAFE
* aborts). The genuine concurrent pair that a strict test used to miss
* at equality -- R reads the page after W already write-locked and
* scanned it -- is caught from the other side by the reader-side scan
* __lock_si_rconflict, so no edge depends on the equality case. The
* caller handles R still RUNNING separately.
*/
#define TXN_SI_CONCURRENT(rtd, wtd) \
(LOG_COMPARE(&(rtd)->visible_lsn, &(wtd)->read_lsn) > 0)

/*
* DB_COMMIT_INFO --
* Meta-data uniquely describing a transaction commit across a replication
Expand Down
Loading
Loading