Type:
New Feature
Priority:
Major
Resolution:
Won't Do
Affects Version/s:
None
Looks like readwritesplit router assumes that Galera nodes are all always in sync. In reality they may have write sets pending to be applied and wsrep_local_recv_queue may be used as a measure of current "lagging" for Galera node.
With this we may be able to apply slave_selection_criteria = LEAST_BEHIND_MASTER and route to the Galera node that is more close to "master" or less loaded.
markus makela
made changes -
2022-10-24 12:21
Field
Original Value
New Value
Issue Type
Task
[ 3
]
New Feature
[ 2
]
Johan Wikman
made changes -
2022-10-26 06:31
Assignee
Todd Stoffel
[ toddstoffel
]
Todd Stoffel (Inactive)
made changes -
2023-04-04 05:17
Fix Version/s
N/A
[ 22001
]
Fix Version/s
Icebox
[ 22648
]
Resolution
Won't Do
[ 10201
]
Status
Open
[ 1
]
Closed
[ 6
]
{"report":{"fcp":819.2000002861023,"ttfb":258.80000019073486,"pageVisibility":"visible","entityId":115870,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5a0f5991-e948-4f36-ab9a-9e4e8201e315","navigationType":0,"readyForUser":870.5999999046326,"redirectCount":0,"resourceLoadedEnd":574.2000002861023,"resourceLoadedStart":266.09999990463257,"resourceTiming":[{"duration":43.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":266.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":310,"responseStart":0,"secureConnectionStart":0},{"duration":44,"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":266.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":310.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":87.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":266.5,"connectEnd":266.5,"connectStart":266.5,"domainLookupEnd":266.5,"domainLookupStart":266.5,"fetchStart":266.5,"redirectEnd":0,"redirectStart":0,"requestStart":311.09999990463257,"responseEnd":353.7000002861023,"responseStart":323.5,"secureConnectionStart":266.5},{"duration":97.19999980926514,"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":266.7000002861023,"connectEnd":266.7000002861023,"connectStart":266.7000002861023,"domainLookupEnd":266.7000002861023,"domainLookupStart":266.7000002861023,"fetchStart":266.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":311.40000009536743,"responseEnd":363.90000009536743,"responseStart":327.59999990463257,"secureConnectionStart":266.7000002861023},{"duration":56.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":266.90000009536743,"connectEnd":266.90000009536743,"connectStart":266.90000009536743,"domainLookupEnd":266.90000009536743,"domainLookupStart":266.90000009536743,"fetchStart":266.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":311.59999990463257,"responseEnd":323.40000009536743,"responseStart":322.80000019073486,"secureConnectionStart":266.90000009536743},{"duration":68.59999990463257,"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":267,"connectEnd":267,"connectStart":267,"domainLookupEnd":267,"domainLookupStart":267,"fetchStart":267,"redirectEnd":0,"redirectStart":0,"requestStart":313.09999990463257,"responseEnd":335.59999990463257,"responseStart":335,"secureConnectionStart":267},{"duration":81.2999997138977,"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":267.30000019073486,"connectEnd":267.30000019073486,"connectStart":267.30000019073486,"domainLookupEnd":267.30000019073486,"domainLookupStart":267.30000019073486,"fetchStart":267.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":317,"responseEnd":348.59999990463257,"responseStart":348,"secureConnectionStart":267.30000019073486},{"duration":47,"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":267.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":267.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":314.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":71.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":267.5,"connectEnd":327.30000019073486,"connectStart":327.30000019073486,"domainLookupEnd":327.30000019073486,"domainLookupStart":327.30000019073486,"fetchStart":267.5,"redirectEnd":0,"redirectStart":0,"requestStart":328.09999990463257,"responseEnd":339.2000002861023,"responseStart":338.40000009536743,"secureConnectionStart":327.30000019073486},{"duration":59.799999713897705,"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":267.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":267.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.5,"responseStart":0,"secureConnectionStart":0},{"duration":92.30000019073486,"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":267.90000009536743,"connectEnd":267.90000009536743,"connectStart":267.90000009536743,"domainLookupEnd":267.90000009536743,"domainLookupStart":267.90000009536743,"fetchStart":267.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":347.80000019073486,"responseEnd":360.2000002861023,"responseStart":358.90000009536743,"secureConnectionStart":267.90000009536743},{"duration":224.90000009536743,"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":275,"connectEnd":275,"connectStart":275,"domainLookupEnd":275,"domainLookupStart":275,"fetchStart":275,"redirectEnd":0,"redirectStart":0,"requestStart":408.59999990463257,"responseEnd":499.90000009536743,"responseStart":498.40000009536743,"secureConnectionStart":275},{"duration":293.7000002861023,"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":280.5,"connectEnd":280.5,"connectStart":280.5,"domainLookupEnd":280.5,"domainLookupStart":280.5,"fetchStart":280.5,"redirectEnd":0,"redirectStart":0,"requestStart":564.0999999046326,"responseEnd":574.2000002861023,"responseStart":573.5999999046326,"secureConnectionStart":280.5},{"duration":172.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":570.5,"connectEnd":570.5,"connectStart":570.5,"domainLookupEnd":570.5,"domainLookupStart":570.5,"fetchStart":570.5,"redirectEnd":0,"redirectStart":0,"requestStart":691.5,"responseEnd":743.2000002861023,"responseStart":741.7000002861023,"secureConnectionStart":570.5},{"duration":108.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":790.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":790.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":898.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":116.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":809.8000001907349,"connectEnd":809.8000001907349,"connectStart":809.8000001907349,"domainLookupEnd":809.8000001907349,"domainLookupStart":809.8000001907349,"fetchStart":809.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":889.5,"responseEnd":925.9000000953674,"responseStart":924.9000000953674,"secureConnectionStart":809.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":91,"responseStart":259,"responseEnd":281,"domLoading":263,"domInteractive":929,"domContentLoadedEventStart":929,"domContentLoadedEventEnd":970,"domComplete":1474,"loadEventStart":1474,"loadEventEnd":1474,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":901.2000002861023},{"name":"bigPipe.sidebar-id.end","time":902.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":902.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":904.9000000953674},{"name":"activityTabFullyLoaded","time":991.4000000953674}],"measures":[],"correlationId":"3bd72aa9f1eff4","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":114,"dbReadsTimeInMs":16,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Would wsrep-causal-reads be an alternative to this?
On average, how large is the lag between the reading of the writeset from the cluster and the application of it? The main problem with using replication lag in the routing logic is that it's only updated by the monitor and thus is a relatively coarse measurement of lag. In the case of traditional async replication the lag might be minutes in the worst case which is used by readwritesplit to rule out severely lagging servers. For lag that's less than that you're probably better off enabling causal_reads in MaxScale to eliminate replication lag from the user's point of view.
In the case of Galera, if the "replication" lag is significantly less than the value of monitor_interva, it might make more sense to force wsrep-causal-reads to be used instead of using wsrep_local_recv_queue as a measurement of lag as it avoids the same problem that causal_reads=fast suffers from: if the servers are lagging too much, almost all of the traffic gets routed to a single node. The same limitations also apply to causal_reads=fast_global where it is only useful for very low write throughput and for workloads that are largely read-only.