Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
N/A
Notes:
The test case is non-deterministic, run with --repeat=N . It usually fails for me in a few attempts, but it can vary on different machines and builds.
The failure is rr-able via MTR --rr , although it may take more attempts.
The problem is scalable at least to some extent, it is not limited to the degenerate 4K value. I initially got it on 4M value (which is also low) with a much bigger test case, so there is no reason to think it cannot be increased even further. However, it requires very specific event/binlog sizes.
Binlog rotation prior to the flow as well as FLUSH STATUS performed in the while loop apparently doesn't do anything other than fill the binary log space.
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
RESET MASTER;
SET @binlog_space= @@binlog_space_limit;
SET GLOBAL BINLOG_SPACE_LIMIT = 4096;
FLUSH BINARY LOGS;
FLUSH BINARY LOGS;
FLUSH BINARY LOGS;
--let $num= 17
while ($num)
{
/* 13 chr filler */ FLUSH STATUS;
--dec $num
}
--send
FLUSH STATUS;
--connection master1
SET GLOBAL BINLOG_SPACE_LIMIT = 0;
FLUSH LOGS;
--connection master
--reap
# Cleanup
SET GLOBAL BINLOG_SPACE_LIMIT = @binlog_space;
--source include/rpl_end.inc
bb-11.4-timestamp 6a706d142be3309de89c28bcb48e91a72e8e8f69
mariadbd: /data/bld/bb-11.4-timestamp-preview-asan/sql/log.cc:5293: int MYSQL_BIN_LOG::real_purge_logs_by_size(ulonglong): Assertion `(longlong) binlog_space_total >= 0' failed.
240119 15:32:27 [ERROR] mysqld got signal 6 ;
#9 0x00007f92e8053e32 in __GI___assert_fail (assertion=0x55a9f972bda0 "(longlong) binlog_space_total >= 0", file=0x55a9f97248e0 "/data/bld/bb-11.4-timestamp-preview-asan/sql/log.cc", line=5293, function=0x55a9f972bd40 "int MYSQL_BIN_LOG::real_purge_logs_by_size(ulonglong)") at ./assert/assert.c:101
#10 0x000055a9f7cdce57 in MYSQL_BIN_LOG::real_purge_logs_by_size (this=0x55a9fb644900 <mysql_bin_log>, binlog_pos=2891) at /data/bld/bb-11.4-timestamp-preview-asan/sql/log.cc:5293
#11 0x000055a9f7d0b943 in MYSQL_BIN_LOG::purge_logs_by_size (this=0x55a9fb644900 <mysql_bin_log>, binlog_pos=2891) at /data/bld/bb-11.4-timestamp-preview-asan/sql/log.h:1054
#12 0x000055a9f7ceaa0f in MYSQL_BIN_LOG::rotate (this=0x55a9fb644900 <mysql_bin_log>, force_rotate=false, check_purge=0x7f92db58cd50) at /data/bld/bb-11.4-timestamp-preview-asan/sql/log.cc:7458
#13 0x000055a9f7ce9567 in MYSQL_BIN_LOG::write (this=0x55a9fb644900 <mysql_bin_log>, event_info=0x7f92db58d3a0, with_annotate=0x0) at /data/bld/bb-11.4-timestamp-preview-asan/sql/log.cc:7190
#14 0x000055a9f6f2468c in THD::binlog_query (this=0x62c000120218, qtype=THD::STMT_QUERY_TYPE, query_arg=0x629000299238 "FLUSH STATUS", query_len=12, is_trans=false, direct=false, suppress_use=false, errcode=0) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_class.cc:7807
#15 0x000055a9f730fddd in write_bin_log (thd=0x62c000120218, clear_error=false, query=0x629000299238 "FLUSH STATUS", query_length=12, is_trans=false) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_table.cc:1038
#16 0x000055a9f705125d in mysql_execute_command (thd=0x62c000120218, is_called_from_prepared_stmt=false) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_parse.cc:5285
#17 0x000055a9f70621af in mysql_parse (thd=0x62c000120218, rawbuf=0x629000299238 "FLUSH STATUS", length=12, parser_state=0x7f92db58e9f0) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_parse.cc:7798
#18 0x000055a9f7039804 in dispatch_command (command=COM_QUERY, thd=0x62c000120218, packet=0x62900028f219 "FLUSH STATUS", packet_length=12, blocking=true) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_parse.cc:1893
#19 0x000055a9f703653c in do_command (thd=0x62c000120218, blocking=true) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_parse.cc:1406
#20 0x000055a9f7507cbe in do_handle_one_connection (connect=0x608000002e38, put_in_cache=true) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_connect.cc:1417
#21 0x000055a9f750767f in handle_one_connection (arg=0x608000002e38) at /data/bld/bb-11.4-timestamp-preview-asan/sql/sql_connect.cc:1319
#22 0x000055a9f8130444 in pfs_spawn_thread (arg=0x617000006d18) at /data/bld/bb-11.4-timestamp-preview-asan/storage/perfschema/pfs.cc:2201
#23 0x00007f92e80a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#24 0x00007f92e812861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
{"report":{"fcp":1355.6000000238419,"ttfb":385.39999997615814,"pageVisibility":"visible","entityId":127331,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"32ce77ce-642e-4d95-9d73-82e5d707ae00","navigationType":0,"readyForUser":1443.800000011921,"redirectCount":0,"resourceLoadedEnd":1590.800000011921,"resourceLoadedStart":391.10000002384186,"resourceTiming":[{"duration":485.19999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":391.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":391.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":876.3000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":485.30000001192093,"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":391.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":391.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":876.6999999880791,"responseStart":0,"secureConnectionStart":0},{"duration":494.0999999642372,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":391.60000002384186,"connectEnd":391.60000002384186,"connectStart":391.60000002384186,"domainLookupEnd":391.60000002384186,"domainLookupStart":391.60000002384186,"fetchStart":391.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":391.60000002384186,"responseEnd":885.6999999880791,"responseStart":885.6999999880791,"secureConnectionStart":391.60000002384186},{"duration":546.8999999761581,"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":391.80000001192093,"connectEnd":391.80000001192093,"connectStart":391.80000001192093,"domainLookupEnd":391.80000001192093,"domainLookupStart":391.80000001192093,"fetchStart":391.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":391.80000001192093,"responseEnd":938.6999999880791,"responseStart":938.6999999880791,"secureConnectionStart":391.80000001192093},{"duration":550.4000000357628,"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":391.89999997615814,"connectEnd":391.89999997615814,"connectStart":391.89999997615814,"domainLookupEnd":391.89999997615814,"domainLookupStart":391.89999997615814,"fetchStart":391.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":391.89999997615814,"responseEnd":942.3000000119209,"responseStart":942.3000000119209,"secureConnectionStart":391.89999997615814},{"duration":550.8000000119209,"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":392.19999998807907,"connectEnd":392.19999998807907,"connectStart":392.19999998807907,"domainLookupEnd":392.19999998807907,"domainLookupStart":392.19999998807907,"fetchStart":392.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":392.19999998807907,"responseEnd":943,"responseStart":943,"secureConnectionStart":392.19999998807907},{"duration":551,"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":392.30000001192093,"connectEnd":392.30000001192093,"connectStart":392.30000001192093,"domainLookupEnd":392.30000001192093,"domainLookupStart":392.30000001192093,"fetchStart":392.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":392.30000001192093,"responseEnd":943.3000000119209,"responseStart":943.3000000119209,"secureConnectionStart":392.30000001192093},{"duration":636.1000000238419,"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":392.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1028.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":551.1999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":392.60000002384186,"connectEnd":392.60000002384186,"connectStart":392.60000002384186,"domainLookupEnd":392.60000002384186,"domainLookupStart":392.60000002384186,"fetchStart":392.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":392.60000002384186,"responseEnd":943.8000000119209,"responseStart":943.8000000119209,"secureConnectionStart":392.60000002384186},{"duration":635.8000000119209,"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":392.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1028.699999988079,"responseStart":0,"secureConnectionStart":0},{"duration":551.3999999761581,"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":393,"connectEnd":393,"connectStart":393,"domainLookupEnd":393,"domainLookupStart":393,"fetchStart":393,"redirectEnd":0,"redirectStart":0,"requestStart":393,"responseEnd":944.3999999761581,"responseStart":944.3999999761581,"secureConnectionStart":393},{"duration":869.6999999880791,"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":398.60000002384186,"connectEnd":398.60000002384186,"connectStart":398.60000002384186,"domainLookupEnd":398.60000002384186,"domainLookupStart":398.60000002384186,"fetchStart":398.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":398.60000002384186,"responseEnd":1268.300000011921,"responseStart":1268.300000011921,"secureConnectionStart":398.60000002384186},{"duration":1182.9000000357628,"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":398.69999998807907,"connectEnd":398.69999998807907,"connectStart":398.69999998807907,"domainLookupEnd":398.69999998807907,"domainLookupStart":398.69999998807907,"fetchStart":398.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":398.69999998807907,"responseEnd":1581.6000000238419,"responseStart":1581.6000000238419,"secureConnectionStart":398.69999998807907},{"duration":233.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1043.1000000238419,"connectEnd":1043.1000000238419,"connectStart":1043.1000000238419,"domainLookupEnd":1043.1000000238419,"domainLookupStart":1043.1000000238419,"fetchStart":1043.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1043.1000000238419,"responseEnd":1277,"responseStart":1277,"secureConnectionStart":1043.1000000238419},{"duration":274.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1308.199999988079,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1308.199999988079,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1582.5,"responseStart":0,"secureConnectionStart":0},{"duration":275,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1309.199999988079,"connectEnd":1309.199999988079,"connectStart":1309.199999988079,"domainLookupEnd":1309.199999988079,"domainLookupStart":1309.199999988079,"fetchStart":1309.199999988079,"redirectEnd":0,"redirectStart":0,"requestStart":1309.199999988079,"responseEnd":1584.199999988079,"responseStart":1584.199999988079,"secureConnectionStart":1309.199999988079},{"duration":281.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1309.5,"connectEnd":1309.5,"connectStart":1309.5,"domainLookupEnd":1309.5,"domainLookupStart":1309.5,"fetchStart":1309.5,"redirectEnd":0,"redirectStart":0,"requestStart":1309.5,"responseEnd":1590.800000011921,"responseStart":1590.800000011921,"secureConnectionStart":1309.5},{"duration":251.39999997615814,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1349.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1349.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1600.8999999761581,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":209,"responseStart":386,"responseEnd":392,"domLoading":389,"domInteractive":1607,"domContentLoadedEventStart":1607,"domContentLoadedEventEnd":1649,"domComplete":1866,"loadEventStart":1866,"loadEventEnd":1867,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1584},{"name":"bigPipe.sidebar-id.end","time":1584.800000011921},{"name":"bigPipe.activity-panel-pipe-id.start","time":1585},{"name":"bigPipe.activity-panel-pipe-id.end","time":1586},{"name":"activityTabFullyLoaded","time":1671.1000000238419}],"measures":[],"correlationId":"973dde7282c3e6","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I had forgot a mutex when setting binlog space to 0. Now fixed.