diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_curprev.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_curprev.c | 61 |
1 files changed, 25 insertions, 36 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_curprev.c b/src/third_party/wiredtiger/src/btree/bt_curprev.c index 315f0f5b654..2a91695ebd2 100644 --- a/src/third_party/wiredtiger/src/btree/bt_curprev.c +++ b/src/third_party/wiredtiger/src/btree/bt_curprev.c @@ -11,13 +11,12 @@ /* * Walking backwards through skip lists. * - * The skip list stack is an array of pointers set up by a search. It points - * to the position a node should go in the skip list. In other words, the skip - * list search stack always points *after* the search item (that is, into the - * search item's next array). + * The skip list stack is an array of pointers set up by a search. It points to the position a node + * should go in the skip list. In other words, the skip list search stack always points *after* the + * search item (that is, into the search item's next array). * - * Helper macros to go from a stack pointer at level i, pointing into a next - * array, back to the insert node containing that next array. + * Helper macros to go from a stack pointer at level i, pointing into a next array, back to the + * insert node containing that next array. */ #undef PREV_ITEM #define PREV_ITEM(ins_head, insp, i) \ @@ -73,13 +72,11 @@ restart: break; /* - * Find a starting point for the new search. That is either at the - * non-moving node if we found a valid node, or the beginning of the - * next list down that is not the current node. + * Find a starting point for the new search. That is either at the non-moving node if we found a + * valid node, or the beginning of the next list down that is not the current node. * - * Since it is the beginning of a list, and we know the current node is - * has a skip depth at least this high, any node we find must sort - * before the current node. + * Since it is the beginning of a list, and we know the current node is has a skip depth at + * least this high, any node we find must sort before the current node. */ if (ins == NULL || ins == current) for (; i >= 0; i--) { @@ -390,14 +387,12 @@ __cursor_var_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) if (__wt_cell_rle(&unpack) == 1) continue; /* - * There can be huge gaps in the variable-length - * column-store name space appearing as deleted - * records. If more than one deleted record, do - * the work of finding the next record to return - * instead of looping through the records. + * There can be huge gaps in the variable-length column-store name space appearing + * as deleted records. If more than one deleted record, do the work of finding the + * next record to return instead of looping through the records. * - * First, find the largest record in the update - * list that's smaller than the current record. + * First, find the largest record in the update list that's smaller than the current + * record. */ ins = __col_insert_search_lt(cbt->ins_head, cbt->recno); @@ -454,13 +449,11 @@ __cursor_row_prev(WT_CURSOR_BTREE *cbt, bool newpage, bool restart) cbt->iter_retry = WT_CBT_RETRY_NOTSET; /* - * For row-store pages, we need a single item that tells us the part - * of the page we're walking (otherwise switching from next to prev - * and vice-versa is just too complicated), so we map the WT_ROW and - * WT_INSERT_HEAD insert array slots into a single name space: slot 1 - * is the "smallest key insert list", slot 2 is WT_ROW[0], slot 3 is - * WT_INSERT_HEAD[0], and so on. This means WT_INSERT lists are - * odd-numbered slots, and WT_ROW array slots are even-numbered slots. + * For row-store pages, we need a single item that tells us the part of the page we're walking + * (otherwise switching from next to prev and vice-versa is just too complicated), so we map the + * WT_ROW and WT_INSERT_HEAD insert array slots into a single name space: slot 1 is the + * "smallest key insert list", slot 2 is WT_ROW[0], slot 3 is WT_INSERT_HEAD[0], and so on. This + * means WT_INSERT lists are odd-numbered slots, and WT_ROW array slots are even-numbered slots. * * Initialize for each new page. */ @@ -659,17 +652,13 @@ err: F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT); #ifdef HAVE_DIAGNOSTIC /* - * Skip key order check, if next is called after a prev returned - * a prepare conflict error, i.e cursor has changed direction - * at a prepared update, hence current key returned could be - * same as earlier returned key. + * Skip key order check, if next is called after a prev returned a prepare conflict error, + * i.e cursor has changed direction at a prepared update, hence current key returned could + * be same as earlier returned key. * - * eg: Initial data set : (2,3,...10) - * insert key 1 in a prepare transaction. - * loop on prev will return 10,...3,2 and subsequent call to - * prev will return a prepare conflict. Now if we call next - * key 2 will be returned which will be same as earlier - * returned key. + * eg: Initial data set : (2,3,...10) insert key 1 in a prepare transaction. loop on prev + * will return 10,...3,2 and subsequent call to prev will return a prepare conflict. Now if + * we call next key 2 will be returned which will be same as earlier returned key. */ if (!F_ISSET(cbt, WT_CBT_ITERATE_RETRY_NEXT)) ret = __wt_cursor_key_order_check(session, cbt, false); |