Commit c8ab6ce3 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4962], remove ydb lock usage from create indexer

git-svn-id: file:///svn/toku/tokudb@44105 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6a11dae1
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <ft/ule.h> #include <ft/ule.h>
#include <ft/xids.h> #include <ft/xids.h>
#include <ft/log-internal.h> #include <ft/log-internal.h>
#include <ft/checkpoint.h>
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Engine status // Engine status
...@@ -179,7 +180,6 @@ toku_indexer_create_indexer(DB_ENV *env, ...@@ -179,7 +180,6 @@ toku_indexer_create_indexer(DB_ENV *env,
indexer->close = close_indexer; indexer->close = close_indexer;
indexer->abort = abort_indexer; indexer->abort = abort_indexer;
toku_ydb_unlock();
// //
// create and close a dummy loader to get redirection going for the hot indexer // create and close a dummy loader to get redirection going for the hot indexer
// This way, if the hot index aborts, but other transactions have references to the // This way, if the hot index aborts, but other transactions have references to the
...@@ -197,7 +197,6 @@ toku_indexer_create_indexer(DB_ENV *env, ...@@ -197,7 +197,6 @@ toku_indexer_create_indexer(DB_ENV *env,
goto create_exit; goto create_exit;
} }
} }
toku_ydb_lock();
// create and initialize the leafentry cursor // create and initialize the leafentry cursor
rval = le_cursor_create(&indexer->i->lec, db_struct_i(src_db)->ft_handle, db_txn_struct_i(txn)->tokutxn); rval = le_cursor_create(&indexer->i->lec, db_struct_i(src_db)->ft_handle, db_txn_struct_i(txn)->tokutxn);
...@@ -207,7 +206,9 @@ toku_indexer_create_indexer(DB_ENV *env, ...@@ -207,7 +206,9 @@ toku_indexer_create_indexer(DB_ENV *env,
LSN hot_index_lsn; // not used (yet) LSN hot_index_lsn; // not used (yet)
TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn; TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
FILENUMS filenums = indexer->i->filenums; FILENUMS filenums = indexer->i->filenums;
toku_multi_operation_client_lock();
rval = toku_ft_hot_index(NULL, ttxn, filenums, 1, &hot_index_lsn); rval = toku_ft_hot_index(NULL, ttxn, filenums, 1, &hot_index_lsn);
toku_multi_operation_client_unlock();
if (rval == 0) { if (rval == 0) {
rval = associate_indexer_with_hot_dbs(indexer, dest_dbs, N); rval = associate_indexer_with_hot_dbs(indexer, dest_dbs, N);
......
...@@ -1505,21 +1505,6 @@ env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) { ...@@ -1505,21 +1505,6 @@ env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) {
return r; return r;
} }
static int
locked_env_create_indexer(DB_ENV *env,
DB_TXN *txn,
DB_INDEXER **indexerp,
DB *src_db,
int N,
DB *dest_dbs[N],
uint32_t db_flags[N],
uint32_t indexer_flags) {
toku_ydb_lock();
int r = toku_indexer_create_indexer(env, txn, indexerp, src_db, N, dest_dbs, db_flags, indexer_flags);
toku_ydb_unlock();
return r;
}
static int static int
env_create_loader(DB_ENV *env, env_create_loader(DB_ENV *env,
DB_TXN *txn, DB_TXN *txn,
...@@ -1534,8 +1519,6 @@ env_create_loader(DB_ENV *env, ...@@ -1534,8 +1519,6 @@ env_create_loader(DB_ENV *env,
return r; return r;
} }
static int static int
env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) { env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) {
HANDLE_PANICKED_ENV(env); HANDLE_PANICKED_ENV(env);
...@@ -2181,7 +2164,6 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) { ...@@ -2181,7 +2164,6 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
SENV(dbremove); SENV(dbremove);
SENV(dbrename); SENV(dbrename);
//SENV(set_noticecall); //SENV(set_noticecall);
SENV(create_indexer);
#undef SENV #undef SENV
#define USENV(name) result->name = env_ ## name #define USENV(name) result->name = env_ ## name
// methods with locking done internally // methods with locking done internally
...@@ -2234,10 +2216,11 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) { ...@@ -2234,10 +2216,11 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
USENV(set_redzone); USENV(set_redzone);
USENV(log_flush); USENV(log_flush);
USENV(log_archive); USENV(log_archive);
USENV(create_loader);
#undef USENV #undef USENV
// unlocked methods // unlocked methods
result->create_indexer = toku_indexer_create_indexer;
result->txn_checkpoint = toku_env_txn_checkpoint; result->txn_checkpoint = toku_env_txn_checkpoint;
result->checkpointing_postpone = env_checkpointing_postpone; result->checkpointing_postpone = env_checkpointing_postpone;
result->checkpointing_resume = env_checkpointing_resume; result->checkpointing_resume = env_checkpointing_resume;
...@@ -2248,7 +2231,6 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) { ...@@ -2248,7 +2231,6 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
result->get_engine_status_text = env_get_engine_status_text; result->get_engine_status_text = env_get_engine_status_text;
result->crash = env_crash; // handlerton's call to fractal tree layer on failed assert result->crash = env_crash; // handlerton's call to fractal tree layer on failed assert
result->txn_begin = locked_txn_begin; result->txn_begin = locked_txn_begin;
result->create_loader = env_create_loader;
MALLOC(result->i); MALLOC(result->i);
if (result->i == 0) { r = ENOMEM; goto cleanup; } if (result->i == 0) { r = ENOMEM; goto cleanup; }
......
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