Commit 4fe10086 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3054 fix closes[t:3054]

git-svn-id: file:///svn/toku/tokudb@26088 c7de825b-a66e-492c-adef-691d508d4ae1
parent f3701dcc
...@@ -332,6 +332,9 @@ generate_log_writer (void) { ...@@ -332,6 +332,9 @@ generate_log_writer (void) {
fprintf(cf, "static u_int64_t toku_lsn_increment=1;\nvoid toku_set_lsn_increment (uint64_t incr) { assert(incr>0 && incr< (16LL<<32)); toku_lsn_increment=incr; }\n"); fprintf(cf, "static u_int64_t toku_lsn_increment=1;\nvoid toku_set_lsn_increment (uint64_t incr) { assert(incr>0 && incr< (16LL<<32)); toku_lsn_increment=incr; }\n");
generate_get_timestamp(); generate_get_timestamp();
DO_LOGTYPES(lt, { DO_LOGTYPES(lt, {
fprintf(hf, "static const size_t toku_log_%s_overhead = (+4+1+8", lt->name);
DO_FIELDS(ft, lt, fprintf(hf, "+%lu", sizeof (ft->type)));
fprintf(hf, "+8);\n");
fprintf2(cf, hf, "int toku_log_%s (TOKULOGGER logger, LSN *lsnp, int do_fsync", lt->name); fprintf2(cf, hf, "int toku_log_%s (TOKULOGGER logger, LSN *lsnp, int do_fsync", lt->name);
DO_FIELDS(ft, lt, fprintf2(cf, hf, ", %s %s", ft->type, ft->name)); DO_FIELDS(ft, lt, fprintf2(cf, hf, ", %s %s", ft->type, ft->name));
fprintf(hf, ");\n"); fprintf(hf, ");\n");
......
...@@ -33,6 +33,7 @@ const char *toku_copyright_string = "Copyright (c) 2007-2009 Tokutek Inc. All r ...@@ -33,6 +33,7 @@ const char *toku_copyright_string = "Copyright (c) 2007-2009 Tokutek Inc. All r
#include "indexer.h" #include "indexer.h"
#include "ydb_load.h" #include "ydb_load.h"
#include "brtloader.h" #include "brtloader.h"
#include "log_header.h"
#ifdef TOKUTRACE #ifdef TOKUTRACE
#define DB_ENV_CREATE_FUN db_env_create_toku10 #define DB_ENV_CREATE_FUN db_env_create_toku10
...@@ -3890,9 +3891,8 @@ log_del_multiple(DB_TXN *txn, DB *src_db, const DBT *key, const DBT *val, uint32 ...@@ -3890,9 +3891,8 @@ log_del_multiple(DB_TXN *txn, DB *src_db, const DBT *key, const DBT *val, uint32
if (num_dbs > 0) { if (num_dbs > 0) {
TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn; TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
BRT src_brt = src_db ? src_db->i->brt : NULL; BRT src_brt = src_db ? src_db->i->brt : NULL;
const uint32_t log_entry_overhead = 24; // rough approximation of the log entry overhead for deletes uint32_t del_multiple_size = key->size + val->size + num_dbs*sizeof (uint32_t) + toku_log_enq_delete_multiple_overhead;
uint32_t del_multiple_size = key->size + val->size + log_entry_overhead; uint32_t del_single_sizes = sum_size(num_dbs, keys, toku_log_enq_delete_any_overhead);
uint32_t del_single_sizes = sum_size(num_dbs, keys, log_entry_overhead);
if (del_single_sizes < del_multiple_size) { if (del_single_sizes < del_multiple_size) {
for (uint32_t i = 0; r == 0 && i < num_dbs; i++) for (uint32_t i = 0; r == 0 && i < num_dbs; i++)
r = log_del_single(txn, brts[i], &keys[i]); r = log_del_single(txn, brts[i], &keys[i]);
......
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