diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/row_key.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/row_key.c | 80 |
1 files changed, 32 insertions, 48 deletions
diff --git a/src/third_party/wiredtiger/src/btree/row_key.c b/src/third_party/wiredtiger/src/btree/row_key.c index c017e7c8a9c..d0524dfe5a3 100644 --- a/src/third_party/wiredtiger/src/btree/row_key.c +++ b/src/third_party/wiredtiger/src/btree/row_key.c @@ -180,17 +180,15 @@ __wt_row_leaf_key_work( copy = WT_ROW_KEY_COPY(rip); #ifdef HAVE_DIAGNOSTIC /* - * Debugging added to detect and gather information for rare hang. Detect and abort if the - * current operation takes too long. + * Debugging added to detect and gather information for rare hang, WT-5043. Detect and abort + * if the current function call or operation takes too long (and 5 minutes is an eternity). */ __wt_seconds32(session, ¤t); WT_ERR_ASSERT(session, (current - start) < WT_MINUTE * 5, EINVAL, - "Current function call taking too long: current %" PRIu32 " func started %" PRIu32, - current, start); + "call tracking for WT-5043: %s took longer than 5 minutes", __func__); WT_ERR_ASSERT(session, - session->op_start == 0 || ((current - session->op_start) < WT_MINUTE * 5), EINVAL, - "Operation taking too long: current %" PRIu32 " started %" PRIu32, current, - session->op_start); + (session->op_5043_seconds == 0 || (current - session->op_5043_seconds) < WT_MINUTE * 5), + EINVAL, "operation tracking for WT-5043: %s took longer than 5 minutes", session->name); #endif /* @@ -204,15 +202,12 @@ __wt_row_leaf_key_work( keyb->size = size; /* - * If this is the key we originally wanted, we don't - * care if we're rolling forward or backward, or if - * it's an overflow key or not, it's what we wanted. - * This shouldn't normally happen, the fast-path code - * that front-ends this function will have figured it - * out before we were called. + * If this is the key we originally wanted, we don't care if we're rolling forward or + * backward, or if it's an overflow key or not, it's what we wanted. This shouldn't + * normally happen, the fast-path code that front-ends this function will have figured + * it out before we were called. * - * The key doesn't need to be instantiated, skip past - * that test. + * The key doesn't need to be instantiated, skip past that test. */ if (slot_offset == 0) goto done; @@ -231,13 +226,11 @@ __wt_row_leaf_key_work( /* 2: the test for an instantiated off-page key. */ if (ikey != NULL) { /* - * If this is the key we originally wanted, we don't - * care if we're rolling forward or backward, or if - * it's an overflow key or not, it's what we wanted. - * Take a copy and wrap up. + * If this is the key we originally wanted, we don't care if we're rolling forward or + * backward, or if it's an overflow key or not, it's what we wanted. Take a copy and + * wrap up. * - * The key doesn't need to be instantiated, skip past - * that test. + * The key doesn't need to be instantiated, skip past that test. */ if (slot_offset == 0) { keyb->data = p; @@ -283,19 +276,15 @@ __wt_row_leaf_key_work( /* 3: the test for an on-page reference to an overflow key. */ if (unpack->type == WT_CELL_KEY_OVFL) { /* - * If this is the key we wanted from the start, we don't - * care if it's an overflow key, get a copy and wrap up. + * If this is the key we wanted from the start, we don't care if it's an overflow key, + * get a copy and wrap up. * - * Avoid racing with reconciliation deleting overflow - * keys. Deleted overflow keys must be instantiated - * first, acquire the overflow lock and check. Read - * the key if we still need to do so, but holding the - * overflow lock. Note we are not using the version of - * the cell-data-ref calls that acquire the overflow - * lock and do a look-aside into the tracking cache: - * this is an overflow key, not a value, meaning it's - * instantiated before being deleted, not copied into - * the tracking cache. + * Avoid racing with reconciliation deleting overflow keys. Deleted overflow keys must + * be instantiated first, acquire the overflow lock and check. Read the key if we still + * need to do so, but holding the overflow lock. Note we are not using the version of + * the cell-data-ref calls that acquire the overflow lock and do a look-aside into the + * tracking cache: this is an overflow key, not a value, meaning it's instantiated + * before being deleted, not copied into the tracking cache. */ if (slot_offset == 0) { __wt_readlock(session, &btree->ovfl_lock); @@ -364,16 +353,13 @@ __wt_row_leaf_key_work( */ if (direction == BACKWARD) { /* - * If there's a set of keys with identical prefixes, we - * don't want to instantiate each one, the prefixes are - * all the same. + * If there's a set of keys with identical prefixes, we don't want to instantiate each + * one, the prefixes are all the same. * - * As we roll backward through the page, track the last - * time the prefix decreased in size, so we can start - * with that key during our roll-forward. For a page - * populated with a single key prefix, we'll be able to - * instantiate the key we want as soon as we find a key - * without a prefix. + * As we roll backward through the page, track the last time the prefix decreased in + * size, so we can start with that key during our roll-forward. For a page populated + * with a single key prefix, we'll be able to instantiate the key we want as soon as we + * find a key without a prefix. */ if (slot_offset == 0) last_prefix = unpack->prefix; @@ -400,13 +386,11 @@ __wt_row_leaf_key_work( } /* - * Grow the buffer as necessary as well as ensure data - * has been copied into local buffer space, then append - * the suffix to the prefix already in the buffer. + * Grow the buffer as necessary as well as ensure data has been copied into local buffer + * space, then append the suffix to the prefix already in the buffer. * - * Don't grow the buffer unnecessarily or copy data we - * don't need, truncate the item's data length to the - * prefix bytes. + * Don't grow the buffer unnecessarily or copy data we don't need, truncate the item's + * data length to the prefix bytes. */ keyb->size = unpack->prefix; WT_ERR(__wt_buf_grow(session, keyb, keyb->size + size)); |