diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-07-20 12:20:46 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-07-20 12:24:11 +1000 |
commit | 5a2533ebc3606973fbe237228b9bacdcb21a532b (patch) | |
tree | 66805f578f761446f1cdd6637dcfaa90c60e1388 /src/third_party/wiredtiger/src/include/log.h | |
parent | 634435949c4b855b9cc5bfbf5cf481d8158fd996 (diff) | |
download | mongo-5a2533ebc3606973fbe237228b9bacdcb21a532b.tar.gz |
Import wiredtiger: 6173a98979715ed727c432c1a31da64ea8a37048 from branch mongodb-3.6
ref: ff10db8811..6173a98979
for: 3.5.11
WT-3039 Enhance logging so new log files no longer need to wait for the previous log file to be synced
WT-3138 Enhance eviction statistics
WT-3140 Enhance json mode statistics to better support per-dhandle statistics
WT-3310 Add support to WT_SESSION::alter to change table log setting
WT-3329 With a uniform workload and a number of small collections, eviction does a poor job of selecting candidates for eviction.
WT-3381 Improve concurrency in the transaction subsystem
WT-3394 Build WiredTiger with gcc7
WT-3396 test/csuite/wt3363_checkpoint_op_races, test_utility cleanups
WT-3397 Coverity lint
WT-3398 in-memory configurations don't support schema_worker operations
WT-3401 Lint and minor cleanup
WT-3402 Move cached overflow records to the update list.
WT-3403 Automated tests timeout running csuite
WT-3409 WiredTiger generations can silently self-deadlock.
WT-3413 Add more aggressive compile warning flags to Jenkins Windows job
WT-3415 setting timestamp in txn_state requires the global write lock
WT-3421 Compilation error unreachable code in test/csuite/wt3363_checkpoint_op_races
WT-3424 additional gcc 7.1 compile warnings.
WT-3425 workgen: add ability to reopen cursors
WT-3426 Add new wtperf configuration to automated performance testing
WT-3438 Don't tune eviction thread count when the count is fixed
Also explicitly disable v2 log records via a configuration setting in MongoDB -
this will later be plumbed into the feature compatability version mechanism.
Diffstat (limited to 'src/third_party/wiredtiger/src/include/log.h')
-rw-r--r-- | src/third_party/wiredtiger/src/include/log.h | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/third_party/wiredtiger/src/include/log.h b/src/third_party/wiredtiger/src/include/log.h index e7bc28cd220..e6acdd1e834 100644 --- a/src/third_party/wiredtiger/src/include/log.h +++ b/src/third_party/wiredtiger/src/include/log.h @@ -42,7 +42,7 @@ union __wt_lsn { #define WT_ZERO_LSN(l) WT_SET_LSN((l), 0, 0) /* - * Initialize LSN is (1,0). We only need to shift the 1 for comparison. + * Test for initial LSN. We only need to shift the 1 for comparison. */ #define WT_IS_INIT_LSN(l) ((l)->file_offset == ((uint64_t)1 << 32)) /* @@ -52,6 +52,10 @@ union __wt_lsn { #define WT_IS_MAX_LSN(lsn) \ ((lsn)->l.file == UINT32_MAX && \ ((lsn)->l.offset == INT32_MAX || (lsn)->l.offset == UINT32_MAX)) +/* + * Test for zero LSN. + */ +#define WT_IS_ZERO_LSN(l) ((l)->file_offset == 0) /* * Both of the macros below need to change if the content of __wt_lsn @@ -198,10 +202,11 @@ struct __wt_myslot { uint32_t flags; /* Flags */ }; -#define WT_LOG_FIRST_RECORD log->allocsize +#define WT_LOG_END_HEADER log->allocsize struct __wt_log { uint32_t allocsize; /* Allocation alignment size */ + uint32_t first_record; /* Offset of first record in file */ wt_off_t log_written; /* Amount of log written this period */ /* * Log file information @@ -215,6 +220,8 @@ struct __wt_log { WT_FH *log_close_fh; /* Logging file handle to close */ WT_LSN log_close_lsn; /* LSN needed to close */ + uint16_t log_version; /* Version of log file */ + /* * System LSNs */ @@ -232,6 +239,7 @@ struct __wt_log { * Synchronization resources */ WT_SPINLOCK log_lock; /* Locked: Logging fields */ + WT_SPINLOCK log_fs_lock; /* Locked: tmp, prep and log files */ WT_SPINLOCK log_slot_lock; /* Locked: Consolidation array */ WT_SPINLOCK log_sync_lock; /* Locked: Single-thread fsync */ WT_SPINLOCK log_writelsn_lock; /* Locked: write LSN */ @@ -261,8 +269,9 @@ struct __wt_log { uint64_t write_calls; /* Calls to log_write */ #endif -#define WT_LOG_OPENED 0x01 /* Log subsystem successfully open */ -#define WT_LOG_TRUNCATE_NOTSUP 0x02 /* File system truncate not supported */ +#define WT_LOG_FORCE_NEWFILE 0x01 /* Force switch to new log file */ +#define WT_LOG_OPENED 0x02 /* Log subsystem successfully open */ +#define WT_LOG_TRUNCATE_NOTSUP 0x04 /* File system truncate not supported */ uint32_t flags; }; @@ -303,12 +312,22 @@ __wt_log_record_byteswap(WT_LOG_RECORD *record) struct __wt_log_desc { #define WT_LOG_MAGIC 0x101064 uint32_t log_magic; /* 00-03: Magic number */ -#define WT_LOG_MAJOR_VERSION 1 - uint16_t majorv; /* 04-05: Major version */ -#define WT_LOG_MINOR_VERSION 0 - uint16_t minorv; /* 06-07: Minor version */ +#define WT_LOG_VERSION 2 + uint16_t version; /* 04-05: Log version */ + uint16_t unused; /* 06-07: Unused */ uint64_t log_size; /* 08-15: Log file size */ }; +/* + * This is the log version that introduced the system record. + */ +#define WT_LOG_VERSION_SYSTEM 2 + +/* + * WiredTiger release version where log format version changed. + * We only have to check the major version for now. It is minor + * version 0 once release numbers move on. + */ +#define WT_LOG_V2 3 /* * __wt_log_desc_byteswap -- @@ -320,8 +339,8 @@ __wt_log_desc_byteswap(WT_LOG_DESC *desc) { #ifdef WORDS_BIGENDIAN desc->log_magic = __wt_bswap32(desc->log_magic); - desc->majorv = __wt_bswap16(desc->majorv); - desc->minorv = __wt_bswap16(desc->minorv); + desc->version = __wt_bswap16(desc->version); + desc->unused = __wt_bswap16(desc->unused); desc->log_size = __wt_bswap64(desc->log_size); #else WT_UNUSED(desc); |