Commit 9919eb8d authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4872], remove a couple of more instances of ydb lock

git-svn-id: file:///svn/toku/tokudb@44044 c7de825b-a66e-492c-adef-691d508d4ae1
parent 112fb6b3
...@@ -730,14 +730,16 @@ toku_db_hot_optimize(DB *db, ...@@ -730,14 +730,16 @@ toku_db_hot_optimize(DB *db,
static int static int
locked_db_optimize(DB *db) { locked_db_optimize(DB *db) {
toku_ydb_lock(); // need to protect from checkpointing because
// toku_db_optimize does a message injection
toku_multi_operation_client_lock(); //Cannot begin checkpoint
int r = toku_db_optimize(db); int r = toku_db_optimize(db);
toku_ydb_unlock(); toku_multi_operation_client_unlock();
return r; return r;
} }
static int static int
db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) { toku_db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
HANDLE_PANICKED_DB(db); HANDLE_PANICKED_DB(db);
int r; int r;
if (!db_opened(db)) if (!db_opened(db))
...@@ -747,14 +749,6 @@ db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) { ...@@ -747,14 +749,6 @@ db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
return r; return r;
} }
static int
locked_db_get_fragmentation(DB * db, TOKU_DB_FRAGMENTATION report) {
toku_ydb_lock();
int r = db_get_fragmentation(db, report);
toku_ydb_unlock();
return r;
}
int int
toku_db_set_indexer(DB *db, DB_INDEXER * indexer) { toku_db_set_indexer(DB *db, DB_INDEXER * indexer) {
int r = 0; int r = 0;
...@@ -852,7 +846,6 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) { ...@@ -852,7 +846,6 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
SDB(open); SDB(open);
SDB(change_descriptor); SDB(change_descriptor);
SDB(optimize); SDB(optimize);
SDB(get_fragmentation);
#undef SDB #undef SDB
// methods that do not take the ydb lock // methods that do not take the ydb lock
#define USDB(name) result->name = toku_db_ ## name #define USDB(name) result->name = toku_db_ ## name
...@@ -877,6 +870,7 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) { ...@@ -877,6 +870,7 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
USDB(cursor); USDB(cursor);
USDB(dbt_pos_infty); USDB(dbt_pos_infty);
USDB(dbt_neg_infty); USDB(dbt_neg_infty);
USDB(get_fragmentation);
#undef USDB #undef USDB
result->get_indexer = db_get_indexer; result->get_indexer = db_get_indexer;
result->del = autotxn_db_del; result->del = autotxn_db_del;
......
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