Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d6d58836
Commit
d6d58836
authored
6 years ago
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15773 - trx_allocate_for_background() -> trx_create()
trx_free_resurrected(): Remove, unused function
parent
a5da1c64
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
39 additions
and
75 deletions
+39
-75
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0dict.cc
+2
-2
storage/innobase/dict/dict0load.cc
storage/innobase/dict/dict0load.cc
+2
-2
storage/innobase/dict/dict0stats.cc
storage/innobase/dict/dict0stats.cc
+3
-3
storage/innobase/fts/fts0fts.cc
storage/innobase/fts/fts0fts.cc
+14
-14
storage/innobase/fts/fts0opt.cc
storage/innobase/fts/fts0opt.cc
+2
-2
storage/innobase/fts/fts0que.cc
storage/innobase/fts/fts0que.cc
+1
-1
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+3
-3
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+2
-10
storage/innobase/row/row0ftsort.cc
storage/innobase/row/row0ftsort.cc
+1
-1
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+1
-1
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+3
-3
storage/innobase/row/row0trunc.cc
storage/innobase/row/row0trunc.cc
+1
-1
storage/innobase/trx/trx0purge.cc
storage/innobase/trx/trx0purge.cc
+1
-1
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+3
-31
No files found.
storage/innobase/dict/dict0dict.cc
View file @
d6d58836
...
...
@@ -422,7 +422,7 @@ dict_table_try_drop_aborted(
{
trx_t
*
trx
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"try to drop any indexes after an aborted index creation"
;
row_mysql_lock_data_dictionary
(
trx
);
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_INDEX
);
...
...
@@ -2034,7 +2034,7 @@ dict_table_remove_from_cache_low(
/* When evicting the table definition,
drop the orphan indexes from the data dictionary
and free the index pages. */
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
ut_ad
(
mutex_own
(
&
dict_sys
->
mutex
));
ut_ad
(
rw_lock_own
(
dict_operation_lock
,
RW_LOCK_X
));
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/dict/dict0load.cc
View file @
d6d58836
...
...
@@ -894,7 +894,7 @@ dict_update_filepath(
ut_ad
(
rw_lock_own
(
dict_operation_lock
,
RW_LOCK_X
));
ut_ad
(
mutex_own
(
&
dict_sys
->
mutex
));
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"update filepath"
;
trx
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx
,
TRX_DICT_OP_INDEX
);
...
...
@@ -963,7 +963,7 @@ dict_replace_tablespace_and_filepath(
ut_ad
(
mutex_own
(
&
dict_sys
->
mutex
));
ut_ad
(
filepath
);
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"insert tablespace and filepath"
;
trx
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx
,
TRX_DICT_OP_INDEX
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/dict/dict0stats.cc
View file @
d6d58836
...
...
@@ -299,7 +299,7 @@ dict_stats_exec_sql(
}
if
(
trx
==
NULL
)
{
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx_started
=
true
;
if
(
srv_read_only_mode
)
{
...
...
@@ -2505,7 +2505,7 @@ dict_stats_save(
return
(
ret
);
}
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
trx_start_internal
(
trx
);
dict_index_t
*
index
;
...
...
@@ -2984,7 +2984,7 @@ dict_stats_fetch_from_ps(
stats. */
dict_stats_empty_table
(
table
,
true
);
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
/* Use 'read-uncommitted' so that the SELECTs we execute
do not get blocked in case some user has locked the rows we
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/fts/fts0fts.cc
View file @
d6d58836
...
...
@@ -472,7 +472,7 @@ fts_load_user_stopword(
trx_t
*
trx
;
ibool
has_lock
=
fts
->
fts_status
&
TABLE_DICT_LOCKED
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"Load user stopword table into FTS cache"
;
if
(
!
has_lock
)
{
...
...
@@ -2672,7 +2672,7 @@ fts_cmp_set_sync_doc_id(
fts_table
.
parent
=
table
->
name
.
m_name
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
if
(
srv_read_only_mode
)
{
trx_start_internal_read_only
(
trx
);
}
else
{
...
...
@@ -2801,7 +2801,7 @@ fts_update_sync_doc_id(
}
if
(
!
trx
)
{
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx_start_internal
(
trx
);
trx
->
op_info
=
"setting last FTS document id"
;
...
...
@@ -3042,7 +3042,7 @@ fts_commit_table(
ib_rbt_t
*
rows
;
dberr_t
error
=
DB_SUCCESS
;
fts_cache_t
*
cache
=
ftt
->
table
->
fts
->
cache
;
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
trx_start_internal
(
trx
);
...
...
@@ -3784,7 +3784,7 @@ fts_doc_fetch_by_doc_id(
const
char
*
select_str
;
doc_id_t
write_doc_id
;
dict_index_t
*
index
;
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
que_t
*
graph
;
trx
->
op_info
=
"fetching indexed FTS document"
;
...
...
@@ -4126,7 +4126,7 @@ fts_sync_begin(
sync
->
start_time
=
ut_time
();
sync
->
trx
=
trx_
allocate_for_background
();
sync
->
trx
=
trx_
create
();
trx_start_internal
(
sync
->
trx
);
if
(
fts_enable_diag_print
)
{
...
...
@@ -5001,7 +5001,7 @@ fts_get_rows_count(
ulint
count
=
0
;
char
table_name
[
MAX_FULL_NAME_LEN
];
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"fetching FT table rows count"
;
info
=
pars_info_create
();
...
...
@@ -5072,7 +5072,7 @@ fts_update_max_cache_size(
trx_t
*
trx
;
fts_table_t
fts_table
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
FTS_INIT_FTS_TABLE
(
&
fts_table
,
"CONFIG"
,
FTS_COMMON_TABLE
,
sync
->
table
);
...
...
@@ -6376,7 +6376,7 @@ fts_rename_aux_tables_to_hex_format_low(
continue
;
}
trx_bg
=
trx_
allocate_for_background
();
trx_bg
=
trx_
create
();
trx_bg
->
op_info
=
"Revert half done rename"
;
trx_bg
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx_bg
,
TRX_DICT_OP_TABLE
);
...
...
@@ -6618,7 +6618,7 @@ fts_rename_aux_tables_to_hex_format(
dict_table_t
*
parent_table
)
{
dberr_t
err
;
trx_t
*
trx_rename
=
trx_
allocate_for_background
();
trx_t
*
trx_rename
=
trx_
create
();
trx_rename
->
op_info
=
"Rename aux tables to hex format"
;
trx_rename
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx_rename
,
TRX_DICT_OP_TABLE
);
...
...
@@ -6637,7 +6637,7 @@ fts_rename_aux_tables_to_hex_format(
/* Corrupting the fts index related to parent table. */
trx_t
*
trx_corrupt
;
trx_corrupt
=
trx_
allocate_for_background
();
trx_corrupt
=
trx_
create
();
trx_corrupt
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx_corrupt
,
TRX_DICT_OP_TABLE
);
fts_parent_all_index_set_corrupt
(
trx_corrupt
,
parent_table
);
...
...
@@ -6697,7 +6697,7 @@ fts_drop_obsolete_aux_table_from_vector(
fts_aux_table_t
*
aux_drop_table
;
aux_drop_table
=
static_cast
<
fts_aux_table_t
*>
(
ib_vector_get
(
tables
,
count
));
trx_t
*
trx_drop
=
trx_
allocate_for_background
();
trx_t
*
trx_drop
=
trx_
create
();
trx_drop
->
op_info
=
"Drop obsolete aux tables"
;
trx_drop
->
dict_operation_lock_mode
=
RW_X_LATCH
;
trx_start_for_ddl
(
trx_drop
,
TRX_DICT_OP_TABLE
);
...
...
@@ -7166,7 +7166,7 @@ fts_drop_orphaned_tables(void)
mutex_exit
(
&
fil_system
.
mutex
);
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"dropping orphaned FTS tables"
;
row_mysql_lock_data_dictionary
(
trx
);
...
...
@@ -7322,7 +7322,7 @@ fts_load_stopword(
}
if
(
!
trx
)
{
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
if
(
srv_read_only_mode
)
{
trx_start_internal_read_only
(
trx
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/fts/fts0opt.cc
View file @
d6d58836
...
...
@@ -988,7 +988,7 @@ fts_table_fetch_doc_ids(
ut_a
(
fts_table
->
type
==
FTS_COMMON_TABLE
);
if
(
!
trx
)
{
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
alloc_bk_trx
=
TRUE
;
}
...
...
@@ -1615,7 +1615,7 @@ fts_optimize_create(
optim
->
table
=
table
;
optim
->
trx
=
trx_
allocate_for_background
();
optim
->
trx
=
trx_
create
();
trx_start_internal
(
optim
->
trx
);
optim
->
fts_common_table
.
parent
=
table
->
name
.
m_name
;
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/fts/fts0que.cc
View file @
d6d58836
...
...
@@ -3951,7 +3951,7 @@ fts_query(
*
result
=
NULL
;
memset
(
&
query
,
0x0
,
sizeof
(
query
));
query_trx
=
trx_
allocate_for_background
();
query_trx
=
trx_
create
();
query_trx
->
op_info
=
"FTS query"
;
start_time_ms
=
ut_time_ms
();
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/handler/i_s.cc
View file @
d6d58836
...
...
@@ -2944,7 +2944,7 @@ i_s_fts_deleted_generic_fill(
deleted
=
fts_doc_ids_create
();
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"Select for FTS DELETE TABLE"
;
FTS_INIT_FTS_TABLE
(
&
fts_table
,
...
...
@@ -3477,7 +3477,7 @@ i_s_fts_index_table_fill_selected(
fts_result_cache_limit
=
8192
;
);
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"fetching FTS index nodes"
;
...
...
@@ -3972,7 +3972,7 @@ i_s_fts_config_fill(
DBUG_RETURN
(
0
);
}
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"Select for FTS CONFIG TABLE"
;
FTS_INIT_FTS_TABLE
(
&
fts_table
,
"CONFIG"
,
FTS_COMMON_TABLE
,
user_table
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/include/trx0trx.h
View file @
d6d58836
...
...
@@ -88,17 +88,9 @@ Creates a transaction object for MySQL.
trx_t
*
trx_allocate_for_mysql
(
void
);
/*========================*/
/********************************************************************//**
Creates a transaction object for background operations by the master thread.
@return own: transaction object */
trx_t
*
trx_allocate_for_background
(
void
);
/*=============================*/
/** Frees and initialize a transaction object instantinated during recovery.
@param trx trx object to free and initialize during recovery */
void
trx_free_resurrected
(
trx_t
*
trx
);
/** @return a trx_t instance from trx_pools. */
trx_t
*
trx_create
();
/** Free a transaction that was allocated by background or user threads.
@param trx trx object to free */
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0ftsort.cc
View file @
d6d58836
...
...
@@ -1595,7 +1595,7 @@ row_fts_merge_insert(
/* We use the insert query graph as the dummy graph
needed in the row module call */
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx_start_if_not_started
(
trx
,
true
);
trx
->
op_info
=
"inserting index entries"
;
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0merge.cc
View file @
d6d58836
...
...
@@ -4066,7 +4066,7 @@ row_merge_drop_temp_indexes(void)
/* Load the table definitions that contain partially defined
indexes, so that the data dictionary information can be checked
when accessing the tablename.ibd files. */
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
trx
->
op_info
=
"dropping partially created indexes"
;
row_mysql_lock_data_dictionary
(
trx
);
/* Ensure that this transaction will be rolled back and locks
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0mysql.cc
View file @
d6d58836
...
...
@@ -2717,7 +2717,7 @@ row_drop_table_for_mysql_in_background(
dberr_t
error
;
trx_t
*
trx
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
/* If the original transaction was dropping a table referenced by
foreign keys, we must set the following to be able to drop the
...
...
@@ -2832,7 +2832,7 @@ row_mysql_drop_garbage_tables()
mem_heap_t
*
heap
=
mem_heap_create
(
FN_REFLEN
);
btr_pcur_t
pcur
;
mtr_t
mtr
;
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
trx
->
op_info
=
"dropping garbage tables"
;
row_mysql_lock_data_dictionary
(
trx
);
...
...
@@ -4702,7 +4702,7 @@ row_rename_table_for_mysql(
&&
table
!=
NULL
&&
(
table
->
space
!=
0
))
{
char
*
orig_name
=
table
->
name
.
m_name
;
trx_t
*
trx_bg
=
trx_
allocate_for_background
();
trx_t
*
trx_bg
=
trx_
create
();
/* If the first fts_rename fails, the trx would
be rolled back and committed, we can't use it any more,
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/row/row0trunc.cc
View file @
d6d58836
...
...
@@ -1402,7 +1402,7 @@ row_truncate_update_sys_tables_during_fix_up(
ibool
reserve_dict_mutex
,
bool
mark_index_corrupted
)
{
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
trx_set_dict_operation
(
trx
,
TRX_DICT_OP_TABLE
);
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/trx/trx0purge.cc
View file @
d6d58836
...
...
@@ -138,7 +138,7 @@ purge_graph_build()
{
ut_a
(
srv_n_purge_threads
>
0
);
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
ut_ad
(
!
trx
->
id
);
trx
->
start_time
=
ut_time
();
trx
->
state
=
TRX_STATE_ACTIVE
;
...
...
This diff is collapsed.
Click to expand it.
storage/innobase/trx/trx0trx.cc
View file @
d6d58836
...
...
@@ -394,9 +394,7 @@ trx_pool_close()
}
/** @return a trx_t instance from trx_pools. */
static
trx_t
*
trx_create_low
()
trx_t
*
trx_create
()
{
trx_t
*
trx
=
trx_pools
->
get
();
...
...
@@ -465,20 +463,6 @@ trx_free(trx_t*& trx)
trx
=
NULL
;
}
/********************************************************************//**
Creates a transaction object for background operations by the master thread.
@return own: transaction object */
trx_t
*
trx_allocate_for_background
(
void
)
/*=============================*/
{
trx_t
*
trx
;
trx
=
trx_create_low
();
return
(
trx
);
}
/********************************************************************//**
Creates a transaction object for MySQL.
@return own: transaction object */
...
...
@@ -488,7 +472,7 @@ trx_allocate_for_mysql(void)
{
trx_t
*
trx
;
trx
=
trx_
allocate_for_background
();
trx
=
trx_
create
();
mutex_enter
(
&
trx_sys
.
mutex
);
...
...
@@ -543,18 +527,6 @@ trx_validate_state_before_free(trx_t* trx)
assert_trx_is_inactive
(
trx
);
}
/** Free and initialize a transaction object instantinated during recovery.
@param trx trx object to free and initialize during recovery */
void
trx_free_resurrected
(
trx_t
*
trx
)
{
trx_validate_state_before_free
(
trx
);
trx_init
(
trx
);
trx_free
(
trx
);
}
/** Free a transaction that was allocated by background or user threads.
@param trx trx object to free */
void
...
...
@@ -785,7 +757,7 @@ static void trx_resurrect(trx_undo_t *undo, trx_rseg_t *rseg,
return
;
}
trx_t
*
trx
=
trx_
allocate_for_background
();
trx_t
*
trx
=
trx_
create
();
trx
->
state
=
state
;
ut_d
(
trx
->
start_file
=
__FILE__
);
ut_d
(
trx
->
start_line
=
__LINE__
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment