Commit 047b0b65 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:2181], [t:2182], plug transaction leak, cleanup some code

git-svn-id: file:///svn/mysql/tokudb-engine/src@15873 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2d3f9da4
...@@ -48,18 +48,20 @@ static const char *ha_tokudb_exts[] = { ...@@ -48,18 +48,20 @@ static const char *ha_tokudb_exts[] = {
ha_tokudb_ext, ha_tokudb_ext,
NullS NullS
}; };
#define declare_lockretry \
int lockretrycount;
#define lockretryN(N) \ #define lockretryN(N) \
for (lockretrycount=0; lockretrycount<(N); lockretrycount++) for (int lockretrycount=0; lockretrycount<(N); lockretrycount++)
#define lockretry lockretryN(100) #define lockretry lockretryN(100)
#define lockretry_wait \ #define lockretry_wait \
do { \ do { \
if (tokudb_debug & TOKUDB_DEBUG_LOCKRETRY) \ if (error != DB_LOCK_NOTGRANTED) { \
break; \
} \
if (tokudb_debug & TOKUDB_DEBUG_LOCKRETRY) { \
TOKUDB_TRACE("%s count=%d\n", __FUNCTION__, lockretrycount); \ TOKUDB_TRACE("%s count=%d\n", __FUNCTION__, lockretrycount); \
} \
usleep((lockretrycount<4 ? (1<<lockretrycount) : (1<<3)) * 1024); \ usleep((lockretrycount<4 ? (1<<lockretrycount) : (1<<3)) * 1024); \
} while (0) } while (0)
...@@ -1605,14 +1607,6 @@ int ha_tokudb::remove_metadata(DB* db, void* key_data, uint key_size, DB_TXN* tr ...@@ -1605,14 +1607,6 @@ int ha_tokudb::remove_metadata(DB* db, void* key_data, uint key_size, DB_TXN* tr
DBT key; DBT key;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
bool do_commit = false; bool do_commit = false;
//
// transaction to be used for putting metadata into status.tokudb
//
error = db_env->txn_begin(db_env, 0, &txn, 0);
if (error) {
goto cleanup;
}
// //
// transaction to be used for putting metadata into status.tokudb // transaction to be used for putting metadata into status.tokudb
// //
...@@ -2700,8 +2694,6 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -2700,8 +2694,6 @@ int ha_tokudb::write_row(uchar * record) {
tokudb_trx_data *trx = NULL; tokudb_trx_data *trx = NULL;
uint curr_num_DBs = table->s->keys + test(hidden_primary_key); uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
declare_lockretry;
is_replace_into = (thd_sql_command(thd) == SQLCOM_REPLACE) || is_replace_into = (thd_sql_command(thd) == SQLCOM_REPLACE) ||
(thd_sql_command(thd) == SQLCOM_REPLACE_SELECT); (thd_sql_command(thd) == SQLCOM_REPLACE_SELECT);
...@@ -2789,8 +2781,6 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -2789,8 +2781,6 @@ int ha_tokudb::write_row(uchar * record) {
&row, &row,
put_flags put_flags
); );
if (error != DB_LOCK_NOTGRANTED)
break;
lockretry_wait; lockretry_wait;
} }
...@@ -2824,8 +2814,6 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -2824,8 +2814,6 @@ int ha_tokudb::write_row(uchar * record) {
&row, &row,
put_flags put_flags
); );
if (error != DB_LOCK_NOTGRANTED)
break;
lockretry_wait; lockretry_wait;
} }
} }
...@@ -2838,8 +2826,6 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -2838,8 +2826,6 @@ int ha_tokudb::write_row(uchar * record) {
&prim_key, &prim_key,
put_flags put_flags
); );
if (error != DB_LOCK_NOTGRANTED)
break;
lockretry_wait; lockretry_wait;
} }
} }
...@@ -4479,9 +4465,6 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) { ...@@ -4479,9 +4465,6 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) {
// QQQ this is here to allow experiments without transactions // QQQ this is here to allow experiments without transactions
int error = 0; int error = 0;
tokudb_trx_data *trx = NULL; tokudb_trx_data *trx = NULL;
#if 0
declare_lockretry;
#endif
trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot);
......
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