Under REPEATABLE-READ isolation level,an UPDATE statement which update the value of primary key caused phantom rows in another transaction.
How to repeat:
It appears that a phantom row (2, 2) showed up in the second consistent read of T2. And if you commit the second transaction, the phantom row will disappear. I'm not sure whether this is a new bug or a duplicate one. From the user's perspective, I haven't inserted a new row, updating existing rows should not result in phantom rows.
The results are somewhat surprising. The baseline and innodb_snapshot_isolation=on show about the same performance where innodb_snapshot_isolation=off falls back a bit. The averages are ~5750 tps and ~5600 tps.
I double checked the configuration and plotted even the counters for Handler_commit and Handler_rollback. But the results are real. As expected we get more rollbacks for innodb_snapshot_isolation=on.
Axel Schwenke
added a comment - The results are somewhat surprising. The baseline and innodb_snapshot_isolation=on show about the same performance where innodb_snapshot_isolation=off falls back a bit. The averages are ~5750 tps and ~5600 tps.
I double checked the configuration and plotted even the counters for Handler_commit and Handler_rollback . But the results are real. As expected we get more rollbacks for innodb_snapshot_isolation=on .
Attached: tpcc1.pdf
So, 3x more rollbacks (and Monty said it'll be ~3x), as expected.
axel, how was your tps calculated? Are rollbacks count towards tps? Are rolled back transactions re-applied?
Sergei Golubchik
added a comment - So, 3x more rollbacks (and Monty said it'll be ~3x), as expected.
axel , how was your tps calculated? Are rollbacks count towards tps? Are rolled back transactions re-applied?
how was your tps calculated? Are rollbacks count towards tps?
The TPS numbers come from sysbench. It's simply the number of executions of the event() function in the LUA script. Which for TPC-C calls one of 5 functions for one of 5 transactions. Of those only the NEW ORDER transaction does an explicit ROLLBACK. And AFAICS that rollback is not connected to an SQL error, but to an empty result.
I have now added plots of Com_commit and Com_rollback counters (in tpcc1.pdf) . If I compare the TPS plot with Com_commit the latter is a bit lower. That would mean a rollback is counted towards TPS. But this changes nothing of the throughput comparison of the 3 commits/configurations.
The numbers for Handler_rollback are higher than those for Com_rollback - but only for the case innodb_snapshot_isolation=on. Those rollbacks must be implicit then and are ignored by sysbench. However sysbench reports those errors independently.
For innodb_snapshot_isolation=off:
SQL statistics:
queries performed:
read: 262257215
write: 272207592
other: 40437558
total: 574902365
transactions: 20218683 (5616.26 per sec.)
queries: 574902365 (159693.89 per sec.)
ignored errors: 87982 (24.44 per sec.)
reconnects: 0 (0.00 per sec.)
And innodb_snapshot_isolation=on:
SQL statistics:
queries performed:
read: 268903843
write: 279039940
other: 41682778
total: 589626561
transactions: 20730792 (5758.51 per sec.)
queries: 589626561 (163783.92 per sec.)
ignored errors: 200264 (55.63 per sec.)
reconnects: 0 (0.00 per sec.)
Are rolled back transactions re-applied?
I can see that nowhere in the LUA code.
Axel Schwenke
added a comment - how was your tps calculated? Are rollbacks count towards tps?
The TPS numbers come from sysbench. It's simply the number of executions of the event() function in the LUA script. Which for TPC-C calls one of 5 functions for one of 5 transactions. Of those only the NEW ORDER transaction does an explicit ROLLBACK. And AFAICS that rollback is not connected to an SQL error, but to an empty result.
I have now added plots of Com_commit and Com_rollback counters (in tpcc1.pdf ) . If I compare the TPS plot with Com_commit the latter is a bit lower. That would mean a rollback is counted towards TPS. But this changes nothing of the throughput comparison of the 3 commits/configurations.
The numbers for Handler_rollback are higher than those for Com_rollback - but only for the case innodb_snapshot_isolation=on . Those rollbacks must be implicit then and are ignored by sysbench. However sysbench reports those errors independently.
For innodb_snapshot_isolation=off :
SQL statistics:
queries performed:
read: 262257215
write: 272207592
other: 40437558
total: 574902365
transactions: 20218683 (5616.26 per sec.)
queries: 574902365 (159693.89 per sec.)
ignored errors: 87982 (24.44 per sec.)
reconnects: 0 (0.00 per sec.)
And innodb_snapshot_isolation=on :
SQL statistics:
queries performed:
read: 268903843
write: 279039940
other: 41682778
total: 589626561
transactions: 20730792 (5758.51 per sec.)
queries: 589626561 (163783.92 per sec.)
ignored errors: 200264 (55.63 per sec.)
reconnects: 0 (0.00 per sec.)
Are rolled back transactions re-applied?
I can see that nowhere in the LUA code.
For what it is worth, in InnoDB a rollback is like a commit, with the added step of undoing all changes. It seems to me that Com_commit is defined in com_status_vars as the following entry:
{"commit", STMT_STATUS(SQLCOM_COMMIT)},
This is something that would be updated outside InnoDB. Maybe the Lua scripts keep executing COMMIT statements after ignoring ER_CHECKREAD errors, or maybe autocommit transactions that are in fact rolled back due to an error will be counted as committed.
Marko Mäkelä
added a comment - For what it is worth, in InnoDB a rollback is like a commit, with the added step of undoing all changes. It seems to me that Com_commit is defined in com_status_vars as the following entry:
{ "commit" , STMT_STATUS(SQLCOM_COMMIT)},
This is something that would be updated outside InnoDB. Maybe the Lua scripts keep executing COMMIT statements after ignoring ER_CHECKREAD errors, or maybe autocommit transactions that are in fact rolled back due to an error will be counted as committed.
People
Axel Schwenke
Zhuang Liu
Votes:
1Vote for this issue
Watchers:
10Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1724.8999996185303,"ttfb":610.5999999046326,"pageVisibility":"visible","entityId":126648,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"af15a7dd-9724-4b88-9ecc-46818c1cc8ca","navigationType":0,"readyForUser":1904.3999996185303,"redirectCount":0,"resourceLoadedEnd":1522,"resourceLoadedStart":615.8999996185303,"resourceTiming":[{"duration":329.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":615.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":615.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":945.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":329.30000019073486,"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":616.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":616.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":945.5,"responseStart":0,"secureConnectionStart":0},{"duration":641.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":616.5,"connectEnd":616.5,"connectStart":616.5,"domainLookupEnd":616.5,"domainLookupStart":616.5,"fetchStart":616.5,"redirectEnd":0,"redirectStart":0,"requestStart":958.0999999046326,"responseEnd":1257.6999998092651,"responseStart":1000.5,"secureConnectionStart":616.5},{"duration":792.0999999046326,"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":616.5999999046326,"connectEnd":616.5999999046326,"connectStart":616.5999999046326,"domainLookupEnd":616.5999999046326,"domainLookupStart":616.5999999046326,"fetchStart":616.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":957.8999996185303,"responseEnd":1408.6999998092651,"responseStart":995.3999996185303,"secureConnectionStart":616.5999999046326},{"duration":384.7000002861023,"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":616.7999997138977,"connectEnd":616.7999997138977,"connectStart":616.7999997138977,"domainLookupEnd":616.7999997138977,"domainLookupStart":616.7999997138977,"fetchStart":616.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":958.3999996185303,"responseEnd":1001.5,"responseStart":1000,"secureConnectionStart":616.7999997138977},{"duration":386,"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":617,"connectEnd":617,"connectStart":617,"domainLookupEnd":617,"domainLookupStart":617,"fetchStart":617,"redirectEnd":0,"redirectStart":0,"requestStart":962.7999997138977,"responseEnd":1003,"responseStart":1001.6999998092651,"secureConnectionStart":617},{"duration":392.09999990463257,"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":617.1999998092651,"connectEnd":617.1999998092651,"connectStart":617.1999998092651,"domainLookupEnd":617.1999998092651,"domainLookupStart":617.1999998092651,"fetchStart":617.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":965.0999999046326,"responseEnd":1009.2999997138977,"responseStart":1003.1999998092651,"secureConnectionStart":617.1999998092651},{"duration":332.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":617.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":617.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":949.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":392.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":617.5999999046326,"connectEnd":617.5999999046326,"connectStart":617.5999999046326,"domainLookupEnd":617.5999999046326,"domainLookupStart":617.5999999046326,"fetchStart":617.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":966.5,"responseEnd":1009.6999998092651,"responseStart":1004.0999999046326,"secureConnectionStart":617.5999999046326},{"duration":333.40000009536743,"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":617.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":617.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":951.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":397.5,"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":617.8999996185303,"connectEnd":617.8999996185303,"connectStart":617.8999996185303,"domainLookupEnd":617.8999996185303,"domainLookupStart":617.8999996185303,"fetchStart":617.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":975.5,"responseEnd":1015.3999996185303,"responseStart":1012,"secureConnectionStart":617.8999996185303},{"duration":793.7999997138977,"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":624.5999999046326,"connectEnd":624.5999999046326,"connectStart":624.5999999046326,"domainLookupEnd":624.5999999046326,"domainLookupStart":624.5999999046326,"fetchStart":624.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1405.1999998092651,"responseEnd":1418.3999996185303,"responseStart":1417.1999998092651,"secureConnectionStart":624.5999999046326},{"duration":897.3000001907349,"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":624.6999998092651,"connectEnd":624.6999998092651,"connectStart":624.6999998092651,"domainLookupEnd":624.6999998092651,"domainLookupStart":624.6999998092651,"fetchStart":624.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1503.0999999046326,"responseEnd":1522,"responseStart":1521.3999996185303,"secureConnectionStart":624.6999998092651},{"duration":141,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1400.1999998092651,"connectEnd":1400.1999998092651,"connectStart":1400.1999998092651,"domainLookupEnd":1400.1999998092651,"domainLookupStart":1400.1999998092651,"fetchStart":1400.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1502.3999996185303,"responseEnd":1541.1999998092651,"responseStart":1540.5,"secureConnectionStart":1400.1999998092651},{"duration":332.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1653.2999997138977,"connectEnd":1653.2999997138977,"connectStart":1653.2999997138977,"domainLookupEnd":1653.2999997138977,"domainLookupStart":1653.2999997138977,"fetchStart":1653.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1953.0999999046326,"responseEnd":1986,"responseStart":1984.0999999046326,"secureConnectionStart":1653.2999997138977}],"fetchStart":0,"domainLookupStart":369,"domainLookupEnd":385,"connectStart":385,"connectEnd":408,"secureConnectionStart":396,"requestStart":409,"responseStart":611,"responseEnd":623,"domLoading":614,"domInteractive":2029,"domContentLoadedEventStart":2029,"domContentLoadedEventEnd":2099,"domComplete":2744,"loadEventStart":2744,"loadEventEnd":2744,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1964.7999997138977},{"name":"bigPipe.sidebar-id.end","time":1965.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1965.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1972.0999999046326},{"name":"activityTabFullyLoaded","time":2121.699999809265}],"measures":[],"correlationId":"c88fcc83a36b9b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":124,"dbReadsTimeInMs":23,"dbConnsTimeInMs":35,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The results are somewhat surprising. The baseline and innodb_snapshot_isolation=on show about the same performance where innodb_snapshot_isolation=off falls back a bit. The averages are ~5750 tps and ~5600 tps.
I double checked the configuration and plotted even the counters for Handler_commit and Handler_rollback. But the results are real. As expected we get more rollbacks for innodb_snapshot_isolation=on.
Attached: tpcc1.pdf