diff options
author | Chenhao Qu <chenhao.qu@mongodb.com> | 2021-03-10 08:27:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-10 08:59:01 +0000 |
commit | 69327709384b7b740dd3a351e303896756050c93 (patch) | |
tree | 95ba355220394707880355e4d0f9219ddcf6ab2d | |
parent | ece8d522d6a38be698e27d89100c2ec66c617c10 (diff) | |
download | mongo-69327709384b7b740dd3a351e303896756050c93.tar.gz |
Import wiredtiger: 3be9854c26467f15b1e3e1d3b1b2cfc86c859b10 from branch mongodb-5.0
ref: ca937e9bc0..3be9854c26
for: 4.9.0
WT-6709 Remove timestamp queues that used to store read/durable timestamps
-rw-r--r-- | src/third_party/wiredtiger/dist/stat_data.py | 11 | ||||
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/extern.h | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/stat.h | 11 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/txn.h | 20 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/wiredtiger.in | 336 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/session/session_api.c | 1 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/support/stat.c | 33 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn.c | 14 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_timestamp.c | 339 |
10 files changed, 217 insertions, 552 deletions
diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py index 7a25fa521a4..a2e48995d81 100644 --- a/src/third_party/wiredtiger/dist/stat_data.py +++ b/src/third_party/wiredtiger/dist/stat_data.py @@ -535,11 +535,6 @@ connection_stats = [ TxnStat('txn_checkpoint_time_recent', 'transaction checkpoint most recent time (msecs)', 'no_clear,no_scale'), TxnStat('txn_checkpoint_time_total', 'transaction checkpoint total time (msecs)', 'no_clear,no_scale'), TxnStat('txn_commit', 'transactions committed'), - TxnStat('txn_durable_queue_empty', 'durable timestamp queue insert to empty'), - TxnStat('txn_durable_queue_head', 'durable timestamp queue inserts to head'), - TxnStat('txn_durable_queue_inserts', 'durable timestamp queue inserts total'), - TxnStat('txn_durable_queue_len', 'durable timestamp queue length'), - TxnStat('txn_durable_queue_walked', 'durable timestamp queue entries walked'), TxnStat('txn_fail_cache', 'transaction failures due to history store'), TxnStat('txn_pinned_checkpoint_range', 'transaction range of IDs currently pinned by a checkpoint', 'no_clear,no_scale'), TxnStat('txn_pinned_range', 'transaction range of IDs currently pinned', 'no_clear,no_scale'), @@ -553,11 +548,6 @@ connection_stats = [ TxnStat('txn_prepare_rollback', 'prepared transactions rolled back'), TxnStat('txn_prepared_updates_count', 'Number of prepared updates'), TxnStat('txn_query_ts', 'query timestamp calls'), - TxnStat('txn_read_queue_empty', 'read timestamp queue insert to empty'), - TxnStat('txn_read_queue_head', 'read timestamp queue inserts to head'), - TxnStat('txn_read_queue_inserts', 'read timestamp queue inserts total'), - TxnStat('txn_read_queue_len', 'read timestamp queue length'), - TxnStat('txn_read_queue_walked', 'read timestamp queue entries walked'), TxnStat('txn_rollback', 'transactions rolled back'), TxnStat('txn_rts', 'rollback to stable calls'), TxnStat('txn_rts_pages_visited', 'rollback to stable pages visited'), @@ -572,6 +562,7 @@ connection_stats = [ TxnStat('txn_set_ts_stable_upd', 'set timestamp stable updates'), TxnStat('txn_sync', 'transaction sync calls'), TxnStat('txn_timestamp_oldest_active_read', 'transaction read timestamp of the oldest active reader', 'no_clear,no_scale'), + TxnStat('txn_walk_sessions', 'transaction walk of concurrent sessions'), ########################################## # Yield statistics diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 50c0efc511d..a9c8a18a8e8 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-5.0", - "commit": "ca937e9bc0f85ced74b958b8e8a0770154eb6eaf" + "commit": "3be9854c26467f15b1e3e1d3b1b2cfc86c859b10" } diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index 7fac6f5cbd4..ff47203ecd0 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -1795,13 +1795,11 @@ extern void __wt_timestamp_to_hex_string(wt_timestamp_t ts, char *hex_timestamp) extern void __wt_txn_bump_snapshot(WT_SESSION_IMPL *session); extern void __wt_txn_clear_durable_timestamp(WT_SESSION_IMPL *session); extern void __wt_txn_clear_read_timestamp(WT_SESSION_IMPL *session); -extern void __wt_txn_clear_timestamp_queues(WT_SESSION_IMPL *session); extern void __wt_txn_destroy(WT_SESSION_IMPL *session); extern void __wt_txn_get_snapshot(WT_SESSION_IMPL *session); extern void __wt_txn_global_destroy(WT_SESSION_IMPL *session); extern void __wt_txn_op_free(WT_SESSION_IMPL *session, WT_TXN_OP *op); extern void __wt_txn_publish_durable_timestamp(WT_SESSION_IMPL *session); -extern void __wt_txn_publish_read_timestamp(WT_SESSION_IMPL *session); extern void __wt_txn_release(WT_SESSION_IMPL *session); extern void __wt_txn_release_resources(WT_SESSION_IMPL *session); extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session); diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h index 9131489d0fc..28e852d2b30 100644 --- a/src/third_party/wiredtiger/src/include/stat.h +++ b/src/third_party/wiredtiger/src/include/stat.h @@ -625,21 +625,11 @@ struct __wt_connection_stats { int64_t page_del_rollback_blocked; int64_t child_modify_blocked_page; int64_t txn_prepared_updates_count; - int64_t txn_durable_queue_walked; - int64_t txn_durable_queue_empty; - int64_t txn_durable_queue_head; - int64_t txn_durable_queue_inserts; - int64_t txn_durable_queue_len; int64_t txn_prepare; int64_t txn_prepare_commit; int64_t txn_prepare_active; int64_t txn_prepare_rollback; int64_t txn_query_ts; - int64_t txn_read_queue_walked; - int64_t txn_read_queue_empty; - int64_t txn_read_queue_head; - int64_t txn_read_queue_inserts; - int64_t txn_read_queue_len; int64_t txn_rts; int64_t txn_rts_pages_visited; int64_t txn_rts_tree_walk_skip_pages; @@ -685,6 +675,7 @@ struct __wt_connection_stats { int64_t txn_pinned_timestamp_oldest; int64_t txn_timestamp_oldest_active_read; int64_t txn_sync; + int64_t txn_walk_sessions; int64_t txn_commit; int64_t txn_rollback; int64_t lsm_checkpoint_throttle; diff --git a/src/third_party/wiredtiger/src/include/txn.h b/src/third_party/wiredtiger/src/include/txn.h index de72ec0c64c..23ed483a3fe 100644 --- a/src/third_party/wiredtiger/src/include/txn.h +++ b/src/third_party/wiredtiger/src/include/txn.h @@ -104,20 +104,10 @@ struct __wt_txn_shared { */ wt_timestamp_t read_timestamp; - TAILQ_ENTRY(__wt_txn_shared) read_timestampq; - TAILQ_ENTRY(__wt_txn_shared) durable_timestampq; - /* Set if need to clear from the durable queue */ - volatile uint8_t is_allocating; - uint8_t clear_durable_q; - uint8_t clear_read_q; /* Set if need to clear from the read queue */ - WT_CACHE_LINE_PAD_END }; -TAILQ_HEAD(__wt_txn_dts_qh, __wt_txn_shared); -TAILQ_HEAD(__wt_txn_rts_qh, __wt_txn_shared); - struct __wt_txn_global { volatile uint64_t current; /* Current transaction ID. */ @@ -151,16 +141,6 @@ struct __wt_txn_global { /* Protects logging, checkpoints and transaction visibility. */ WT_RWLOCK visibility_rwlock; - /* List of transactions sorted by durable timestamp. */ - WT_RWLOCK durable_timestamp_rwlock; - struct __wt_txn_dts_qh durable_timestamph; - uint32_t durable_timestampq_len; - - /* List of transactions sorted by read timestamp. */ - WT_RWLOCK read_timestamp_rwlock; - struct __wt_txn_rts_qh read_timestamph; - uint32_t read_timestampq_len; - /* * Track information about the running checkpoint. The transaction snapshot used when * checkpointing are special. Checkpoints can run for a long time so we keep them out of regular diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index 7878645d75e..3075d5b187b 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -5722,448 +5722,430 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1310 /*! transaction: Number of prepared updates */ #define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1311 -/*! transaction: durable timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_WALKED 1312 -/*! transaction: durable timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_EMPTY 1313 -/*! transaction: durable timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_HEAD 1314 -/*! transaction: durable timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_INSERTS 1315 -/*! transaction: durable timestamp queue length */ -#define WT_STAT_CONN_TXN_DURABLE_QUEUE_LEN 1316 /*! transaction: prepared transactions */ -#define WT_STAT_CONN_TXN_PREPARE 1317 +#define WT_STAT_CONN_TXN_PREPARE 1312 /*! transaction: prepared transactions committed */ -#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1318 +#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1313 /*! transaction: prepared transactions currently active */ -#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1319 +#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1314 /*! transaction: prepared transactions rolled back */ -#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1320 +#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1315 /*! transaction: query timestamp calls */ -#define WT_STAT_CONN_TXN_QUERY_TS 1321 -/*! transaction: read timestamp queue entries walked */ -#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1322 -/*! transaction: read timestamp queue insert to empty */ -#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1323 -/*! transaction: read timestamp queue inserts to head */ -#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1324 -/*! transaction: read timestamp queue inserts total */ -#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1325 -/*! transaction: read timestamp queue length */ -#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1326 +#define WT_STAT_CONN_TXN_QUERY_TS 1316 /*! transaction: rollback to stable calls */ -#define WT_STAT_CONN_TXN_RTS 1327 +#define WT_STAT_CONN_TXN_RTS 1317 /*! transaction: rollback to stable pages visited */ -#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1328 +#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1318 /*! transaction: rollback to stable tree walk skipping pages */ -#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1329 +#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1319 /*! transaction: rollback to stable updates aborted */ -#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1330 +#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1320 /*! transaction: set timestamp calls */ -#define WT_STAT_CONN_TXN_SET_TS 1331 +#define WT_STAT_CONN_TXN_SET_TS 1321 /*! transaction: set timestamp durable calls */ -#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1332 +#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1322 /*! transaction: set timestamp durable updates */ -#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1333 +#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1323 /*! transaction: set timestamp oldest calls */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1334 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1324 /*! transaction: set timestamp oldest updates */ -#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1335 +#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1325 /*! transaction: set timestamp stable calls */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE 1336 +#define WT_STAT_CONN_TXN_SET_TS_STABLE 1326 /*! transaction: set timestamp stable updates */ -#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1337 +#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1327 /*! transaction: transaction begins */ -#define WT_STAT_CONN_TXN_BEGIN 1338 +#define WT_STAT_CONN_TXN_BEGIN 1328 /*! transaction: transaction checkpoint currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1339 +#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1329 /*! transaction: transaction checkpoint generation */ -#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1340 +#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1330 /*! * transaction: transaction checkpoint history store file duration * (usecs) */ -#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1341 +#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1331 /*! transaction: transaction checkpoint max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1342 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1332 /*! transaction: transaction checkpoint min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1343 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1333 /*! * transaction: transaction checkpoint most recent duration for gathering * all handles (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION 1344 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION 1334 /*! * transaction: transaction checkpoint most recent duration for gathering * applied handles (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_APPLY 1345 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_APPLY 1335 /*! * transaction: transaction checkpoint most recent duration for gathering * skipped handles (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_SKIP 1346 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_SKIP 1336 /*! transaction: transaction checkpoint most recent handles applied */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_APPLIED 1347 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_APPLIED 1337 /*! transaction: transaction checkpoint most recent handles skipped */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_SKIPPED 1348 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_SKIPPED 1338 /*! transaction: transaction checkpoint most recent handles walked */ -#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_WALKED 1349 +#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_WALKED 1339 /*! transaction: transaction checkpoint most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1350 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1340 /*! transaction: transaction checkpoint prepare currently running */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1351 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1341 /*! transaction: transaction checkpoint prepare max time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1352 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1342 /*! transaction: transaction checkpoint prepare min time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1353 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1343 /*! transaction: transaction checkpoint prepare most recent time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1354 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1344 /*! transaction: transaction checkpoint prepare total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1355 +#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1345 /*! transaction: transaction checkpoint scrub dirty target */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1356 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1346 /*! transaction: transaction checkpoint scrub time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1357 +#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1347 /*! transaction: transaction checkpoint total time (msecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1358 +#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1348 /*! transaction: transaction checkpoints */ -#define WT_STAT_CONN_TXN_CHECKPOINT 1359 +#define WT_STAT_CONN_TXN_CHECKPOINT 1349 /*! * transaction: transaction checkpoints skipped because database was * clean */ -#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1360 +#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1350 /*! transaction: transaction failures due to history store */ -#define WT_STAT_CONN_TXN_FAIL_CACHE 1361 +#define WT_STAT_CONN_TXN_FAIL_CACHE 1351 /*! * transaction: transaction fsync calls for checkpoint after allocating * the transaction ID */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1362 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1352 /*! * transaction: transaction fsync duration for checkpoint after * allocating the transaction ID (usecs) */ -#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1363 +#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1353 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1364 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1354 /*! transaction: transaction range of IDs currently pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1365 +#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1355 /*! transaction: transaction range of timestamps currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1366 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1356 /*! transaction: transaction range of timestamps pinned by a checkpoint */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1367 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1357 /*! * transaction: transaction range of timestamps pinned by the oldest * active read timestamp */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1368 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1358 /*! * transaction: transaction range of timestamps pinned by the oldest * timestamp */ -#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1369 +#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1359 /*! transaction: transaction read timestamp of the oldest active reader */ -#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1370 +#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1360 /*! transaction: transaction sync calls */ -#define WT_STAT_CONN_TXN_SYNC 1371 +#define WT_STAT_CONN_TXN_SYNC 1361 +/*! transaction: transaction walk of concurrent sessions */ +#define WT_STAT_CONN_TXN_WALK_SESSIONS 1362 /*! transaction: transactions committed */ -#define WT_STAT_CONN_TXN_COMMIT 1372 +#define WT_STAT_CONN_TXN_COMMIT 1363 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1373 +#define WT_STAT_CONN_TXN_ROLLBACK 1364 /*! LSM: sleep for LSM checkpoint throttle */ -#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1374 +#define WT_STAT_CONN_LSM_CHECKPOINT_THROTTLE 1365 /*! LSM: sleep for LSM merge throttle */ -#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1375 +#define WT_STAT_CONN_LSM_MERGE_THROTTLE 1366 /*! cache: bytes currently in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_INUSE 1376 +#define WT_STAT_CONN_CACHE_BYTES_INUSE 1367 /*! cache: bytes dirty in the cache cumulative */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY_TOTAL 1377 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY_TOTAL 1368 /*! cache: bytes read into cache */ -#define WT_STAT_CONN_CACHE_BYTES_READ 1378 +#define WT_STAT_CONN_CACHE_BYTES_READ 1369 /*! cache: bytes written from cache */ -#define WT_STAT_CONN_CACHE_BYTES_WRITE 1379 +#define WT_STAT_CONN_CACHE_BYTES_WRITE 1370 /*! cache: checkpoint blocked page eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1380 +#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1371 /*! cache: eviction walk target pages histogram - 0-9 */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT10 1381 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT10 1372 /*! cache: eviction walk target pages histogram - 10-31 */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT32 1382 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT32 1373 /*! cache: eviction walk target pages histogram - 128 and higher */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_GE128 1383 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_GE128 1374 /*! cache: eviction walk target pages histogram - 32-63 */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT64 1384 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT64 1375 /*! cache: eviction walk target pages histogram - 64-128 */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT128 1385 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_LT128 1376 /*! * cache: eviction walk target pages reduced due to history store cache * pressure */ -#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_REDUCED 1386 +#define WT_STAT_CONN_CACHE_EVICTION_TARGET_PAGE_REDUCED 1377 /*! cache: eviction walks abandoned */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ABANDONED 1387 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ABANDONED 1378 /*! cache: eviction walks gave up because they restarted their walk twice */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STOPPED 1388 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_STOPPED 1379 /*! * cache: eviction walks gave up because they saw too many pages and * found no candidates */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 1389 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_NO_TARGETS 1380 /*! * cache: eviction walks gave up because they saw too many pages and * found too few candidates */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 1390 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_GAVE_UP_RATIO 1381 /*! cache: eviction walks reached end of tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ENDED 1391 +#define WT_STAT_CONN_CACHE_EVICTION_WALKS_ENDED 1382 /*! cache: eviction walks restarted */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK_RESTART 1392 +#define WT_STAT_CONN_CACHE_EVICTION_WALK_RESTART 1383 /*! cache: eviction walks started from root of tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK_FROM_ROOT 1393 +#define WT_STAT_CONN_CACHE_EVICTION_WALK_FROM_ROOT 1384 /*! cache: eviction walks started from saved location in tree */ -#define WT_STAT_CONN_CACHE_EVICTION_WALK_SAVED_POS 1394 +#define WT_STAT_CONN_CACHE_EVICTION_WALK_SAVED_POS 1385 /*! cache: hazard pointer blocked page eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1395 +#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1386 /*! cache: history store table insert calls */ -#define WT_STAT_CONN_CACHE_HS_INSERT 1396 +#define WT_STAT_CONN_CACHE_HS_INSERT 1387 /*! cache: history store table insert calls that returned restart */ -#define WT_STAT_CONN_CACHE_HS_INSERT_RESTART 1397 +#define WT_STAT_CONN_CACHE_HS_INSERT_RESTART 1388 /*! * cache: history store table out-of-order resolved updates that lose * their durable timestamp */ -#define WT_STAT_CONN_CACHE_HS_ORDER_LOSE_DURABLE_TIMESTAMP 1398 +#define WT_STAT_CONN_CACHE_HS_ORDER_LOSE_DURABLE_TIMESTAMP 1389 /*! * cache: history store table out-of-order updates that were fixed up by * moving existing records */ -#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_MOVE 1399 +#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_MOVE 1390 /*! * cache: history store table out-of-order updates that were fixed up * during insertion */ -#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_INSERT 1400 +#define WT_STAT_CONN_CACHE_HS_ORDER_FIXUP_INSERT 1391 /*! cache: history store table reads */ -#define WT_STAT_CONN_CACHE_HS_READ 1401 +#define WT_STAT_CONN_CACHE_HS_READ 1392 /*! cache: history store table reads missed */ -#define WT_STAT_CONN_CACHE_HS_READ_MISS 1402 +#define WT_STAT_CONN_CACHE_HS_READ_MISS 1393 /*! cache: history store table reads requiring squashed modifies */ -#define WT_STAT_CONN_CACHE_HS_READ_SQUASH 1403 +#define WT_STAT_CONN_CACHE_HS_READ_SQUASH 1394 /*! * cache: history store table truncation by rollback to stable to remove * an unstable update */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS_UNSTABLE 1404 +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS_UNSTABLE 1395 /*! * cache: history store table truncation by rollback to stable to remove * an update */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS 1405 +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_RTS 1396 /*! cache: history store table truncation to remove an update */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE 1406 +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE 1397 /*! * cache: history store table truncation to remove range of updates due * to key being removed from the data page during reconciliation */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_ONPAGE_REMOVAL 1407 +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_ONPAGE_REMOVAL 1398 /*! * cache: history store table truncation to remove range of updates due * to non timestamped update on data page */ -#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_NON_TS 1408 +#define WT_STAT_CONN_CACHE_HS_KEY_TRUNCATE_NON_TS 1399 /*! cache: history store table writes requiring squashed modifies */ -#define WT_STAT_CONN_CACHE_HS_WRITE_SQUASH 1409 +#define WT_STAT_CONN_CACHE_HS_WRITE_SQUASH 1400 /*! cache: in-memory page passed criteria to be split */ -#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1410 +#define WT_STAT_CONN_CACHE_INMEM_SPLITTABLE 1401 /*! cache: in-memory page splits */ -#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1411 +#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1402 /*! cache: internal pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1412 +#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1403 /*! cache: internal pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1413 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_INTERNAL 1404 /*! cache: leaf pages split during eviction */ -#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1414 +#define WT_STAT_CONN_CACHE_EVICTION_SPLIT_LEAF 1405 /*! cache: modified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1415 +#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1406 /*! cache: overflow pages read into cache */ -#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1416 +#define WT_STAT_CONN_CACHE_READ_OVERFLOW 1407 /*! cache: page split during eviction deepened the tree */ -#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1417 +#define WT_STAT_CONN_CACHE_EVICTION_DEEPEN 1408 /*! cache: page written requiring history store records */ -#define WT_STAT_CONN_CACHE_WRITE_HS 1418 +#define WT_STAT_CONN_CACHE_WRITE_HS 1409 /*! cache: pages read into cache */ -#define WT_STAT_CONN_CACHE_READ 1419 +#define WT_STAT_CONN_CACHE_READ 1410 /*! cache: pages read into cache after truncate */ -#define WT_STAT_CONN_CACHE_READ_DELETED 1420 +#define WT_STAT_CONN_CACHE_READ_DELETED 1411 /*! cache: pages read into cache after truncate in prepare state */ -#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1421 +#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1412 /*! cache: pages requested from the cache */ -#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1422 +#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1413 /*! cache: pages seen by eviction walk */ -#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1423 +#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1414 /*! cache: pages written from cache */ -#define WT_STAT_CONN_CACHE_WRITE 1424 +#define WT_STAT_CONN_CACHE_WRITE 1415 /*! cache: pages written requiring in-memory restoration */ -#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1425 +#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1416 /*! cache: tracked dirty bytes in the cache */ -#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1426 +#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1417 /*! cache: unmodified pages evicted */ -#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1427 +#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1418 /*! checkpoint-cleanup: pages added for eviction */ -#define WT_STAT_CONN_CC_PAGES_EVICT 1428 +#define WT_STAT_CONN_CC_PAGES_EVICT 1419 /*! checkpoint-cleanup: pages removed */ -#define WT_STAT_CONN_CC_PAGES_REMOVED 1429 +#define WT_STAT_CONN_CC_PAGES_REMOVED 1420 /*! checkpoint-cleanup: pages skipped during tree walk */ -#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1430 +#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1421 /*! checkpoint-cleanup: pages visited */ -#define WT_STAT_CONN_CC_PAGES_VISITED 1431 +#define WT_STAT_CONN_CC_PAGES_VISITED 1422 /*! cursor: Total number of entries skipped by cursor next calls */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1432 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1423 /*! cursor: Total number of entries skipped by cursor prev calls */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1433 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1424 /*! * cursor: Total number of entries skipped to position the history store * cursor */ -#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1434 +#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1425 /*! * cursor: cursor next calls that skip due to a globally visible history * store tombstone */ -#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE 1435 +#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE 1426 /*! * cursor: cursor next calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1436 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1427 /*! cursor: cursor next calls that skip less than 100 entries */ -#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1437 +#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1428 /*! * cursor: cursor prev calls that skip due to a globally visible history * store tombstone */ -#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1438 +#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1429 /*! * cursor: cursor prev calls that skip greater than or equal to 100 * entries */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1439 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1430 /*! cursor: cursor prev calls that skip less than 100 entries */ -#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1440 +#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1431 /*! cursor: open cursor count */ -#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1441 +#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1432 /*! reconciliation: approximate byte size of timestamps in pages written */ -#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1442 +#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1433 /*! * reconciliation: approximate byte size of transaction IDs in pages * written */ -#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1443 +#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1434 /*! reconciliation: fast-path pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1444 +#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1435 /*! reconciliation: page reconciliation calls */ -#define WT_STAT_CONN_REC_PAGES 1445 +#define WT_STAT_CONN_REC_PAGES 1436 /*! reconciliation: page reconciliation calls for eviction */ -#define WT_STAT_CONN_REC_PAGES_EVICTION 1446 +#define WT_STAT_CONN_REC_PAGES_EVICTION 1437 /*! reconciliation: pages deleted */ -#define WT_STAT_CONN_REC_PAGE_DELETE 1447 +#define WT_STAT_CONN_REC_PAGE_DELETE 1438 /*! * reconciliation: pages written including an aggregated newest start * durable timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1448 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1439 /*! * reconciliation: pages written including an aggregated newest stop * durable timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1449 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1440 /*! * reconciliation: pages written including an aggregated newest stop * timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1450 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1441 /*! * reconciliation: pages written including an aggregated newest stop * transaction ID */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1451 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1442 /*! * reconciliation: pages written including an aggregated newest * transaction ID */ -#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_TXN 1452 +#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_TXN 1443 /*! * reconciliation: pages written including an aggregated oldest start * timestamp */ -#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1453 +#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1444 /*! reconciliation: pages written including an aggregated prepare */ -#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1454 +#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1445 /*! * reconciliation: pages written including at least one start durable * timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1455 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1446 /*! * reconciliation: pages written including at least one start transaction * ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1456 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1447 /*! * reconciliation: pages written including at least one stop durable * timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1457 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1448 /*! reconciliation: pages written including at least one stop timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1458 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1449 /*! * reconciliation: pages written including at least one stop transaction * ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1459 +#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1450 /*! reconciliation: records written including a start durable timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1460 +#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1451 /*! reconciliation: records written including a start timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1461 +#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1452 /*! reconciliation: records written including a start transaction ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1462 +#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1453 /*! reconciliation: records written including a stop durable timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1463 +#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1454 /*! reconciliation: records written including a stop timestamp */ -#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1464 +#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1455 /*! reconciliation: records written including a stop transaction ID */ -#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1465 +#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1456 /*! session: flush_tier operation calls */ -#define WT_STAT_CONN_FLUSH_TIER 1466 +#define WT_STAT_CONN_FLUSH_TIER 1457 /*! session: tiered storage local retention time (secs) */ -#define WT_STAT_CONN_TIERED_RETENTION 1467 +#define WT_STAT_CONN_TIERED_RETENTION 1458 /*! transaction: race to read prepared update retry */ -#define WT_STAT_CONN_TXN_READ_RACE_PREPARE_UPDATE 1468 +#define WT_STAT_CONN_TXN_READ_RACE_PREPARE_UPDATE 1459 /*! * transaction: rollback to stable history store records with stop * timestamps older than newer records */ -#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1469 +#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1460 /*! transaction: rollback to stable inconsistent checkpoint */ -#define WT_STAT_CONN_TXN_RTS_INCONSISTENT_CKPT 1470 +#define WT_STAT_CONN_TXN_RTS_INCONSISTENT_CKPT 1461 /*! transaction: rollback to stable keys removed */ -#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1471 +#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1462 /*! transaction: rollback to stable keys restored */ -#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1472 +#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1463 /*! transaction: rollback to stable restored tombstones from history store */ -#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1473 +#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1464 /*! transaction: rollback to stable restored updates from history store */ -#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_UPDATES 1474 +#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_UPDATES 1465 /*! transaction: rollback to stable sweeping history store keys */ -#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1475 +#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1466 /*! transaction: rollback to stable updates removed from history store */ -#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1476 +#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1467 /*! transaction: transaction checkpoints due to obsolete pages */ -#define WT_STAT_CONN_TXN_CHECKPOINT_OBSOLETE_APPLIED 1477 +#define WT_STAT_CONN_TXN_CHECKPOINT_OBSOLETE_APPLIED 1468 /*! transaction: update conflicts */ -#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1478 +#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1469 /*! * @} diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c index aec5e3c0f75..cb4e12df887 100644 --- a/src/third_party/wiredtiger/src/session/session_api.c +++ b/src/third_party/wiredtiger/src/session/session_api.c @@ -201,7 +201,6 @@ __session_clear(WT_SESSION_IMPL *session) * * For these reasons, be careful when clearing the session structure. */ - __wt_txn_clear_timestamp_queues(session); memset(session, 0, WT_SESSION_CLEAR_SIZE); WT_INIT_LSN(&session->bg_sync_lsn); diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c index 6723f064f17..5ae4a78605b 100644 --- a/src/third_party/wiredtiger/src/support/stat.c +++ b/src/third_party/wiredtiger/src/support/stat.c @@ -1274,21 +1274,11 @@ static const char *const __stats_connection_desc[] = { "thread-yield: page delete rollback time sleeping for state change (usecs)", "thread-yield: page reconciliation yielded due to child modification", "transaction: Number of prepared updates", - "transaction: durable timestamp queue entries walked", - "transaction: durable timestamp queue insert to empty", - "transaction: durable timestamp queue inserts to head", - "transaction: durable timestamp queue inserts total", - "transaction: durable timestamp queue length", "transaction: prepared transactions", "transaction: prepared transactions committed", "transaction: prepared transactions currently active", "transaction: prepared transactions rolled back", "transaction: query timestamp calls", - "transaction: read timestamp queue entries walked", - "transaction: read timestamp queue insert to empty", - "transaction: read timestamp queue inserts to head", - "transaction: read timestamp queue inserts total", - "transaction: read timestamp queue length", "transaction: rollback to stable calls", "transaction: rollback to stable pages visited", "transaction: rollback to stable tree walk skipping pages", @@ -1335,6 +1325,7 @@ static const char *const __stats_connection_desc[] = { "transaction: transaction range of timestamps pinned by the oldest timestamp", "transaction: transaction read timestamp of the oldest active reader", "transaction: transaction sync calls", + "transaction: transaction walk of concurrent sessions", "transaction: transactions committed", "transaction: transactions rolled back", "LSM: sleep for LSM checkpoint throttle", @@ -1797,21 +1788,11 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) stats->page_del_rollback_blocked = 0; stats->child_modify_blocked_page = 0; stats->txn_prepared_updates_count = 0; - stats->txn_durable_queue_walked = 0; - stats->txn_durable_queue_empty = 0; - stats->txn_durable_queue_head = 0; - stats->txn_durable_queue_inserts = 0; - stats->txn_durable_queue_len = 0; stats->txn_prepare = 0; stats->txn_prepare_commit = 0; stats->txn_prepare_active = 0; stats->txn_prepare_rollback = 0; stats->txn_query_ts = 0; - stats->txn_read_queue_walked = 0; - stats->txn_read_queue_empty = 0; - stats->txn_read_queue_head = 0; - stats->txn_read_queue_inserts = 0; - stats->txn_read_queue_len = 0; stats->txn_rts = 0; stats->txn_rts_pages_visited = 0; stats->txn_rts_tree_walk_skip_pages = 0; @@ -1857,6 +1838,7 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats) /* not clearing txn_pinned_timestamp_oldest */ /* not clearing txn_timestamp_oldest_active_read */ stats->txn_sync = 0; + stats->txn_walk_sessions = 0; stats->txn_commit = 0; stats->txn_rollback = 0; stats->lsm_checkpoint_throttle = 0; @@ -2313,21 +2295,11 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->page_del_rollback_blocked += WT_STAT_READ(from, page_del_rollback_blocked); to->child_modify_blocked_page += WT_STAT_READ(from, child_modify_blocked_page); to->txn_prepared_updates_count += WT_STAT_READ(from, txn_prepared_updates_count); - to->txn_durable_queue_walked += WT_STAT_READ(from, txn_durable_queue_walked); - to->txn_durable_queue_empty += WT_STAT_READ(from, txn_durable_queue_empty); - to->txn_durable_queue_head += WT_STAT_READ(from, txn_durable_queue_head); - to->txn_durable_queue_inserts += WT_STAT_READ(from, txn_durable_queue_inserts); - to->txn_durable_queue_len += WT_STAT_READ(from, txn_durable_queue_len); to->txn_prepare += WT_STAT_READ(from, txn_prepare); to->txn_prepare_commit += WT_STAT_READ(from, txn_prepare_commit); to->txn_prepare_active += WT_STAT_READ(from, txn_prepare_active); to->txn_prepare_rollback += WT_STAT_READ(from, txn_prepare_rollback); to->txn_query_ts += WT_STAT_READ(from, txn_query_ts); - to->txn_read_queue_walked += WT_STAT_READ(from, txn_read_queue_walked); - to->txn_read_queue_empty += WT_STAT_READ(from, txn_read_queue_empty); - to->txn_read_queue_head += WT_STAT_READ(from, txn_read_queue_head); - to->txn_read_queue_inserts += WT_STAT_READ(from, txn_read_queue_inserts); - to->txn_read_queue_len += WT_STAT_READ(from, txn_read_queue_len); to->txn_rts += WT_STAT_READ(from, txn_rts); to->txn_rts_pages_visited += WT_STAT_READ(from, txn_rts_pages_visited); to->txn_rts_tree_walk_skip_pages += WT_STAT_READ(from, txn_rts_tree_walk_skip_pages); @@ -2376,6 +2348,7 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS * to->txn_pinned_timestamp_oldest += WT_STAT_READ(from, txn_pinned_timestamp_oldest); to->txn_timestamp_oldest_active_read += WT_STAT_READ(from, txn_timestamp_oldest_active_read); to->txn_sync += WT_STAT_READ(from, txn_sync); + to->txn_walk_sessions += WT_STAT_READ(from, txn_walk_sessions); to->txn_commit += WT_STAT_READ(from, txn_commit); to->txn_rollback += WT_STAT_READ(from, txn_rollback); to->lsm_checkpoint_throttle += WT_STAT_READ(from, lsm_checkpoint_throttle); diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index bf85cf61443..10887763194 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -169,6 +169,7 @@ __wt_txn_active(WT_SESSION_IMPL *session, uint64_t txnid) /* Walk the array of concurrent transactions. */ WT_ORDERED_READ(session_cnt, conn->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { /* If the transaction is in the list, it is uncommitted. */ if (s->id == txnid) @@ -240,6 +241,7 @@ __txn_get_snapshot_int(WT_SESSION_IMPL *session, bool publish) /* Walk the array of concurrent transactions. */ WT_ORDERED_READ(session_cnt, conn->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { /* * Build our snapshot of any concurrent transaction IDs. @@ -340,6 +342,7 @@ __txn_oldest_scan(WT_SESSION_IMPL *session, uint64_t *oldest_idp, uint64_t *last /* Walk the array of concurrent transactions. */ WT_ORDERED_READ(session_cnt, conn->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { /* Update the last running transaction ID. */ while ((id = s->id) != WT_TXN_NONE && WT_TXNID_LE(prev_oldest_id, id) && @@ -1972,8 +1975,6 @@ __wt_txn_stats_update(WT_SESSION_IMPL *session) WT_STAT_SET(session, stats, txn_checkpoint_time_min, conn->ckpt_time_min); WT_STAT_SET(session, stats, txn_checkpoint_time_recent, conn->ckpt_time_recent); WT_STAT_SET(session, stats, txn_checkpoint_time_total, conn->ckpt_time_total); - WT_STAT_SET(session, stats, txn_durable_queue_len, txn_global->durable_timestampq_len); - WT_STAT_SET(session, stats, txn_read_queue_len, txn_global->read_timestampq_len); } /* @@ -2028,12 +2029,6 @@ __wt_txn_global_init(WT_SESSION_IMPL *session, const char *cfg[]) WT_RWLOCK_INIT_TRACKED(session, &txn_global->rwlock, txn_global); WT_RET(__wt_rwlock_init(session, &txn_global->visibility_rwlock)); - WT_RWLOCK_INIT_TRACKED(session, &txn_global->durable_timestamp_rwlock, durable_timestamp); - TAILQ_INIT(&txn_global->durable_timestamph); - - WT_RWLOCK_INIT_TRACKED(session, &txn_global->read_timestamp_rwlock, read_timestamp); - TAILQ_INIT(&txn_global->read_timestamph); - WT_RET(__wt_calloc_def(session, conn->session_size, &txn_global->txn_shared_list)); for (i = 0, s = txn_global->txn_shared_list; i < conn->session_size; i++, s++) @@ -2060,8 +2055,6 @@ __wt_txn_global_destroy(WT_SESSION_IMPL *session) __wt_spin_destroy(session, &txn_global->id_lock); __wt_rwlock_destroy(session, &txn_global->rwlock); - __wt_rwlock_destroy(session, &txn_global->durable_timestamp_rwlock); - __wt_rwlock_destroy(session, &txn_global->read_timestamp_rwlock); __wt_rwlock_destroy(session, &txn_global->visibility_rwlock); __wt_free(session, txn_global->txn_shared_list); } @@ -2342,6 +2335,7 @@ __wt_verbose_dump_txn(WT_SESSION_IMPL *session) * handles is not thread safe, so some information may change while traversing if other threads * are active at the same time, which is OK since this is diagnostic code. */ + WT_STAT_CONN_INCR(session, txn_walk_sessions); for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { /* Skip sessions with no active transaction */ if ((id = s->id) == WT_TXN_NONE && s->pinned_id == WT_TXN_NONE) diff --git a/src/third_party/wiredtiger/src/txn/txn_timestamp.c b/src/third_party/wiredtiger/src/txn/txn_timestamp.c index 911abe50056..6b046373187 100644 --- a/src/third_party/wiredtiger/src/txn/txn_timestamp.c +++ b/src/third_party/wiredtiger/src/txn/txn_timestamp.c @@ -69,14 +69,12 @@ __wt_txn_parse_timestamp( /* * __txn_get_read_timestamp -- - * Get the read timestamp from the transaction. Additionally return bool to specify whether the - * transaction has set the clear read queue flag. + * Get the read timestamp from the transaction. */ -static bool +static void __txn_get_read_timestamp(WT_TXN_SHARED *txn_shared, wt_timestamp_t *read_timestampp) { WT_ORDERED_READ(*read_timestampp, txn_shared->read_timestamp); - return (!txn_shared->clear_read_q); } /* @@ -88,8 +86,9 @@ __wt_txn_get_pinned_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, uin { WT_CONNECTION_IMPL *conn; WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *txn_shared; + WT_TXN_SHARED *s; wt_timestamp_t tmp_read_ts, tmp_ts; + uint32_t i, session_cnt; bool include_oldest, txn_has_write_lock; conn = S2C(session); @@ -103,36 +102,27 @@ __wt_txn_get_pinned_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, uin if (!txn_has_write_lock) __wt_readlock(session, &txn_global->rwlock); - tmp_ts = include_oldest ? txn_global->oldest_timestamp : 0; + tmp_ts = include_oldest ? txn_global->oldest_timestamp : WT_TS_NONE; /* Check for a running checkpoint */ if (LF_ISSET(WT_TXN_TS_INCLUDE_CKPT) && txn_global->checkpoint_timestamp != WT_TS_NONE && - (tmp_ts == 0 || txn_global->checkpoint_timestamp < tmp_ts)) + (tmp_ts == WT_TS_NONE || txn_global->checkpoint_timestamp < tmp_ts)) tmp_ts = txn_global->checkpoint_timestamp; - if (!txn_has_write_lock) - __wt_readunlock(session, &txn_global->rwlock); - /* Look for the oldest ordinary reader. */ - __wt_readlock(session, &txn_global->read_timestamp_rwlock); - TAILQ_FOREACH (txn_shared, &txn_global->read_timestamph, read_timestampq) { - /* - * Skip any transactions on the queue that are not active. Copy out value of read timestamp - * to prevent possible race where a transaction resets its read timestamp while we traverse - * the queue. - */ - if (!__txn_get_read_timestamp(txn_shared, &tmp_read_ts)) - continue; + /* Walk the array of concurrent transactions. */ + WT_ORDERED_READ(session_cnt, conn->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); + for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { + __txn_get_read_timestamp(s, &tmp_read_ts); /* * A zero timestamp is possible here only when the oldest timestamp is not accounted for. */ - if (tmp_ts == 0 || tmp_read_ts < tmp_ts) + if (tmp_ts == WT_TS_NONE || (tmp_read_ts != WT_TS_NONE && tmp_read_ts < tmp_ts)) tmp_ts = tmp_read_ts; - /* - * We break on the first active txn on the list. - */ - break; } - __wt_readunlock(session, &txn_global->read_timestamp_rwlock); + + if (!txn_has_write_lock) + __wt_readunlock(session, &txn_global->rwlock); if (!include_oldest && tmp_ts == 0) return (WT_NOTFOUND); @@ -143,14 +133,12 @@ __wt_txn_get_pinned_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, uin /* * __txn_get_durable_timestamp -- - * Get the durable timestamp from the transaction. Additionally return bool to specify whether - * the transaction has set the clear durable queue flag. + * Get the durable timestamp from the transaction. */ -static bool +static void __txn_get_durable_timestamp(WT_TXN_SHARED *txn_shared, wt_timestamp_t *durable_timestampp) { WT_ORDERED_READ(*durable_timestampp, txn_shared->pinned_durable_timestamp); - return (!txn_shared->clear_durable_q); } /* @@ -163,8 +151,9 @@ __txn_global_query_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, cons WT_CONFIG_ITEM cval; WT_CONNECTION_IMPL *conn; WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *txn_shared; + WT_TXN_SHARED *s; wt_timestamp_t ts, tmpts; + uint32_t i, session_cnt; conn = S2C(session); txn_global = &conn->txn_global; @@ -177,25 +166,18 @@ __txn_global_query_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, cons ts = txn_global->durable_timestamp; WT_ASSERT(session, ts != WT_TS_NONE); - /* - * Skip straight to the commit queue if no running transactions have an explicit durable - * timestamp. - */ - if (TAILQ_EMPTY(&txn_global->durable_timestamph)) - goto done; - /* - * Compare with the least recently durable transaction. - */ - __wt_readlock(session, &txn_global->durable_timestamp_rwlock); - TAILQ_FOREACH (txn_shared, &txn_global->durable_timestamph, durable_timestampq) { - if (__txn_get_durable_timestamp(txn_shared, &tmpts)) { - --tmpts; - if (tmpts < ts) - ts = tmpts; - break; - } + __wt_readlock(session, &txn_global->rwlock); + + /* Walk the array of concurrent transactions. */ + WT_ORDERED_READ(session_cnt, conn->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); + for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { + __txn_get_durable_timestamp(s, &tmpts); + if (tmpts != WT_TS_NONE && --tmpts < ts) + ts = tmpts; } - __wt_readunlock(session, &txn_global->durable_timestamp_rwlock); + + __wt_readunlock(session, &txn_global->rwlock); /* * If a transaction is committing with a durable timestamp of 1, we could return zero here, @@ -225,7 +207,6 @@ __txn_global_query_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, cons } else WT_RET_MSG(session, EINVAL, "unknown timestamp query %.*s", (int)cval.len, cval.str); -done: *tsp = ts; return (0); } @@ -507,49 +488,36 @@ set: * if any. */ static int -__txn_assert_after_reads( - WT_SESSION_IMPL *session, const char *op, wt_timestamp_t ts, WT_TXN_SHARED **prev_sharedp) +__txn_assert_after_reads(WT_SESSION_IMPL *session, const char *op, wt_timestamp_t ts) { #ifdef HAVE_DIAGNOSTIC WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *prev_shared, *txn_shared; + WT_TXN_SHARED *s; wt_timestamp_t tmp_timestamp; + uint32_t i, session_cnt; char ts_string[2][WT_TS_INT_STRING_SIZE]; txn_global = &S2C(session)->txn_global; - txn_shared = WT_SESSION_TXN_SHARED(session); - - __wt_readlock(session, &txn_global->read_timestamp_rwlock); - prev_shared = TAILQ_LAST(&txn_global->read_timestamph, __wt_txn_rts_qh); - while (prev_shared != NULL) { - /* - * Skip self and non-active transactions. Copy out value of read timestamp to prevent - * possible race where a transaction resets its read timestamp while we traverse the queue. - */ - if (!__txn_get_read_timestamp(prev_shared, &tmp_timestamp) || prev_shared == txn_shared) { - prev_shared = TAILQ_PREV(prev_shared, __wt_txn_rts_qh, read_timestampq); - continue; - } - if (tmp_timestamp >= ts) { - __wt_readunlock(session, &txn_global->read_timestamp_rwlock); + __wt_readlock(session, &txn_global->rwlock); + /* Walk the array of concurrent transactions. */ + WT_ORDERED_READ(session_cnt, S2C(session)->session_cnt); + WT_STAT_CONN_INCR(session, txn_walk_sessions); + for (i = 0, s = txn_global->txn_shared_list; i < session_cnt; i++, s++) { + __txn_get_read_timestamp(s, &tmp_timestamp); + if (tmp_timestamp != WT_TS_NONE && tmp_timestamp >= ts) { + __wt_readunlock(session, &txn_global->rwlock); WT_RET_MSG(session, EINVAL, "%s timestamp %s must be greater than the latest active read timestamp %s ", op, __wt_timestamp_to_string(ts, ts_string[0]), __wt_timestamp_to_string(tmp_timestamp, ts_string[1])); } - break; } - - __wt_readunlock(session, &txn_global->read_timestamp_rwlock); - - if (prev_sharedp != NULL) - *prev_sharedp = prev_shared; + __wt_readunlock(session, &txn_global->rwlock); #else WT_UNUSED(session); WT_UNUSED(op); WT_UNUSED(ts); - WT_UNUSED(prev_sharedp); #endif return (0); @@ -617,7 +585,7 @@ __wt_txn_set_commit_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t commit_ts __wt_timestamp_to_string(commit_ts, ts_string[0]), __wt_timestamp_to_string(txn->first_commit_timestamp, ts_string[1])); - WT_RET(__txn_assert_after_reads(session, "commit", commit_ts, NULL)); + WT_RET(__txn_assert_after_reads(session, "commit", commit_ts)); } else { /* * For a prepared transaction, the commit timestamp should not be less than the prepare @@ -727,13 +695,11 @@ __wt_txn_set_prepare_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t prepare_ { WT_TXN *txn; WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *prev_shared; wt_timestamp_t oldest_ts; char ts_string[2][WT_TS_INT_STRING_SIZE]; txn = session->txn; txn_global = &S2C(session)->txn_global; - prev_shared = WT_SESSION_TXN_SHARED(session); WT_RET(__wt_txn_context_prepare_check(session)); @@ -744,7 +710,7 @@ __wt_txn_set_prepare_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t prepare_ WT_RET_MSG(session, EINVAL, "commit timestamp should not have been set before the prepare timestamp"); - WT_RET(__txn_assert_after_reads(session, "prepare", prepare_ts, &prev_shared)); + WT_RET(__txn_assert_after_reads(session, "prepare", prepare_ts)); /* * Check whether the prepare timestamp is less than the oldest timestamp. @@ -755,12 +721,6 @@ __wt_txn_set_prepare_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t prepare_ * Check whether the prepare timestamp needs to be rounded up to the oldest timestamp. */ if (F_ISSET(txn, WT_TXN_TS_ROUND_PREPARED)) { - /* - * Check that there are no active readers. That would be a violation of preconditions - * for rounding timestamps of prepared transactions. - */ - WT_ASSERT(session, prev_shared == NULL); - __wt_verbose(session, WT_VERB_TIMESTAMP, "prepare timestamp %s rounded to oldest timestamp %s", __wt_timestamp_to_string(prepare_ts, ts_string[0]), @@ -854,7 +814,7 @@ __wt_txn_set_read_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t read_ts) } else txn_shared->read_timestamp = read_ts; - __wt_txn_publish_read_timestamp(session); + F_SET(txn, WT_TXN_SHARED_TS_READ); __wt_readunlock(session, &txn_global->rwlock); /* @@ -941,13 +901,10 @@ void __wt_txn_publish_durable_timestamp(WT_SESSION_IMPL *session) { WT_TXN *txn; - WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *qtxn_shared, *txn_shared, *txn_shared_tmp; - wt_timestamp_t tmpts, ts; - uint64_t walked; + WT_TXN_SHARED *txn_shared; + wt_timestamp_t ts; txn = session->txn; - txn_global = &S2C(session)->txn_global; txn_shared = WT_SESSION_TXN_SHARED(session); if (F_ISSET(txn, WT_TXN_SHARED_TS_DURABLE)) @@ -968,64 +925,7 @@ __wt_txn_publish_durable_timestamp(WT_SESSION_IMPL *session) } else return; - __wt_writelock(session, &txn_global->durable_timestamp_rwlock); - /* - * If our transaction is on the queue remove it first. The timestamp may move earlier so we - * otherwise might not remove ourselves before finding where to insert ourselves (which would - * result in a list loop) and we don't want to walk more of the list than needed. - */ - if (txn_shared->clear_durable_q) { - TAILQ_REMOVE(&txn_global->durable_timestamph, txn_shared, durable_timestampq); - txn_shared->clear_durable_q = false; - --txn_global->durable_timestampq_len; - } - /* - * Walk the list to look for where to insert our own transaction and remove any transactions - * that are not active. We stop when we get to the location where we want to insert. - */ - if (TAILQ_EMPTY(&txn_global->durable_timestamph)) { - TAILQ_INSERT_HEAD(&txn_global->durable_timestamph, txn_shared, durable_timestampq); - WT_STAT_CONN_INCR(session, txn_durable_queue_empty); - } else { - /* Walk from the start, removing cleared entries. */ - walked = 0; - TAILQ_FOREACH_SAFE( - qtxn_shared, &txn_global->durable_timestamph, durable_timestampq, txn_shared_tmp) - { - ++walked; - /* - * Stop on the first entry that we cannot clear. - */ - if (!qtxn_shared->clear_durable_q) - break; - - TAILQ_REMOVE(&txn_global->durable_timestamph, qtxn_shared, durable_timestampq); - qtxn_shared->clear_durable_q = false; - --txn_global->durable_timestampq_len; - } - - /* - * Now walk backwards from the end to find the correct position for the insert. - */ - qtxn_shared = TAILQ_LAST(&txn_global->durable_timestamph, __wt_txn_dts_qh); - while (qtxn_shared != NULL && - (!__txn_get_durable_timestamp(qtxn_shared, &tmpts) || tmpts > ts)) { - ++walked; - qtxn_shared = TAILQ_PREV(qtxn_shared, __wt_txn_dts_qh, durable_timestampq); - } - if (qtxn_shared == NULL) { - TAILQ_INSERT_HEAD(&txn_global->durable_timestamph, txn_shared, durable_timestampq); - WT_STAT_CONN_INCR(session, txn_durable_queue_head); - } else - TAILQ_INSERT_AFTER( - &txn_global->durable_timestamph, qtxn_shared, txn_shared, durable_timestampq); - WT_STAT_CONN_INCRV(session, txn_durable_queue_walked, walked); - } - ++txn_global->durable_timestampq_len; - WT_STAT_CONN_INCR(session, txn_durable_queue_inserts); txn_shared->pinned_durable_timestamp = ts; - txn_shared->clear_durable_q = false; - __wt_writeunlock(session, &txn_global->durable_timestamp_rwlock); F_SET(txn, WT_TXN_SHARED_TS_DURABLE); } @@ -1045,98 +945,9 @@ __wt_txn_clear_durable_timestamp(WT_SESSION_IMPL *session) if (!F_ISSET(txn, WT_TXN_SHARED_TS_DURABLE)) return; - /* - * Notify other threads that our transaction is inactive and can be cleaned up safely from the - * durable timestamp queue whenever the next thread walks the queue. We do not need to remove it - * now. - */ - txn_shared->clear_durable_q = true; WT_WRITE_BARRIER(); F_CLR(txn, WT_TXN_SHARED_TS_DURABLE); -} - -/* - * __wt_txn_publish_read_timestamp -- - * Publish a transaction's read timestamp. - */ -void -__wt_txn_publish_read_timestamp(WT_SESSION_IMPL *session) -{ - WT_TXN *txn; - WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *qtxn_shared, *txn_shared, *txn_shared_tmp; - wt_timestamp_t tmp_timestamp; - uint64_t walked; - - txn = session->txn; - txn_global = &S2C(session)->txn_global; - txn_shared = WT_SESSION_TXN_SHARED(session); - - if (F_ISSET(txn, WT_TXN_SHARED_TS_READ)) - return; - - __wt_writelock(session, &txn_global->read_timestamp_rwlock); - /* - * If our transaction is on the queue remove it first. The timestamp may move earlier so we - * otherwise might not remove ourselves before finding where to insert ourselves (which would - * result in a list loop) and we don't want to walk more of the list than needed. - */ - if (txn_shared->clear_read_q) { - TAILQ_REMOVE(&txn_global->read_timestamph, txn_shared, read_timestampq); - WT_PUBLISH(txn_shared->clear_read_q, false); - --txn_global->read_timestampq_len; - } - /* - * Walk the list to look for where to insert our own transaction and remove any transactions - * that are not active. We stop when we get to the location where we want to insert. - */ - if (TAILQ_EMPTY(&txn_global->read_timestamph)) { - TAILQ_INSERT_HEAD(&txn_global->read_timestamph, txn_shared, read_timestampq); - WT_STAT_CONN_INCR(session, txn_read_queue_empty); - } else { - /* Walk from the start, removing cleared entries. */ - walked = 0; - TAILQ_FOREACH_SAFE( - qtxn_shared, &txn_global->read_timestamph, read_timestampq, txn_shared_tmp) - { - ++walked; - if (!qtxn_shared->clear_read_q) - break; - - TAILQ_REMOVE(&txn_global->read_timestamph, qtxn_shared, read_timestampq); - WT_PUBLISH(qtxn_shared->clear_read_q, false); - --txn_global->read_timestampq_len; - } - - /* - * Now walk backwards from the end to find the correct position for the insert. - */ - qtxn_shared = TAILQ_LAST(&txn_global->read_timestamph, __wt_txn_rts_qh); - while (qtxn_shared != NULL) { - if (!__txn_get_read_timestamp(qtxn_shared, &tmp_timestamp) || - tmp_timestamp > txn_shared->read_timestamp) { - ++walked; - qtxn_shared = TAILQ_PREV(qtxn_shared, __wt_txn_rts_qh, read_timestampq); - } else - break; - } - if (qtxn_shared == NULL) { - TAILQ_INSERT_HEAD(&txn_global->read_timestamph, txn_shared, read_timestampq); - WT_STAT_CONN_INCR(session, txn_read_queue_head); - } else - TAILQ_INSERT_AFTER( - &txn_global->read_timestamph, qtxn_shared, txn_shared, read_timestampq); - WT_STAT_CONN_INCRV(session, txn_read_queue_walked, walked); - } - /* - * We do not set the read timestamp here. It has been set in the caller because special - * processing for round to oldest. - */ - ++txn_global->read_timestampq_len; - WT_STAT_CONN_INCR(session, txn_read_queue_inserts); - txn_shared->clear_read_q = false; - F_SET(txn, WT_TXN_SHARED_TS_READ); - __wt_writeunlock(session, &txn_global->read_timestamp_rwlock); + txn_shared->pinned_durable_timestamp = WT_TS_NONE; } /* @@ -1156,62 +967,8 @@ __wt_txn_clear_read_timestamp(WT_SESSION_IMPL *session) /* Assert the read timestamp is greater than or equal to the pinned timestamp. */ WT_ASSERT(session, txn_shared->read_timestamp >= S2C(session)->txn_global.pinned_timestamp); - /* - * Notify other threads that our transaction is inactive and can be cleaned up safely from - * the read timestamp queue whenever the next thread walks the queue. We do not need to - * remove it now. - */ - txn_shared->clear_read_q = true; WT_WRITE_BARRIER(); - F_CLR(txn, WT_TXN_SHARED_TS_READ); } txn_shared->read_timestamp = WT_TS_NONE; } - -/* - * __wt_txn_clear_timestamp_queues -- - * We're about to clear the session and overwrite the txn structure. Remove ourselves from the - * commit timestamp queue and the read timestamp queue if we're on either of them. - */ -void -__wt_txn_clear_timestamp_queues(WT_SESSION_IMPL *session) -{ - WT_TXN_GLOBAL *txn_global; - WT_TXN_SHARED *txn_shared; - - txn_shared = WT_SESSION_TXN_SHARED(session); - txn_global = &S2C(session)->txn_global; - - /* - * If we've closed the connection, our transaction shared states may already have been freed. In - * that case, there's nothing more to do here. - */ - if (txn_shared == NULL || (!txn_shared->clear_durable_q && !txn_shared->clear_read_q)) - return; - - if (txn_shared->clear_durable_q) { - __wt_writelock(session, &txn_global->durable_timestamp_rwlock); - /* - * Recheck after acquiring the lock. - */ - if (txn_shared->clear_durable_q) { - TAILQ_REMOVE(&txn_global->durable_timestamph, txn_shared, durable_timestampq); - --txn_global->durable_timestampq_len; - txn_shared->clear_durable_q = false; - } - __wt_writeunlock(session, &txn_global->durable_timestamp_rwlock); - } - if (txn_shared->clear_read_q) { - __wt_writelock(session, &txn_global->read_timestamp_rwlock); - /* - * Recheck after acquiring the lock. - */ - if (txn_shared->clear_read_q) { - TAILQ_REMOVE(&txn_global->read_timestamph, txn_shared, read_timestampq); - --txn_global->read_timestampq_len; - txn_shared->clear_read_q = false; - } - __wt_writeunlock(session, &txn_global->read_timestamp_rwlock); - } -} |