Commit c7fa6070 authored by Yoni Fogel's avatar Yoni Fogel

Addresses #1866 refs [t:1866] Disable implicit promotion on query

Added option to easily toggle implicit promotion on query
Disabled for now because of tickets [t:1903] [t:1906]

git-svn-id: file:///svn/toku/tokudb@13679 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9219a876
......@@ -1288,7 +1288,7 @@ maybe_bump_nkeys (BRTNODE node, u_int32_t idx, LEAFENTRY le, int direction) {
assert(node->u.l.leaf_stats.exact);
}
static void
static void UU()
brt_leaf_apply_full_promotion_once (BRTNODE node, LEAFENTRY le)
// Effect: fully promote leafentry
// le is old leafentry (and new one)
......@@ -1347,7 +1347,7 @@ brt_leaf_apply_full_promotion_once (BRTNODE node, LEAFENTRY le)
}
static void
maybe_do_implicit_promotion_on_query (BRT_CURSOR brtcursor, LEAFENTRY le) {
maybe_do_implicit_promotion_on_query (BRT_CURSOR UU(brtcursor), LEAFENTRY UU(le)) {
//Requires: le is not a provdel (Callers never call it unless not provdel).
//assert(!le_is_provdel(le)); //Must be as fast as possible. Assert is superfluous.
......@@ -1362,10 +1362,12 @@ maybe_do_implicit_promotion_on_query (BRT_CURSOR brtcursor, LEAFENTRY le) {
// * We allow errors here to improve speed.
// * We will sometimes say a txn is uncommitted when it is committed.
// * We will NEVER say a txn is committed when it is uncommitted.
#if DO_IMPLICIT_PROMOTION_ON_QUERY
TXNID outermost_uncommitted_xid = le_outermost_uncommitted_xid(le);
if (outermost_uncommitted_xid != 0 && outermost_uncommitted_xid < brtcursor->oldest_living_xid) {
brt_leaf_apply_full_promotion_once(brtcursor->leaf_info.node, le);
}
#endif
}
static int
......
......@@ -52,5 +52,6 @@
#include "wbuf.h"
#include "../include/db.h"
#include "tokuconst.h"
#endif
......@@ -12,5 +12,7 @@
enum {MAX_NESTED_TRANSACTIONS = 253};
enum {MAX_TRANSACTION_RECORDS = MAX_NESTED_TRANSACTIONS + 1};
#define DO_IMPLICIT_PROMOTION_ON_QUERY 0
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment