Commit 78b2b393 authored by Yoni Fogel's avatar Yoni Fogel

[t:2494] Merge remaining changes (minor optimizations) to main from read committed branch

git-svn-id: file:///svn/toku/tokudb@19628 c7de825b-a66e-492c-adef-691d508d4ae1
parent 128c1c23
...@@ -4065,10 +4065,10 @@ brt_cursor_cleanup_dbts(BRT_CURSOR c) { ...@@ -4065,10 +4065,10 @@ brt_cursor_cleanup_dbts(BRT_CURSOR c) {
static inline void brt_cursor_extract_key_and_val( static inline void brt_cursor_extract_key_and_val(
LEAFENTRY le, LEAFENTRY le,
BRT_CURSOR cursor, BRT_CURSOR cursor,
u_int32_t* keylen, u_int32_t *keylen,
bytevec* key, void **key,
u_int32_t* vallen, u_int32_t *vallen,
bytevec* val void **val
) )
{ {
if (cursor->is_read_committed) { if (cursor->is_read_committed) {
...@@ -4097,27 +4097,14 @@ static inline void load_dbts_from_omt(BRT_CURSOR c, DBT *key, DBT *val) { ...@@ -4097,27 +4097,14 @@ static inline void load_dbts_from_omt(BRT_CURSOR c, DBT *key, DBT *val) {
OMTVALUE le = 0; OMTVALUE le = 0;
int r = toku_omt_cursor_current(c->omtcursor, &le); int r = toku_omt_cursor_current(c->omtcursor, &le);
assert(r==0); assert(r==0);
u_int32_t keylen;
bytevec key_vec = NULL;
u_int32_t vallen;
bytevec val_vec = NULL;
brt_cursor_extract_key_and_val( brt_cursor_extract_key_and_val(
le, le,
c, c,
&keylen, &key->size,
&key_vec, &key->data,
&vallen, &val->size,
&val_vec &val->data
); );
if (key) {
key->data = (void *)key_vec;
key->size = keylen;
}
if (val) {
val->data = (void *)val_vec;
val->size = vallen;
}
} }
// When an omt cursor is invalidated, this is the brt-level function // When an omt cursor is invalidated, this is the brt-level function
...@@ -4371,9 +4358,9 @@ got_a_good_value: ...@@ -4371,9 +4358,9 @@ got_a_good_value:
maybe_do_implicit_promotion_on_query(brtcursor, le); maybe_do_implicit_promotion_on_query(brtcursor, le);
{ {
u_int32_t keylen; u_int32_t keylen;
bytevec key = NULL; void *key;
u_int32_t vallen; u_int32_t vallen;
bytevec val = NULL; void *val;
brt_cursor_extract_key_and_val( brt_cursor_extract_key_and_val(
le, le,
...@@ -4818,9 +4805,9 @@ brt_cursor_shortcut (BRT_CURSOR cursor, int direction, u_int32_t limit, BRT_GET_ ...@@ -4818,9 +4805,9 @@ brt_cursor_shortcut (BRT_CURSOR cursor, int direction, u_int32_t limit, BRT_GET_
if (!is_le_val_empty(le,cursor)) { if (!is_le_val_empty(le,cursor)) {
maybe_do_implicit_promotion_on_query(cursor, le); maybe_do_implicit_promotion_on_query(cursor, le);
u_int32_t keylen; u_int32_t keylen;
bytevec key = NULL; void *key;
u_int32_t vallen; u_int32_t vallen;
bytevec val = NULL; void *val;
brt_cursor_extract_key_and_val( brt_cursor_extract_key_and_val(
le, le,
......
...@@ -5015,8 +5015,7 @@ static int toku_db_pre_acquire_read_lock(DB *db, DB_TXN *txn, const DBT *key_lef ...@@ -5015,8 +5015,7 @@ static int toku_db_pre_acquire_read_lock(DB *db, DB_TXN *txn, const DBT *key_lef
HANDLE_PANICKED_DB(db); HANDLE_PANICKED_DB(db);
if (!db->i->lt || !txn) return EINVAL; if (!db->i->lt || !txn) return EINVAL;
//READ_UNCOMMITTED and READ_COMMITTED transactions do not need read locks. //READ_UNCOMMITTED and READ_COMMITTED transactions do not need read locks.
if (db_txn_struct_i(txn)->flags&DB_READ_UNCOMMITTED) return 0; if (db_txn_struct_i(txn)->flags&(DB_READ_UNCOMMITTED|DB_READ_COMMITTED)) return 0;
if (db_txn_struct_i(txn)->flags&DB_READ_COMMITTED) return 0;
DB_TXN* txn_anc = toku_txn_ancestor(txn); DB_TXN* txn_anc = toku_txn_ancestor(txn);
int r; int r;
......
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