The server would crash when has configs rpl_semi_sync_master_enabled = OFF rpl_semi_sync_master_wait_no_slave =OFF
How to repeat:
./mysqld --rpl_semi_sync_master_enabled=OFF --rpl_semi_sync_master_wait_no_slave=OFF
Dies with:
mysqld: /my/maria-10.3/sql/semisync_master.cc:973: int Repl_semi_sync_master::switch_off(): Assertion `m_active_tranxs != NULL' failed.
From original bug report:
stack_bottom = 0x0 thread_stack 0x40000
|
*** buffer overflow detected ***: /u01/mariadb/bin/mysqld terminated
|
======= Backtrace: =========
|
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f6f9059c597]
|
/lib64/libc.so.6(+0x10c750)[0x7f6f9059a750]
|
/lib64/libc.so.6(+0x10e507)[0x7f6f9059c507]
|
/u01/mariadb/bin/mysqld(my_addr_resolve+0xda)[0x7f6f9327932a]
|
/u01/mariadb/bin/mysqld(my_print_stacktrace+0x1c2)[0x7f6f93262a22]
|
/u01/mariadb/bin/mysqld(handle_fatal_signal+0x357)[0x7f6f92cf04b7]
|
/lib64/libpthread.so.0(+0xf100)[0x7f6f9213d100]
|
/u01/mariadb/bin/mysqld(_ZN12Active_tranx24clear_active_tranx_nodesEPKcy+0xc6)[0x7f6f92c3f7d6]
|
/u01/mariadb/bin/mysqld(_ZN21Repl_semi_sync_master10switch_offEv+0x1e)[0x7f6f92c3fcae]
|
/u01/mariadb/bin/mysqld(_ZN21Repl_semi_sync_master11init_objectEv+0xd4)[0x7f6f92c3fe64]
|
/u01/mariadb/bin/mysqld(+0x4f2b3f)[0x7f6f92a60b3f]
|
/u01/mariadb/bin/mysqld(_Z11mysqld_mainiPPc+0x4b7)[0x7f6f92a67287]
|
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f6f904afb15]
|
/u01/mariadb/bin/mysqld(+0x4ec7ed)[0x7f6f92a5a7ed]
|
|
353 int Repl_semi_sync_master::init_object()
|
354 {
|
355 int result;
|
356
|
357 m_init_done = true;
|
358
|
359 /* References to the parameter works after set_options(). */
|
360 set_wait_timeout(rpl_semi_sync_master_timeout);
|
361 set_trace_level(rpl_semi_sync_master_trace_level);
|
362 set_wait_point(rpl_semi_sync_master_wait_point);
|
363
|
364 /* Mutex initialization can only be done after MY_INIT(). */
|
365 mysql_mutex_init(key_LOCK_binlog,
|
366 &LOCK_binlog, MY_MUTEX_INIT_FAST);
|
367 mysql_cond_init(key_COND_binlog_send,
|
368 &COND_binlog_send, NULL);
|
369
|
370 if (rpl_semi_sync_master_enabled)
|
371 {
|
372 result = enable_master();
|
373 if (!result)**
|
374 result= ack_receiver.start(); /* Start the ACK thread. */
|
375 }
|
376 else
|
377 {
|
378 result = disable_master();
|
379 }
|
380
|
381 /*
|
382 If rpl_semi_sync_master_wait_no_slave is disabled, let's temporarily
|
383 switch off semisync to avoid hang if there's none active slave.
|
384 */
|
385 if (!rpl_semi_sync_master_wait_no_slave)
|
386 switch_off();
|
387
|
388 return result;
|
389 }
|
|
391 int Repl_semi_sync_master::enable_master()
|
392 {
|
393 int result = 0;
|
394
|
395 /* Must have the lock when we do enable of disable. */
|
396 lock();
|
397
|
398 if (!get_master_enabled())
|
399 {
|
400 m_active_tranxs = new Active_tranx(&LOCK_binlog, m_trace_level);
|
401 if (m_active_tranxs != NULL)
|
|
|
964 int Repl_semi_sync_master::switch_off()
|
965 {
|
966 int result;
|
967
|
968 DBUG_ENTER("Repl_semi_sync_master::switch_off");
|
969
|
970 m_state = false;
|
971
|
972 /* Clear the active transaction list. */
|
973 assert(m_active_tranxs != NULL);
|
974 result = m_active_tranxs->clear_active_tranx_nodes(NULL, 0);
|
975
|
976 rpl_semi_sync_master_off_times++;
|
If get rpl_semi_sync_master_enabled off, the enable_master function would not called. the m_active_tranxs would be NULL. And as rpl_semi_sync_master_wait_no_slave is off, the switch_off func called, the assert false.
{"report":{"fcp":893.4000005722046,"ttfb":175.9000005722046,"pageVisibility":"visible","entityId":71599,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3b3236b0-db12-4098-8cc1-55599cea6986","navigationType":0,"readyForUser":971.9000005722046,"redirectCount":0,"resourceLoadedEnd":1468.3000001907349,"resourceLoadedStart":182.30000019073486,"resourceTiming":[{"duration":253.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":182.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":436.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":253.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":182.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":436.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":262.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":182.80000019073486,"connectEnd":182.80000019073486,"connectStart":182.80000019073486,"domainLookupEnd":182.80000019073486,"domainLookupStart":182.80000019073486,"fetchStart":182.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":182.80000019073486,"responseEnd":445.5,"responseStart":445.5,"secureConnectionStart":182.80000019073486},{"duration":313.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":182.9000005722046,"connectEnd":182.9000005722046,"connectStart":182.9000005722046,"domainLookupEnd":182.9000005722046,"domainLookupStart":182.9000005722046,"fetchStart":182.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":182.9000005722046,"responseEnd":496.5,"responseStart":496.5,"secureConnectionStart":182.9000005722046},{"duration":317.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":183.19999980926514,"connectEnd":183.19999980926514,"connectStart":183.19999980926514,"domainLookupEnd":183.19999980926514,"domainLookupStart":183.19999980926514,"fetchStart":183.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":183.19999980926514,"responseEnd":500.4000005722046,"responseStart":500.4000005722046,"secureConnectionStart":183.19999980926514},{"duration":318.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":183.4000005722046,"connectEnd":183.4000005722046,"connectStart":183.4000005722046,"domainLookupEnd":183.4000005722046,"domainLookupStart":183.4000005722046,"fetchStart":183.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":183.4000005722046,"responseEnd":502.1000003814697,"responseStart":502.1000003814697,"secureConnectionStart":183.4000005722046},{"duration":319.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":183.60000038146973,"connectEnd":183.60000038146973,"connectStart":183.60000038146973,"domainLookupEnd":183.60000038146973,"domainLookupStart":183.60000038146973,"fetchStart":183.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":183.60000038146973,"responseEnd":502.9000005722046,"responseStart":502.9000005722046,"secureConnectionStart":183.60000038146973},{"duration":402.6000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":183.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":586.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":320.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":183.9000005722046,"connectEnd":183.9000005722046,"connectStart":183.9000005722046,"domainLookupEnd":183.9000005722046,"domainLookupStart":183.9000005722046,"fetchStart":183.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":183.9000005722046,"responseEnd":504.80000019073486,"responseStart":504.80000019073486,"secureConnectionStart":183.9000005722046},{"duration":402.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":184.10000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":184.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":586.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":322.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":184.19999980926514,"connectEnd":184.19999980926514,"connectStart":184.19999980926514,"domainLookupEnd":184.19999980926514,"domainLookupStart":184.19999980926514,"fetchStart":184.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":184.19999980926514,"responseEnd":506.80000019073486,"responseStart":506.80000019073486,"secureConnectionStart":184.19999980926514},{"duration":1126.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":185,"connectEnd":185,"connectStart":185,"domainLookupEnd":185,"domainLookupStart":185,"fetchStart":185,"redirectEnd":0,"redirectStart":0,"requestStart":185,"responseEnd":1311.8000001907349,"responseStart":1311.8000001907349,"secureConnectionStart":185},{"duration":1283.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":185.10000038146973,"connectEnd":185.10000038146973,"connectStart":185.10000038146973,"domainLookupEnd":185.10000038146973,"domainLookupStart":185.10000038146973,"fetchStart":185.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":185.10000038146973,"responseEnd":1468.3000001907349,"responseStart":1468.3000001907349,"secureConnectionStart":185.10000038146973},{"duration":730.1999998092651,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":597.8000001907349,"connectEnd":597.8000001907349,"connectStart":597.8000001907349,"domainLookupEnd":597.8000001907349,"domainLookupStart":597.8000001907349,"fetchStart":597.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":597.8000001907349,"responseEnd":1328,"responseStart":1328,"secureConnectionStart":597.8000001907349},{"duration":586.3000001907349,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":884.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":884.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1470.9000005722046,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":16,"responseStart":176,"responseEnd":177,"domLoading":179,"domInteractive":1486,"domContentLoadedEventStart":1486,"domContentLoadedEventEnd":1526,"domComplete":2664,"loadEventStart":2664,"loadEventEnd":2665,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1471.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1472.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1472.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1474.9000005722046},{"name":"activityTabFullyLoaded","time":1532.3000001907349}],"measures":[],"correlationId":"e82899b3841b82","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":85,"dbReadsTimeInMs":8,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}