diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-01-30 12:34:21 +1100 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-01-30 12:34:21 +1100 |
commit | c07fe5f09c6e71fea0ae20647d9fe28f6b50547a (patch) | |
tree | d0392014b3e289cc119e7d385ef7fbbd503b13c9 /src/third_party | |
parent | f492aeddbf5e4dbd660d7aa297b0cdbe939c4906 (diff) | |
download | mongo-c07fe5f09c6e71fea0ae20647d9fe28f6b50547a.tar.gz |
Import wiredtiger: 06a940e28a0e174adb979600302696a3e126e846 from branch mongodb-3.8
ref: 780756acc2..06a940e28a
for: 3.7.2
WT-3875 Collisions in operation tracking map file when a connection is reopened within the same process.
WT-3876 Missing tracking macros cause inaccuracies in operation tracking logs
Diffstat (limited to 'src/third_party')
-rwxr-xr-x | src/third_party/wiredtiger/dist/s_function | 5 | ||||
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/evict/evict_lru.c | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/connection.h | 1 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/error.h | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/optrack/optrack.c | 5 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c | 10 |
7 files changed, 21 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/dist/s_function b/src/third_party/wiredtiger/dist/s_function index 3259e215d0c..314a8c5bb06 100755 --- a/src/third_party/wiredtiger/dist/s_function +++ b/src/third_party/wiredtiger/dist/s_function @@ -73,10 +73,11 @@ done for f in `find bench examples ext src test -name '*.[ci]'`; do sed -n -e '/API_CALL.*;$/,/API_END.*;/{=;p;}' \ -e '/LSM_.*ENTER*;$/,/LSM_.*LEAVE*;/{=;p;}' \ + -e '/WT_TRACK_OP_INIT/,/WT_TRACK_OP_END/{=;p;}' \ -e '/va_start/,/va_end/{=;p;}' $f | \ sed 'N;s/\n/:/' | \ - egrep -w 'return|WT_RET' | \ - sed -e "s,^,$f:," -e 's/$/ [return skips API_END call]/' + egrep -w 'return;|return \(|WT_RET' | \ + sed -e "s,^,$f:," -e 's/$/ [return skips matching end call]/' done diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 38c38a58c61..f4a23d65d43 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -1,5 +1,5 @@ { - "commit": "780756acc2522d4bcf5f6c6c605ed5fcb77b9548", + "commit": "06a940e28a0e174adb979600302696a3e126e846", "github": "wiredtiger/wiredtiger.git", "vendor": "wiredtiger", "branch": "mongodb-3.8" diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c index 39c84764070..5a799025d8f 100644 --- a/src/third_party/wiredtiger/src/evict/evict_lru.c +++ b/src/third_party/wiredtiger/src/evict/evict_lru.c @@ -2274,7 +2274,7 @@ __evict_page(WT_SESSION_IMPL *session, bool is_server) WT_TRACK_OP_INIT(session); - WT_RET(__evict_get_ref(session, is_server, &btree, &ref)); + WT_RET_TRACK(__evict_get_ref(session, is_server, &btree, &ref)); WT_ASSERT(session, ref->state == WT_REF_LOCKED); app_timer = false; diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h index aef6b2d6777..be21fcb6456 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -193,7 +193,6 @@ struct __wt_connection_impl { WT_FH *optrack_map_fh; /* Name to id translation file. */ WT_SPINLOCK optrack_map_spinlock; /* Translation file spinlock. */ uintmax_t optrack_pid; /* Cache the process ID. */ - uint16_t optrack_uid; /* Unique function ID */ void **foc; /* Free-on-close array */ size_t foc_cnt; /* Array entries */ diff --git a/src/third_party/wiredtiger/src/include/error.h b/src/third_party/wiredtiger/src/include/error.h index a4ef4757ec9..95edf7ed659 100644 --- a/src/third_party/wiredtiger/src/include/error.h +++ b/src/third_party/wiredtiger/src/include/error.h @@ -46,6 +46,13 @@ if ((__ret = (a)) != 0) \ return (__ret); \ } while (0) +#define WT_RET_TRACK(a) do { \ + int __ret; \ + if ((__ret = (a)) != 0) { \ + WT_TRACK_OP_END(session); \ + return (__ret); \ + } \ +} while (0) #define WT_RET_MSG(session, v, ...) do { \ int __ret = (v); \ __wt_err(session, __ret, __VA_ARGS__); \ diff --git a/src/third_party/wiredtiger/src/optrack/optrack.c b/src/third_party/wiredtiger/src/optrack/optrack.c index 8258a715927..dd630785cd5 100644 --- a/src/third_party/wiredtiger/src/optrack/optrack.c +++ b/src/third_party/wiredtiger/src/optrack/optrack.c @@ -10,12 +10,13 @@ /* * __wt_optrack_record_funcid -- - * Record optrack function id + * Allocate and record optrack function ID. */ void __wt_optrack_record_funcid( WT_SESSION_IMPL *session, const char *func, uint16_t *func_idp) { + static uint16_t optrack_uid = 0; /* Unique for the process lifetime. */ WT_CONNECTION_IMPL *conn; WT_DECL_ITEM(tmp); WT_DECL_RET; @@ -27,7 +28,7 @@ __wt_optrack_record_funcid( __wt_spin_lock(session, &conn->optrack_map_spinlock); if (*func_idp == 0) { - *func_idp = ++conn->optrack_uid; + *func_idp = ++optrack_uid; WT_ERR(__wt_buf_fmt( session, tmp, "%" PRIu16 " %s\n", *func_idp, func)); diff --git a/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c b/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c index daaf55d65d2..b944bbda520 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c +++ b/src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c @@ -66,8 +66,10 @@ __wt_cond_wait_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond, /* Fast path if already signalled. */ *signalled = true; - if (__wt_atomic_addi32(&cond->waiters, 1) == 0) + if (__wt_atomic_addi32(&cond->waiters, 1) == 0) { + WT_TRACK_OP_END(session); return; + } __wt_verbose(session, WT_VERB_MUTEX, "wait %s", cond->name); WT_STAT_CONN_INCR(session, cond_wait); @@ -138,10 +140,10 @@ err: (void)__wt_atomic_subi32(&cond->waiters, 1); if (locked) WT_TRET(pthread_mutex_unlock(&cond->mtx)); - if (ret == 0) { - WT_TRACK_OP_END(session); + + WT_TRACK_OP_END(session); + if (ret == 0) return; - } WT_PANIC_MSG(session, ret, "pthread_cond_wait: %s", cond->name); } |