Hi everybody,
According to the documentation, the gtid_current_pos should be updated with transactions from the slave threads as well:
https://mariadb.com/kb/en/mariadb/gtid/#gtid_current_pos
While this is not a problem in traditional replication setups (we can use slave_pos instead of current_pos) it can be a problem with setups with intermediate masters where the higher master is older version:
Server 1 (5.5) -> Server 2a (10.1) -> server 2b (10.1)
If we want to switch roles between 2a and 2b we stop replication from server 1 to 2a (to failover afterwards). However we cannot use gtid_slave_pos or gtid_current_pos because they are not updated:
MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
|
+------------------------+--------------------------+--------------------------+
|
| @@gtid_binlog_pos | @@gtid_slave_pos | @@gtid_current_pos |
|
+------------------------+--------------------------+--------------------------+
|
| 0-201-55312,1-1-113229 | 0-201-55312,1-102-110354 | 0-201-55312,1-102-110354 |
|
+------------------------+--------------------------+--------------------------+
|
1 row in set (0.00 sec)
|
If we perform a transaction on server 2a the current_pos at least is updated:
MariaDB [mariadb]> insert into test values(NULL);
|
Query OK, 1 row affected (0.01 sec)
|
|
MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
|
+--------------------------+--------------------------+--------------------------+
|
| @@gtid_binlog_pos | @@gtid_slave_pos | @@gtid_current_pos |
|
+--------------------------+--------------------------+--------------------------+
|
| 0-201-55312,1-101-113230 | 0-201-55312,1-102-110354 | 0-201-55312,1-101-113230 |
|
+--------------------------+--------------------------+--------------------------+
|
1 row in set (0.00 sec)
|
Please make it so that current_pos (and slave_pos?) is also updated from transaction that come in from old master, as the documentation states.
{"report":{"fcp":756.5,"ttfb":210.2000002861023,"pageVisibility":"visible","entityId":57188,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"67519cbf-e36b-4b09-bbe9-24d5a712e73d","navigationType":0,"readyForUser":818.0999999046326,"redirectCount":0,"resourceLoadedEnd":312.2000002861023,"resourceLoadedStart":215.7000002861023,"resourceTiming":[{"duration":17.299999713897705,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":215.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":233,"responseStart":0,"secureConnectionStart":0},{"duration":23.699999809265137,"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":215.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":215.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":87.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":216.2000002861023,"connectEnd":216.2000002861023,"connectStart":216.2000002861023,"domainLookupEnd":216.2000002861023,"domainLookupStart":216.2000002861023,"fetchStart":216.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":247.7000002861023,"responseEnd":303.30000019073486,"responseStart":261.09999990463257,"secureConnectionStart":216.2000002861023},{"duration":95.80000019073486,"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":216.40000009536743,"connectEnd":216.40000009536743,"connectStart":216.40000009536743,"domainLookupEnd":216.40000009536743,"domainLookupStart":216.40000009536743,"fetchStart":216.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":248.2000002861023,"responseEnd":312.2000002861023,"responseStart":262.40000009536743,"secureConnectionStart":216.40000009536743},{"duration":63.80000019073486,"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":216.59999990463257,"connectEnd":216.59999990463257,"connectStart":216.59999990463257,"domainLookupEnd":216.59999990463257,"domainLookupStart":216.59999990463257,"fetchStart":216.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":249.80000019073486,"responseEnd":280.40000009536743,"responseStart":279.80000019073486,"secureConnectionStart":216.59999990463257},{"duration":63.09999990463257,"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":216.7000002861023,"connectEnd":216.7000002861023,"connectStart":216.7000002861023,"domainLookupEnd":216.7000002861023,"domainLookupStart":216.7000002861023,"fetchStart":216.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":250.59999990463257,"responseEnd":279.80000019073486,"responseStart":279.2000002861023,"secureConnectionStart":216.7000002861023},{"duration":68.69999980926514,"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":216.80000019073486,"connectEnd":216.80000019073486,"connectStart":216.80000019073486,"domainLookupEnd":216.80000019073486,"domainLookupStart":216.80000019073486,"fetchStart":216.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":251.2000002861023,"responseEnd":285.5,"responseStart":284.90000009536743,"secureConnectionStart":216.80000019073486},{"duration":34.40000009536743,"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":217,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":217,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":251.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":89.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":217.09999990463257,"connectEnd":217.09999990463257,"connectStart":217.09999990463257,"domainLookupEnd":217.09999990463257,"domainLookupStart":217.09999990463257,"fetchStart":217.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":254.80000019073486,"responseEnd":306.59999990463257,"responseStart":305.80000019073486,"secureConnectionStart":217.09999990463257},{"duration":35.5,"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":217.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":217.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":252.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":68.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":217.5,"connectEnd":217.5,"connectStart":217.5,"domainLookupEnd":217.5,"domainLookupStart":217.5,"fetchStart":217.5,"redirectEnd":0,"redirectStart":0,"requestStart":256.59999990463257,"responseEnd":286.30000019073486,"responseStart":285.59999990463257,"secureConnectionStart":217.5},{"duration":48.19999980926514,"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":227.30000019073486,"connectEnd":262.09999990463257,"connectStart":262.09999990463257,"domainLookupEnd":262.09999990463257,"domainLookupStart":262.09999990463257,"fetchStart":227.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":262.90000009536743,"responseEnd":275.5,"responseStart":274.30000019073486,"secureConnectionStart":262.09999990463257},{"duration":46.30000019073486,"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":230.5,"connectEnd":230.5,"connectStart":230.5,"domainLookupEnd":230.5,"domainLookupStart":230.5,"fetchStart":230.5,"redirectEnd":0,"redirectStart":0,"requestStart":263.7000002861023,"responseEnd":276.80000019073486,"responseStart":275.59999990463257,"secureConnectionStart":230.5},{"duration":162.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":515.0999999046326,"connectEnd":515.0999999046326,"connectStart":515.0999999046326,"domainLookupEnd":515.0999999046326,"domainLookupStart":515.0999999046326,"fetchStart":515.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":641.0999999046326,"responseEnd":677.4000000953674,"responseStart":676.8000001907349,"secureConnectionStart":515.0999999046326},{"duration":122,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":730.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":730.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":852.5,"responseStart":0,"secureConnectionStart":0},{"duration":78.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":748.0999999046326,"connectEnd":748.0999999046326,"connectStart":748.0999999046326,"domainLookupEnd":748.0999999046326,"domainLookupStart":748.0999999046326,"fetchStart":748.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":789.4000000953674,"responseEnd":826.2000002861023,"responseStart":825.0999999046326,"secureConnectionStart":748.0999999046326}],"fetchStart":0,"domainLookupStart":3,"domainLookupEnd":11,"connectStart":11,"connectEnd":38,"secureConnectionStart":19,"requestStart":38,"responseStart":210,"responseEnd":230,"domLoading":214,"domInteractive":886,"domContentLoadedEventStart":886,"domContentLoadedEventEnd":931,"domComplete":1020,"loadEventStart":1020,"loadEventEnd":1020,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":858},{"name":"bigPipe.sidebar-id.end","time":858.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":859.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":860.9000000953674},{"name":"activityTabFullyLoaded","time":950.7000002861023}],"measures":[],"correlationId":"5fd5b071f25781","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":16,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I failed to understand the above description, hopefully knielsen will make sense out of it.