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
025eed06
Commit
025eed06
authored
May 04, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Remove unnecessary InnoDB log writes
parent
0ff90b3b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
46 deletions
+17
-46
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+13
-33
storage/innobase/log/log0log.cc
storage/innobase/log/log0log.cc
+3
-8
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+1
-5
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
025eed06
...
...
@@ -12729,7 +12729,6 @@ ha_innobase::create(
bool
file_per_table
,
trx_t
*
trx
)
{
int
error
;
char
norm_name
[
FN_REFLEN
];
/* {database}/{tablename} */
char
remote_path
[
FN_REFLEN
];
/* Absolute path of table */
...
...
@@ -12746,14 +12745,19 @@ ha_innobase::create(
remote_path
,
file_per_table
,
trx
);
if
((
error
=
info
.
initialize
())
||
(
error
=
info
.
prepare_create_table
(
name
,
!
trx
)))
{
{
int
error
=
info
.
initialize
();
if
(
!
error
)
{
error
=
info
.
prepare_create_table
(
name
,
!
trx
);
}
if
(
error
)
{
if
(
trx
)
{
trx_rollback_for_mysql
(
trx
);
row_mysql_unlock_data_dictionary
(
trx
);
}
DBUG_RETURN
(
error
);
}
}
const
bool
own_trx
=
!
trx
;
...
...
@@ -12767,7 +12771,7 @@ ha_innobase::create(
DBUG_ASSERT
(
trx_state_eq
(
trx
,
TRX_STATE_NOT_STARTED
));
}
if
(
(
error
=
info
.
create_table
(
own_trx
)
))
{
if
(
int
error
=
info
.
create_table
(
own_trx
))
{
/* Drop the being-created table before rollback,
so that rollback can possibly rename back a table
that could have been renamed before the failed creation. */
...
...
@@ -12792,16 +12796,9 @@ ha_innobase::create(
trx
->
free
();
}
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
log_buffer_flush_to_disk
();
ut_ad
(
!
srv_read_only_mode
);
error
=
info
.
create_table_update_dict
();
DBUG_RETURN
(
error
);
DBUG_RETURN
(
info
.
create_table_update_dict
());
}
/** Create a new table to an InnoDB database.
...
...
@@ -13132,11 +13129,6 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom)
}
ut_ad
(
!
srv_read_only_mode
);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
log_buffer_flush_to_disk
();
innobase_commit_low
(
trx
);
...
...
@@ -13232,12 +13224,6 @@ innobase_drop_database(
my_free
(
namebuf
);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
log_buffer_flush_to_disk
();
innobase_commit_low
(
trx
);
trx
->
free
();
...
...
@@ -13330,12 +13316,6 @@ inline dberr_t innobase_rename_table(trx_t *trx, const char *from,
row_mysql_unlock_data_dictionary
(
trx
);
}
/* Flush the log to reduce probability that the .frm
files and the InnoDB data dictionary get out-of-sync
if the user runs with innodb_flush_log_at_trx_commit = 0 */
log_buffer_flush_to_disk
();
DBUG_RETURN
(
error
);
}
...
...
storage/innobase/log/log0log.cc
View file @
025eed06
...
...
@@ -1133,10 +1133,8 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown()
if
(
srv_fast_shutdown
==
2
||
!
srv_was_started
)
{
if
(
!
srv_read_only_mode
&&
srv_was_started
)
{
ib
::
info
()
<<
"MySQL has requested a very fast"
" shutdown without flushing the InnoDB buffer"
" pool to data files. At the next mysqld"
" startup InnoDB will do a crash recovery!"
;
ib
::
info
()
<<
"Executing innodb_fast_shutdown=2."
" Next startup will execute crash recovery!"
;
/* In this fastest shutdown we do not flush the
buffer pool:
...
...
@@ -1144,10 +1142,7 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown()
it is essentially a 'crash' of the InnoDB server.
Make sure that the log is all flushed to disk, so
that we can recover all committed transactions in
a crash recovery. We must not write the lsn stamps
to the data files, since at a startup InnoDB deduces
from the stamps if the previous shutdown was clean. */
a crash recovery. */
log_buffer_flush_to_disk
();
}
...
...
storage/innobase/srv/srv0start.cc
View file @
025eed06
...
...
@@ -1509,11 +1509,7 @@ dberr_t srv_start(bool create_new_db)
fil_system
.
sys_space
->
size_in_header
=
uint32_t
(
size
);
mtr
.
commit
();
/* Immediately write the log record about
increased tablespace size to disk, so that it
is durable even if mysqld would crash
quickly */
log_buffer_flush_to_disk
();
log_write_up_to
(
mtr
.
commit_lsn
(),
true
);
}
}
...
...
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