Doing a SELECT WHERE including the primary key of a partitioned table causes the following SELECTs to behave incorrectly.
Essentially the following behaviour:
INSERT INTO foo VALUES (1, '1'),(2, '2'),(3, '3'),(4, '4');
– ok, check directly on backend nodes and values are split between them
SELECT * FROM foo;
– ok, returns all entries
SELECT * FROM foo WHERE id=1;
– ok, returns previously inserted row
SELECT * FROM foo;
– broken! returns only entries from the partition containing id=1!
SELECT * FROM foo WHERE id=2;
– ok, returns previously inserted row
SELECT * FROM foo;
– broken! returns only entries from the partition containing id=2!
Note that this happens even when the SELECT's are done from different connections in spider.
The setup is very simple, running locally, with:
- 1 spider node
- 2 datanodes (node1 and node2)
No changes to spider variables, everything is default.
I'm using the following table, partitioned BY KEY(id) in spider:
CREATE TABLE foo
(
id int(10) NOT NULL,
val varchar(50) NOT NULL,
PRIMARY KEY(id)
)
ENGINE=spider
COMMENT='wrapper "mysql", table "foo"'
PARTITION BY KEY (id)
(
PARTITION p1 COMMENT = 'srv "node1"',
PARTITION p2 COMMENT = 'srv "node2"'
);
This problem also happens with RANGE/HASH partitioned tables.
Also, if the primary key is composite, say (id, val), then the select must include both columns for the problematic behavior to happen.
- is duplicated by
-
MDEV-26333
Resullt of SELECT from partitioned Spider table depends on the partition targeted by the previous SELECT
-
-
Closed
{"report":{"fcp":757.5,"ttfb":242.39999997615814,"pageVisibility":"visible","entityId":77039,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"dfd31780-6365-4d8f-a4d2-ffde34d9793f","navigationType":0,"readyForUser":833.3999999761581,"redirectCount":0,"resourceLoadedEnd":811.3000000119209,"resourceLoadedStart":248,"resourceTiming":[{"duration":7.100000023841858,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":248,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":248,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":255.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":7.099999964237213,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":248.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":248.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":255.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":64.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":248.39999997615814,"connectEnd":248.39999997615814,"connectStart":248.39999997615814,"domainLookupEnd":248.39999997615814,"domainLookupStart":248.39999997615814,"fetchStart":248.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":248.39999997615814,"responseEnd":312.5,"responseStart":312.5,"secureConnectionStart":248.39999997615814},{"duration":147.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":248.60000002384186,"connectEnd":248.60000002384186,"connectStart":248.60000002384186,"domainLookupEnd":248.60000002384186,"domainLookupStart":248.60000002384186,"fetchStart":248.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":248.60000002384186,"responseEnd":396,"responseStart":396,"secureConnectionStart":248.60000002384186},{"duration":151.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":248.69999998807907,"connectEnd":248.69999998807907,"connectStart":248.69999998807907,"domainLookupEnd":248.69999998807907,"domainLookupStart":248.69999998807907,"fetchStart":248.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":248.69999998807907,"responseEnd":399.89999997615814,"responseStart":399.89999997615814,"secureConnectionStart":248.69999998807907},{"duration":151.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":248.89999997615814,"connectEnd":248.89999997615814,"connectStart":248.89999997615814,"domainLookupEnd":248.89999997615814,"domainLookupStart":248.89999997615814,"fetchStart":248.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":248.89999997615814,"responseEnd":400.60000002384186,"responseStart":400.60000002384186,"secureConnectionStart":248.89999997615814},{"duration":152.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":249.19999998807907,"connectEnd":249.19999998807907,"connectStart":249.19999998807907,"domainLookupEnd":249.19999998807907,"domainLookupStart":249.19999998807907,"fetchStart":249.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":249.19999998807907,"responseEnd":401.30000001192093,"responseStart":401.30000001192093,"secureConnectionStart":249.19999998807907},{"duration":204,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":249.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":453.30000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":152.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":249.39999997615814,"connectEnd":249.39999997615814,"connectStart":249.39999997615814,"domainLookupEnd":249.39999997615814,"domainLookupStart":249.39999997615814,"fetchStart":249.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":249.39999997615814,"responseEnd":402.10000002384186,"responseStart":402.10000002384186,"secureConnectionStart":249.39999997615814},{"duration":203.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":249.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":453.5,"responseStart":0,"secureConnectionStart":0},{"duration":153.0999999642372,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":249.80000001192093,"connectEnd":249.80000001192093,"connectStart":249.80000001192093,"domainLookupEnd":249.80000001192093,"domainLookupStart":249.80000001192093,"fetchStart":249.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":249.80000001192093,"responseEnd":402.89999997615814,"responseStart":402.89999997615814,"secureConnectionStart":249.80000001192093},{"duration":557.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":250.5,"connectEnd":250.5,"connectStart":250.5,"domainLookupEnd":250.5,"domainLookupStart":250.5,"fetchStart":250.5,"redirectEnd":0,"redirectStart":0,"requestStart":250.5,"responseEnd":807.8999999761581,"responseStart":807.8000000119209,"secureConnectionStart":250.5},{"duration":560.6999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":250.60000002384186,"connectEnd":250.60000002384186,"connectStart":250.60000002384186,"domainLookupEnd":250.60000002384186,"domainLookupStart":250.60000002384186,"fetchStart":250.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":250.60000002384186,"responseEnd":811.3000000119209,"responseStart":811.3000000119209,"secureConnectionStart":250.60000002384186},{"duration":344.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":464.39999997615814,"connectEnd":464.39999997615814,"connectStart":464.39999997615814,"domainLookupEnd":464.39999997615814,"domainLookupStart":464.39999997615814,"fetchStart":464.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":464.39999997615814,"responseEnd":808.6000000238419,"responseStart":808.6000000238419,"secureConnectionStart":464.39999997615814},{"duration":173.5999999642372,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":751.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":751.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":924.6999999880791,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":83,"responseStart":242,"responseEnd":246,"domLoading":245,"domInteractive":953,"domContentLoadedEventStart":953,"domContentLoadedEventEnd":992,"domComplete":1692,"loadEventStart":1692,"loadEventEnd":1694,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":932.5},{"name":"bigPipe.sidebar-id.end","time":933.3000000119209},{"name":"bigPipe.activity-panel-pipe-id.start","time":933.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":936.1000000238419},{"name":"activityTabFullyLoaded","time":998.6999999880791}],"measures":[],"correlationId":"9b3654e096c954","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}