mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
[t:4920], remove ydb lock from indexer->close and indexer->abort
git-svn-id: file:///svn/toku/tokudb@44161 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
30d3c88aeb
commit
6df16a0e0e
1 changed files with 19 additions and 28 deletions
|
@ -329,27 +329,23 @@ close_indexer(DB_INDEXER *indexer) {
|
||||||
int r = 0;
|
int r = 0;
|
||||||
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
|
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
|
||||||
|
|
||||||
toku_ydb_lock();
|
// Mark txn as needing a checkpoint.
|
||||||
{
|
// (This will cause a local checkpoint of created index files, which is necessary
|
||||||
// Mark txn as needing a checkpoint.
|
// because these files are not necessarily on disk and all the operations
|
||||||
// (This will cause a local checkpoint of created index files, which is necessary
|
// to create them are not in the recovery log.)
|
||||||
// because these files are not necessarily on disk and all the operations
|
DB_TXN *txn = indexer->i->txn;
|
||||||
// to create them are not in the recovery log.)
|
TOKUTXN tokutxn = db_txn_struct_i(txn)->tokutxn;
|
||||||
DB_TXN *txn = indexer->i->txn;
|
//BRT brt; // caused a warning with -Wunused-but-set-variable
|
||||||
TOKUTXN tokutxn = db_txn_struct_i(txn)->tokutxn;
|
//DB *db;
|
||||||
//BRT brt; // caused a warning with -Wunused-but-set-variable
|
for (int which_db = 0; which_db < indexer->i->N ; which_db++) {
|
||||||
//DB *db;
|
//db = indexer->i->dest_dbs[which_db];
|
||||||
for (int which_db = 0; which_db < indexer->i->N ; which_db++) {
|
//brt = db_struct_i(db)->ft_handle;
|
||||||
//db = indexer->i->dest_dbs[which_db];
|
toku_txn_require_checkpoint_on_commit(tokutxn);
|
||||||
//brt = db_struct_i(db)->ft_handle;
|
|
||||||
toku_txn_require_checkpoint_on_commit(tokutxn);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disassociate the indexer from the hot db and free_indexer
|
|
||||||
disassociate_indexer_from_hot_dbs(indexer);
|
|
||||||
free_indexer(indexer);
|
|
||||||
}
|
}
|
||||||
toku_ydb_unlock();
|
|
||||||
|
// Disassociate the indexer from the hot db and free_indexer
|
||||||
|
disassociate_indexer_from_hot_dbs(indexer);
|
||||||
|
free_indexer(indexer);
|
||||||
|
|
||||||
if ( r == 0 ) {
|
if ( r == 0 ) {
|
||||||
(void) __sync_fetch_and_add(&STATUS_VALUE(INDEXER_CLOSE), 1);
|
(void) __sync_fetch_and_add(&STATUS_VALUE(INDEXER_CLOSE), 1);
|
||||||
|
@ -363,14 +359,9 @@ static int
|
||||||
abort_indexer(DB_INDEXER *indexer) {
|
abort_indexer(DB_INDEXER *indexer) {
|
||||||
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
|
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
|
||||||
(void) __sync_fetch_and_add(&STATUS_VALUE(INDEXER_ABORT), 1);
|
(void) __sync_fetch_and_add(&STATUS_VALUE(INDEXER_ABORT), 1);
|
||||||
|
// Disassociate the indexer from the hot db and free_indexer
|
||||||
toku_ydb_lock();
|
disassociate_indexer_from_hot_dbs(indexer);
|
||||||
{
|
free_indexer(indexer);
|
||||||
// Disassociate the indexer from the hot db and free_indexer
|
|
||||||
disassociate_indexer_from_hot_dbs(indexer);
|
|
||||||
free_indexer(indexer);
|
|
||||||
}
|
|
||||||
toku_ydb_unlock();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue