We have been trying to test the critical reads that are enabled by 'wsrep_sync_wait' parameter but seems like the results are not deterministic.
Here is the test script:
https://github.com/sjangra-git/galera-tests/blob/master/scripts/test.sh
This test script based out of the following test-case:
https://github.com/MariaDB/server/blob/2783fc7d14bc8ad16acfeb509d3b19615023f47a/mysql-test/suite/galera/t/mysql-wsrep%23201.test#L5
Here is the version info:
MariaDB [(none)]> show variables like 'version%';
|
+-------------------------+---------------------------------+
|
| Variable_name | Value |
|
+-------------------------+---------------------------------+
|
| version | 10.1.12-MariaDB |
|
| version_comment | MariaDB Server |
|
| version_compile_machine | x86_64 |
|
| version_compile_os | Linux |
|
| version_malloc_library | system jemalloc |
|
| version_ssl_library | OpenSSL 1.0.1e-fips 11 Feb 2013 |
|
+-------------------------+---------------------------------+
|
The errors are more prominent when we run the following java test where the connection is persisted, so the queries are being attempted faster:
https://github.com/sjangra-git/galera-tests
Auto-commit is OFF on the servers in the cluster:
MariaDB [(none)]> show global variables like 'autocommit';
|
+---------------+-------+
|
| Variable_name | Value |
|
+---------------+-------+
|
| autocommit | OFF |
|
+---------------+-------+
|
Few runs failed, few passed for the same test:
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
val1=5735 val2=5732
|
syn_wait FAILED
|
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
-bash-4.1$ ./test.sh 10.226.76.38 10.226.76.32
|
{"report":{"fcp":1484.8000001907349,"ttfb":482.5999994277954,"pageVisibility":"visible","entityId":57299,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"4e060149-6289-4463-bf15-39bafb855e5c","navigationType":0,"readyForUser":1651.5999994277954,"redirectCount":0,"resourceLoadedEnd":1267.5,"resourceLoadedStart":490.3999996185303,"resourceTiming":[{"duration":81.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":490.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":490.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.5,"responseStart":0,"secureConnectionStart":0},{"duration":81.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":490.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":490.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":360.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":490.8999996185303,"connectEnd":490.8999996185303,"connectStart":490.8999996185303,"domainLookupEnd":490.8999996185303,"domainLookupStart":490.8999996185303,"fetchStart":490.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":572.3999996185303,"responseEnd":851.0999994277954,"responseStart":588.5,"secureConnectionStart":490.8999996185303},{"duration":665.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":491.19999980926514,"connectEnd":571.5999994277954,"connectStart":571.5999994277954,"domainLookupEnd":571.5999994277954,"domainLookupStart":571.5999994277954,"fetchStart":491.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":572.1999998092651,"responseEnd":1156.8000001907349,"responseStart":586,"secureConnectionStart":571.5999994277954},{"duration":116,"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":491.3999996185303,"connectEnd":491.3999996185303,"connectStart":491.3999996185303,"domainLookupEnd":491.3999996185303,"domainLookupStart":491.3999996185303,"fetchStart":491.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":587.5,"responseEnd":607.3999996185303,"responseStart":602.6999998092651,"secureConnectionStart":491.3999996185303},{"duration":117.70000076293945,"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":491.5999994277954,"connectEnd":491.5999994277954,"connectStart":491.5999994277954,"domainLookupEnd":491.5999994277954,"domainLookupStart":491.5999994277954,"fetchStart":491.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":587.8000001907349,"responseEnd":609.3000001907349,"responseStart":603.8000001907349,"secureConnectionStart":491.5999994277954},{"duration":118.29999923706055,"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":491.80000019073486,"connectEnd":491.80000019073486,"connectStart":491.80000019073486,"domainLookupEnd":491.80000019073486,"domainLookupStart":491.80000019073486,"fetchStart":491.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":588,"responseEnd":610.0999994277954,"responseStart":604.5999994277954,"secureConnectionStart":491.80000019073486},{"duration":92.59999942779541,"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":492,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":492,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":584.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":118.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":492.0999994277954,"connectEnd":492.0999994277954,"connectStart":492.0999994277954,"domainLookupEnd":492.0999994277954,"domainLookupStart":492.0999994277954,"fetchStart":492.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":588.0999994277954,"responseEnd":610.3000001907349,"responseStart":605.3000001907349,"secureConnectionStart":492.0999994277954},{"duration":92.39999961853027,"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":492.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":492.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":584.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":118.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":492.5,"connectEnd":492.5,"connectStart":492.5,"domainLookupEnd":492.5,"domainLookupStart":492.5,"fetchStart":492.5,"redirectEnd":0,"redirectStart":0,"requestStart":588.3999996185303,"responseEnd":610.8000001907349,"responseStart":607.5,"secureConnectionStart":492.5},{"duration":770,"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":495.8999996185303,"connectEnd":495.8999996185303,"connectStart":495.8999996185303,"domainLookupEnd":495.8999996185303,"domainLookupStart":495.8999996185303,"fetchStart":495.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":723.6999998092651,"responseEnd":1265.8999996185303,"responseStart":1257,"secureConnectionStart":495.8999996185303},{"duration":766.6000003814697,"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":500.8999996185303,"connectEnd":500.8999996185303,"connectStart":500.8999996185303,"domainLookupEnd":500.8999996185303,"domainLookupStart":500.8999996185303,"fetchStart":500.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":964.5999994277954,"responseEnd":1267.5,"responseStart":1261,"secureConnectionStart":500.8999996185303},{"duration":256.70000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":994.5999994277954,"connectEnd":994.5999994277954,"connectStart":994.5999994277954,"domainLookupEnd":994.5999994277954,"domainLookupStart":994.5999994277954,"fetchStart":994.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":1202.8000001907349,"responseEnd":1251.3000001907349,"responseStart":1249.3999996185303,"secureConnectionStart":994.5999994277954},{"duration":305.8999996185303,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1427.3000001907349,"connectEnd":1427.3000001907349,"connectStart":1427.3000001907349,"domainLookupEnd":1427.3000001907349,"domainLookupStart":1427.3000001907349,"fetchStart":1427.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1703.3999996185303,"responseEnd":1733.1999998092651,"responseStart":1732.5999994277954,"secureConnectionStart":1427.3000001907349}],"fetchStart":0,"domainLookupStart":201,"domainLookupEnd":264,"connectStart":265,"connectEnd":283,"secureConnectionStart":273,"requestStart":285,"responseStart":483,"responseEnd":501,"domLoading":487,"domInteractive":1787,"domContentLoadedEventStart":1787,"domContentLoadedEventEnd":1861,"domComplete":2222,"loadEventStart":2222,"loadEventEnd":2222,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1726.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1727},{"name":"bigPipe.activity-panel-pipe-id.start","time":1727.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.end","time":1732.1999998092651},{"name":"activityTabFullyLoaded","time":1886.8000001907349}],"measures":[],"correlationId":"56e7eaf892f28e","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":126,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Failures are easily reproducible when I have two instances of mariadb server running locally in VMs.
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
val1=8791 val2=8789
syn_wait FAILED
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
val1=2917 val2=2915
syn_wait FAILED
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
val1=1087 val2=1085
syn_wait FAILED
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
val1=2371 val2=2369
syn_wait FAILED
[app@cb-node2 ~]$ ./test.sh 192.168.42.102 192.168.42.101
val1=6287 val2=6285
syn_wait FAILED