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":1035,"ttfb":349.09999990463257,"pageVisibility":"visible","entityId":71599,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8fcaf945-a744-4a9e-bd23-44dfda857e25","navigationType":0,"readyForUser":1122.5999999046326,"redirectCount":0,"resourceLoadedEnd":757.4000000953674,"resourceLoadedStart":354.59999990463257,"resourceTiming":[{"duration":20.600000381469727,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":354.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":375.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":20.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":355,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":375.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":247,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":355.09999990463257,"connectEnd":355.09999990463257,"connectStart":355.09999990463257,"domainLookupEnd":355.09999990463257,"domainLookupStart":355.09999990463257,"fetchStart":355.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":390.30000019073486,"responseEnd":602.0999999046326,"responseStart":409.09999990463257,"secureConnectionStart":355.09999990463257},{"duration":402.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":355.30000019073486,"connectEnd":355.30000019073486,"connectStart":355.30000019073486,"domainLookupEnd":355.30000019073486,"domainLookupStart":355.30000019073486,"fetchStart":355.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":390.09999990463257,"responseEnd":757.4000000953674,"responseStart":404.5,"secureConnectionStart":355.30000019073486},{"duration":59.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":355.5,"connectEnd":355.5,"connectStart":355.5,"domainLookupEnd":355.5,"domainLookupStart":355.5,"fetchStart":355.5,"redirectEnd":0,"redirectStart":0,"requestStart":390.59999990463257,"responseEnd":415,"responseStart":410.7000002861023,"secureConnectionStart":355.5},{"duration":64.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":355.59999990463257,"connectEnd":355.59999990463257,"connectStart":355.59999990463257,"domainLookupEnd":355.59999990463257,"domainLookupStart":355.59999990463257,"fetchStart":355.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":393.09999990463257,"responseEnd":420.09999990463257,"responseStart":417.5,"secureConnectionStart":355.59999990463257},{"duration":60.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":355.80000019073486,"connectEnd":355.80000019073486,"connectStart":355.80000019073486,"domainLookupEnd":355.80000019073486,"domainLookupStart":355.80000019073486,"fetchStart":355.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":392.90000009536743,"responseEnd":416.30000019073486,"responseStart":413.30000019073486,"secureConnectionStart":355.80000019073486},{"duration":25.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":356,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":356,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":63.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":356.2000002861023,"connectEnd":356.2000002861023,"connectStart":356.2000002861023,"domainLookupEnd":356.2000002861023,"domainLookupStart":356.2000002861023,"fetchStart":356.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":393.5,"responseEnd":419.80000019073486,"responseStart":416.80000019073486,"secureConnectionStart":356.2000002861023},{"duration":26.300000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":356.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":356.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":382.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":65.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":356.40000009536743,"connectEnd":356.40000009536743,"connectStart":356.40000009536743,"domainLookupEnd":356.40000009536743,"domainLookupStart":356.40000009536743,"fetchStart":356.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":395.90000009536743,"responseEnd":422.2000002861023,"responseStart":420.5,"secureConnectionStart":356.40000009536743},{"duration":338.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":361.59999990463257,"connectEnd":361.59999990463257,"connectStart":361.59999990463257,"domainLookupEnd":361.59999990463257,"domainLookupStart":361.59999990463257,"fetchStart":361.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":412.90000009536743,"responseEnd":700.2000002861023,"responseStart":693.3000001907349,"secureConnectionStart":361.59999990463257},{"duration":339.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":361.7000002861023,"connectEnd":361.7000002861023,"connectStart":361.7000002861023,"domainLookupEnd":361.7000002861023,"domainLookupStart":361.7000002861023,"fetchStart":361.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":419.40000009536743,"responseEnd":700.9000000953674,"responseStart":694.5,"secureConnectionStart":361.7000002861023},{"duration":203.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":733.4000000953674,"connectEnd":733.4000000953674,"connectStart":733.4000000953674,"domainLookupEnd":733.4000000953674,"domainLookupStart":733.4000000953674,"fetchStart":733.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":902.8000001907349,"responseEnd":936.5,"responseStart":935.7000002861023,"secureConnectionStart":733.4000000953674},{"duration":231.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":990.5999999046326,"connectEnd":990.5999999046326,"connectStart":990.5999999046326,"domainLookupEnd":990.5999999046326,"domainLookupStart":990.5999999046326,"fetchStart":990.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1186.2000002861023,"responseEnd":1221.7000002861023,"responseStart":1220.9000000953674,"secureConnectionStart":990.5999999046326},{"duration":195.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1028.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1028.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1224.2000002861023,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":174,"responseStart":349,"responseEnd":354,"domLoading":352,"domInteractive":1231,"domContentLoadedEventStart":1231,"domContentLoadedEventEnd":1282,"domComplete":1838,"loadEventStart":1838,"loadEventEnd":1839,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1207.0999999046326},{"name":"bigPipe.sidebar-id.end","time":1208},{"name":"bigPipe.activity-panel-pipe-id.start","time":1208.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1209.2000002861023},{"name":"activityTabFullyLoaded","time":1300.2000002861023}],"measures":[],"correlationId":"cac5362ff7409f","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A patch is ready for review. It's pushed to test in BB: 63119277b47 HEAD -> bb-10.3-andrei.