-
Task
-
-
Major
-
Resolution:
Fixed
-
-
-
From f8ea0478200bf115cb0abdbf28cdf339e268a0f6 Mon Sep 17 00:00:00 2001
|
From: Hanzhi Wang <hanzhiwa@microsoft.com>
|
Date: Wed, 13 Sep 2017 07:13:49 +0000
|
Subject: [PATCH] Merged PR 60892: Introduce a variable to init binlog cache
|
size
|
|
Introduce a variable to init binlog cache size
|
|
Related work items: #84138
|
---
|
mysql-test/r/mysqld--help-win.result | 3 +++
|
sql/binlog.cc | 2 +-
|
sql/mysqld.cc | 1 +
|
sql/mysqld.h | 1 +
|
sql/sys_vars.cc | 8 ++++++++
|
5 files changed, 14 insertions(+), 1 deletion(-)
|
|
diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result
|
index a6f2ae76188..e866f63c5a7 100644
|
--- a/mysql-test/r/mysqld--help-win.result
|
+++ b/mysql-test/r/mysqld--help-win.result
|
@@ -102,6 +102,8 @@ The following options may be given as the first argument:
|
--binlog-ignore-db=name
|
Tells the master that updates to the given database
|
should not be logged to the binary log.
|
+ --binlog-init-cache-size=#
|
+ The size of init malloc cache for the binary log.
|
--binlog-max-flush-queue-time=#
|
The maximum time that the binary log group commit will
|
keep reading transactions before it flush the
|
@@ -1084,6 +1086,7 @@ binlog-direct-non-transactional-updates FALSE
|
binlog-error-action IGNORE_ERROR
|
binlog-format STATEMENT
|
binlog-gtid-simple-recovery FALSE
|
+binlog-init-cache-size 16384
|
binlog-max-flush-queue-time 0
|
binlog-order-commits TRUE
|
binlog-row-event-max-size 8192
|
diff --git a/sql/binlog.cc b/sql/binlog.cc
|
index 8d3cb51b429..f092d283e73 100644
|
--- a/sql/binlog.cc
|
+++ b/sql/binlog.cc
|
@@ -1951,7 +1951,7 @@ File open_binlog_file(IO_CACHE *log, const char *log_file_name, const char **err
|
*errmsg = "Could not open log file";
|
goto err;
|
}
|
- if (init_io_cache(log, file, IO_SIZE*2, READ_CACHE, 0, 0,
|
+ if (init_io_cache(log, file, binlog_init_cache_size, READ_CACHE, 0, 0,
|
MYF(MY_WME|MY_DONT_CHECK_FILESIZE)))
|
{
|
sql_print_error("Failed to create a cache on log (file '%s')",
|
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
|
index eba6fdec801..03839e6e742 100644
|
--- a/sql/mysqld.cc
|
+++ b/sql/mysqld.cc
|
@@ -562,6 +562,7 @@ ulonglong slave_rows_search_algorithms_options;
|
#ifndef DBUG_OFF
|
uint slave_rows_last_search_algorithm_used;
|
#endif
|
+ulong binlog_init_cache_size=0;
|
ulong binlog_cache_size=0;
|
ulonglong max_binlog_cache_size=0;
|
ulong slave_max_allowed_packet= 0;
|
diff --git a/sql/mysqld.h b/sql/mysqld.h
|
index d814a8ff28a..e73c1c00230 100644
|
--- a/sql/mysqld.h
|
+++ b/sql/mysqld.h
|
@@ -236,6 +236,7 @@ extern my_bool log_bin_use_v1_row_events;
|
extern ulong what_to_log,flush_time;
|
extern ulong max_prepared_stmt_count, prepared_stmt_count;
|
extern ulong open_files_limit;
|
+extern ulong binlog_init_cache_size;
|
extern ulong binlog_cache_size, binlog_stmt_cache_size;
|
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
|
extern int32 opt_binlog_max_flush_queue_time;
|
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
|
index 236afb2d356..3108cbfc5b5 100644
|
--- a/sql/sys_vars.cc
|
+++ b/sql/sys_vars.cc
|
@@ -602,6 +602,14 @@ static bool fix_binlog_stmt_cache_size(sys_var *self, THD *thd, enum_var_type ty
|
return false;
|
}
|
|
+static Sys_var_ulong Sys_binlog_init_cache_size(
|
+ "binlog_init_cache_size", "The size of init malloc cache for the binary log.",
|
+ GLOBAL_VAR(binlog_init_cache_size),
|
+ CMD_LINE(REQUIRED_ARG),
|
+ VALID_RANGE(IO_SIZE*2, ULONG_MAX), DEFAULT(IO_SIZE*4), BLOCK_SIZE(IO_SIZE),
|
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
|
+ ON_UPDATE(0));
|
+
|
static Sys_var_ulong Sys_binlog_cache_size(
|
"binlog_cache_size", "The size of the transactional cache for "
|
"updates to transactional engines for the binary log. "
|
{"report":{"fcp":880.2000000476837,"ttfb":276.7999999523163,"pageVisibility":"visible","entityId":63682,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"49c040de-95aa-46da-a9c0-465af994c96e","navigationType":0,"readyForUser":968.3999998569489,"redirectCount":0,"resourceLoadedEnd":569.8999998569489,"resourceLoadedStart":282.7999999523163,"resourceTiming":[{"duration":20.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":282.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":282.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":303.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":20.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":283.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":283.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":303.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":178.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":283.2000000476837,"connectEnd":283.2000000476837,"connectStart":283.2000000476837,"domainLookupEnd":283.2000000476837,"domainLookupStart":283.2000000476837,"fetchStart":283.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":307.09999990463257,"responseEnd":461.89999985694885,"responseStart":329.09999990463257,"secureConnectionStart":283.2000000476837},{"duration":286.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":283.2999999523163,"connectEnd":283.2999999523163,"connectStart":283.2999999523163,"domainLookupEnd":283.2999999523163,"domainLookupStart":283.2999999523163,"fetchStart":283.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":311.09999990463257,"responseEnd":569.8999998569489,"responseStart":344.7999999523163,"secureConnectionStart":283.2999999523163},{"duration":63.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":283.39999985694885,"connectEnd":283.39999985694885,"connectStart":283.39999985694885,"domainLookupEnd":283.39999985694885,"domainLookupStart":283.39999985694885,"fetchStart":283.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":314.5,"responseEnd":346.5,"responseStart":344,"secureConnectionStart":283.39999985694885},{"duration":57.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":283.5,"connectEnd":283.5,"connectStart":283.5,"domainLookupEnd":283.5,"domainLookupStart":283.5,"fetchStart":283.5,"redirectEnd":0,"redirectStart":0,"requestStart":315.09999990463257,"responseEnd":341.09999990463257,"responseStart":337,"secureConnectionStart":283.5},{"duration":57.799999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":283.59999990463257,"connectEnd":283.59999990463257,"connectStart":283.59999990463257,"domainLookupEnd":283.59999990463257,"domainLookupStart":283.59999990463257,"fetchStart":283.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":315.2999999523163,"responseEnd":341.39999985694885,"responseStart":338.2000000476837,"secureConnectionStart":283.59999990463257},{"duration":28.699999809265137,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":283.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":283.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":312.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":95.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":283.7999999523163,"connectEnd":283.7999999523163,"connectStart":283.7999999523163,"domainLookupEnd":283.7999999523163,"domainLookupStart":283.7999999523163,"fetchStart":283.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":315.59999990463257,"responseEnd":379.2000000476837,"responseStart":377.59999990463257,"secureConnectionStart":283.7999999523163},{"duration":28.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":283.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":283.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":312.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":64.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":284,"connectEnd":284,"connectStart":284,"domainLookupEnd":284,"domainLookupStart":284,"fetchStart":284,"redirectEnd":0,"redirectStart":0,"requestStart":316.2999999523163,"responseEnd":348.59999990463257,"responseStart":346.89999985694885,"secureConnectionStart":284},{"duration":249.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":293.7999999523163,"connectEnd":293.7999999523163,"connectStart":293.7999999523163,"domainLookupEnd":293.7999999523163,"domainLookupStart":293.7999999523163,"fetchStart":293.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":371.2000000476837,"responseEnd":542.8999998569489,"responseStart":537,"secureConnectionStart":293.7999999523163},{"duration":249.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":293.89999985694885,"connectEnd":293.89999985694885,"connectStart":293.89999985694885,"domainLookupEnd":293.89999985694885,"domainLookupStart":293.89999985694885,"fetchStart":293.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":373.09999990463257,"responseEnd":543.0999999046326,"responseStart":538.2000000476837,"secureConnectionStart":293.89999985694885},{"duration":188.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":613.8999998569489,"connectEnd":613.8999998569489,"connectStart":613.8999998569489,"domainLookupEnd":613.8999998569489,"domainLookupStart":613.8999998569489,"fetchStart":613.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":771.0999999046326,"responseEnd":802.2000000476837,"responseStart":800.7999999523163,"secureConnectionStart":613.8999998569489}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":85,"responseStart":277,"responseEnd":291,"domLoading":281,"domInteractive":1076,"domContentLoadedEventStart":1076,"domContentLoadedEventEnd":1125,"domComplete":1815,"loadEventStart":1815,"loadEventEnd":1816,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1054.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1055.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1055.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1058.3999998569489},{"name":"activityTabFullyLoaded","time":1137.0999999046326}],"measures":[],"correlationId":"d444a0ecc9a319","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":86,"dbReadsTimeInMs":9,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}