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
26824581
Commit
26824581
authored
Jul 16, 2020
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use larger buffer when reading binary and relay logs
- Should speed up replication
parent
c89e927a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
sql/log.cc
sql/log.cc
+3
-1
sql/log.h
sql/log.h
+6
-0
sql/rpl_rli.cc
sql/rpl_rli.cc
+2
-2
No files found.
sql/log.cc
View file @
26824581
...
@@ -2828,7 +2828,9 @@ bool MYSQL_LOG::open(
...
@@ -2828,7 +2828,9 @@ bool MYSQL_LOG::open(
else
if
((
seek_offset
=
mysql_file_tell
(
file
,
MYF
(
MY_WME
))))
else
if
((
seek_offset
=
mysql_file_tell
(
file
,
MYF
(
MY_WME
))))
goto
err
;
goto
err
;
if
(
init_io_cache
(
&
log_file
,
file
,
IO_SIZE
,
io_cache_type
,
seek_offset
,
0
,
if
(
init_io_cache
(
&
log_file
,
file
,
(
log_type
==
LOG_NORMAL
?
IO_SIZE
:
LOG_BIN_IO_SIZE
),
io_cache_type
,
seek_offset
,
0
,
MYF
(
MY_WME
|
MY_NABP
|
MYF
(
MY_WME
|
MY_NABP
|
((
log_type
==
LOG_BIN
)
?
MY_WAIT_IF_FULL
:
0
))))
((
log_type
==
LOG_BIN
)
?
MY_WAIT_IF_FULL
:
0
))))
goto
err
;
goto
err
;
...
...
sql/log.h
View file @
26824581
...
@@ -294,6 +294,12 @@ class Rows_log_event;
...
@@ -294,6 +294,12 @@ class Rows_log_event;
enum
enum_log_type
{
LOG_UNKNOWN
,
LOG_NORMAL
,
LOG_BIN
};
enum
enum_log_type
{
LOG_UNKNOWN
,
LOG_NORMAL
,
LOG_BIN
};
enum
enum_log_state
{
LOG_OPENED
,
LOG_CLOSED
,
LOG_TO_BE_OPENED
};
enum
enum_log_state
{
LOG_OPENED
,
LOG_CLOSED
,
LOG_TO_BE_OPENED
};
/*
Use larger buffers when reading from and to binary log
We make it one step smaller than 64K to account for malloc overhead.
*/
#define LOG_BIN_IO_SIZE MY_ALIGN_DOWN(65536-1, IO_SIZE)
/*
/*
TODO use mmap instead of IO_CACHE for binlog
TODO use mmap instead of IO_CACHE for binlog
(mmap+fsync is two times faster than write+fsync)
(mmap+fsync is two times faster than write+fsync)
...
...
sql/rpl_rli.cc
View file @
26824581
...
@@ -268,7 +268,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
...
@@ -268,7 +268,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
msg
=
current_thd
->
get_stmt_da
()
->
message
();
msg
=
current_thd
->
get_stmt_da
()
->
message
();
goto
err
;
goto
err
;
}
}
if
(
init_io_cache
(
&
info_file
,
info_fd
,
IO_SIZE
*
2
,
READ_CACHE
,
0L
,
0
,
if
(
init_io_cache
(
&
info_file
,
info_fd
,
LOG_BIN_IO_SIZE
,
READ_CACHE
,
0L
,
0
,
MYF
(
MY_WME
)))
MYF
(
MY_WME
)))
{
{
sql_print_error
(
"Failed to create a cache on relay log info file '%s'"
,
sql_print_error
(
"Failed to create a cache on relay log info file '%s'"
,
...
@@ -303,7 +303,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
...
@@ -303,7 +303,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
error
=
1
;
error
=
1
;
}
}
else
if
(
init_io_cache
(
&
info_file
,
info_fd
,
else
if
(
init_io_cache
(
&
info_file
,
info_fd
,
IO_SIZE
*
2
,
READ_CACHE
,
0L
,
0
,
MYF
(
MY_WME
)))
LOG_BIN_IO_SIZE
,
READ_CACHE
,
0L
,
0
,
MYF
(
MY_WME
)))
{
{
sql_print_error
(
"Failed to create a cache on relay log info file '%s'"
,
sql_print_error
(
"Failed to create a cache on relay log info file '%s'"
,
fname
);
fname
);
...
...
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