Description
We are developing a history verification tool capable of handling duplicate write values. During a Jepsen test on MariaDB under Repeatable Read(RR), we encountered an unusual transaction view that appears to violate the INTERNAL axiom.
Here is an example output from our tool:
session_id: 2
|
txn_id: 138
|
R(27, 4)
|
W(27, 3)
|
R(27, 4)
|
This indicates that a transaction sequentially performed read, write, and then another read on the same key (27). However, the final read does not reflect the write value (3). This behavior seems to resemble a previous bug that is claimed to be fixed, MDEV-26642, which we were able to reproduce in version 11.5.2. It appears that this issue has resurfaced in the latest versions.
We identified this bug using our Jepsen test tool under the Repeatable Read isolation level on versions 11.5.2, 11.4, and 10.5. Additionally, we manually reproduced MDEV-26642 in version 11.5.2. When testing under the Serializable isolation level, this bug does not seem to occur.
Reproduce Steps
The testing enviroment is provided in a docker container.
To reproduce it,
- Set up a mariadb server on port 4406 with username and password 'mysql'
- Load the Docker image and run the test:
docker load -i ubuntu-jepsen.tar
|
docker run -it --network=host ubuntu-jepsen
|
python3 test-docker.py
|
We use jepsen's rw-register workload to generate a history and then use our prototype tool to verify.
If you wish to modify the client configuration (e.g., port, username, or password), update the file /jepsen-mysql/src/jepsen/mysql/client.clj as shown below:
;; change CONFIG here
|
(def user "mysql")
|
(def password "mysql")
|
(def port 4406)
|
(def db "test")
|
Additional Information
We apologize for the current Clj implementation's complexity. 
- relates to
-
MDEV-26642
Weird SELECT view when a record is modified to the same value by two transactions
-
-
Closed
{"report":{"fcp":1305.0999999046326,"ttfb":350.30000019073486,"pageVisibility":"visible","entityId":131365,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8e4cf918-c451-4d15-8548-b7836348989a","navigationType":0,"readyForUser":1411.4000000953674,"redirectCount":0,"resourceLoadedEnd":1622.3000001907349,"resourceLoadedStart":364.80000019073486,"resourceTiming":[{"duration":312.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":364.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":677.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":312.5,"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":365.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":365.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":677.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":321.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":365.2000002861023,"connectEnd":365.2000002861023,"connectStart":365.2000002861023,"domainLookupEnd":365.2000002861023,"domainLookupStart":365.2000002861023,"fetchStart":365.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":365.2000002861023,"responseEnd":687,"responseStart":687,"secureConnectionStart":365.2000002861023},{"duration":386.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":365.40000009536743,"connectEnd":365.40000009536743,"connectStart":365.40000009536743,"domainLookupEnd":365.40000009536743,"domainLookupStart":365.40000009536743,"fetchStart":365.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":365.40000009536743,"responseEnd":751.5,"responseStart":751.5,"secureConnectionStart":365.40000009536743},{"duration":389.8999996185303,"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":365.7000002861023,"connectEnd":365.7000002861023,"connectStart":365.7000002861023,"domainLookupEnd":365.7000002861023,"domainLookupStart":365.7000002861023,"fetchStart":365.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":365.7000002861023,"responseEnd":755.5999999046326,"responseStart":755.5999999046326,"secureConnectionStart":365.7000002861023},{"duration":390.2999997138977,"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":365.80000019073486,"connectEnd":365.80000019073486,"connectStart":365.80000019073486,"domainLookupEnd":365.80000019073486,"domainLookupStart":365.80000019073486,"fetchStart":365.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":365.80000019073486,"responseEnd":756.0999999046326,"responseStart":756.0999999046326,"secureConnectionStart":365.80000019073486},{"duration":390.6000003814697,"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":366.09999990463257,"connectEnd":366.09999990463257,"connectStart":366.09999990463257,"domainLookupEnd":366.09999990463257,"domainLookupStart":366.09999990463257,"fetchStart":366.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":366.09999990463257,"responseEnd":756.7000002861023,"responseStart":756.7000002861023,"secureConnectionStart":366.09999990463257},{"duration":493,"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":366.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":366.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":859.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":391.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":366.30000019073486,"connectEnd":366.30000019073486,"connectStart":366.30000019073486,"domainLookupEnd":366.30000019073486,"domainLookupStart":366.30000019073486,"fetchStart":366.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":366.30000019073486,"responseEnd":757.8000001907349,"responseStart":757.8000001907349,"secureConnectionStart":366.30000019073486},{"duration":493,"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":366.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":366.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":859.5,"responseStart":0,"secureConnectionStart":0},{"duration":392.19999980926514,"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":366.7000002861023,"connectEnd":366.7000002861023,"connectStart":366.7000002861023,"domainLookupEnd":366.7000002861023,"domainLookupStart":366.7000002861023,"fetchStart":366.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":366.7000002861023,"responseEnd":758.9000000953674,"responseStart":758.9000000953674,"secureConnectionStart":366.7000002861023},{"duration":664.9000000953674,"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":367.80000019073486,"connectEnd":367.80000019073486,"connectStart":367.80000019073486,"domainLookupEnd":367.80000019073486,"domainLookupStart":367.80000019073486,"fetchStart":367.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":367.80000019073486,"responseEnd":1032.7000002861023,"responseStart":1032.7000002861023,"secureConnectionStart":367.80000019073486},{"duration":1250.7999997138977,"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":367.80000019073486,"connectEnd":367.80000019073486,"connectStart":367.80000019073486,"domainLookupEnd":367.80000019073486,"domainLookupStart":367.80000019073486,"fetchStart":367.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":367.80000019073486,"responseEnd":1618.5999999046326,"responseStart":1618.5999999046326,"secureConnectionStart":367.80000019073486},{"duration":150.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":883.4000000953674,"connectEnd":883.4000000953674,"connectStart":883.4000000953674,"domainLookupEnd":883.4000000953674,"domainLookupStart":883.4000000953674,"fetchStart":883.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":883.4000000953674,"responseEnd":1034.3000001907349,"responseStart":1034.3000001907349,"secureConnectionStart":883.4000000953674},{"duration":428.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1191.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1191.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1619.5,"responseStart":0,"secureConnectionStart":0},{"duration":430,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1192.3000001907349,"connectEnd":1192.3000001907349,"connectStart":1192.3000001907349,"domainLookupEnd":1192.3000001907349,"domainLookupStart":1192.3000001907349,"fetchStart":1192.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1192.3000001907349,"responseEnd":1622.3000001907349,"responseStart":1622.3000001907349,"secureConnectionStart":1192.3000001907349},{"duration":468.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1192.7000002861023,"connectEnd":1192.7000002861023,"connectStart":1192.7000002861023,"domainLookupEnd":1192.7000002861023,"domainLookupStart":1192.7000002861023,"fetchStart":1192.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1192.7000002861023,"responseEnd":1660.8000001907349,"responseStart":1660.8000001907349,"secureConnectionStart":1192.7000002861023}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":197,"responseStart":350,"responseEnd":363,"domLoading":354,"domInteractive":1655,"domContentLoadedEventStart":1655,"domContentLoadedEventEnd":1697,"domComplete":2800,"loadEventStart":2801,"loadEventEnd":2801,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1625.9000000953674},{"name":"bigPipe.sidebar-id.end","time":1626.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1627},{"name":"bigPipe.activity-panel-pipe-id.end","time":1628.2000002861023},{"name":"activityTabFullyLoaded","time":1719.9000000953674}],"measures":[],"correlationId":"f9e8eb1fc2b7e3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Xiaozhi, thank you for the report. You do not mention if you enabled the parameter innodb_snapshot_isolation=ON. It was only enabled by default in
MDEV-35124(MariaDB Server 10.6.2). We did not want to enable the bug fix by default in older releases, because it could break some applications. InnoDB never returns the error code ER_CHECKREAD unless that parameter is set.