The following test shows a case where a SR transaction may be rolled back locally, but is never rolled back in the rest of cluster:
--source include/galera_cluster.inc
|
--source include/have_debug_sync.inc
|
|
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
--connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
|
--connection node_1
|
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
|
|
--connection node_2
|
SET SESSION wsrep_trx_fragment_size=1;
|
BEGIN;
|
INSERT INTO t1 VALUES (21);
|
|
--connection node_3a
|
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--connection node_1a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--connection node_2a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
|
--echo #### block COMMIT before certification on node 2 ...
|
--connection node_2
|
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue';
|
--send COMMIT
|
|
--connection node_2a
|
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
|
|
--echo #### ... and disconnect node 2
|
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
|
--echo #### unblock commit and observe an error
|
SET DEBUG_SYNC = 'now SIGNAL continue';
|
|
--connection node_2
|
--error 1180
|
--reap
|
|
--connection node_2a
|
SET DEBUG_SYNC = 'RESET';
|
|
--connection node_1a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
|
--echo #### reconnect node 3
|
|
--connection node_3a
|
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--connection node_1a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
SHOW STATUS LIKE 'wsrep_cluster_status';
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
|
--echo #### reconnect node 2
|
|
--connection node_2a
|
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0';
|
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
--source include/galera_wait_ready.inc
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--connection node_1a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
--source include/galera_wait_ready.inc
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--connection node_3a
|
SET SESSION wsrep_sync_wait = 0;
|
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
--source include/wait_condition.inc
|
--source include/galera_wait_ready.inc
|
SET SESSION wsrep_sync_wait = DEFAULT;
|
|
--echo observe entries still in wsrep_streaming_log table
|
--connection node_1a
|
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
|
--connection node_2a
|
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
|
--connection node_3a
|
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
|
|
--connection node_1
|
DROP TABLE t1;
|
The test issues a SR transaction that replicates a fragment, and attempts to commit. The commit fails because the node is temporarily in a non-primary view. The commit failure causes the following events:
node attempts to send a rollback fragment. this step fails also (node is still non-primary)
the failure in step 1) is ignored (see streaming_rollback() and its callers in wsrep-lib)
the transaction is rolled back locally
the transaction remains alive in the rest of the cluster, the other nodes do not recognize this as a orphaned transaction (see server_state::close_orphaned_sr_transactions())
Notice that the test uses a specific sequence of views events, so from node 2's perspective we have these events:
primary view (1,2,3)
start transaction; insert (1)
primary view (1,2)
non primary
commit() // failure and rollback here
primary view (1,2,3)
So that the views in steps 3 and 6 are not equal consecutive views (see close_orphaned_sr_transactions())
There are no comments yet on this issue.
{"report":{"fcp":1164.4000000953674,"ttfb":318.59999990463257,"pageVisibility":"visible","entityId":103320,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b645ae13-8b33-40b5-985e-efa91b1b5dfb","navigationType":0,"readyForUser":1271.9000000953674,"redirectCount":0,"resourceLoadedEnd":867.5,"resourceLoadedStart":325.09999990463257,"resourceTiming":[{"duration":177.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":325.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":502.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":177.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":325.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":502.5,"responseStart":0,"secureConnectionStart":0},{"duration":384.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":325.5,"connectEnd":325.5,"connectStart":325.5,"domainLookupEnd":325.5,"domainLookupStart":325.5,"fetchStart":325.5,"redirectEnd":0,"redirectStart":0,"requestStart":514,"responseEnd":710.4000000953674,"responseStart":538.2000000476837,"secureConnectionStart":325.5},{"duration":218.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":325.59999990463257,"connectEnd":325.59999990463257,"connectStart":325.59999990463257,"domainLookupEnd":325.59999990463257,"domainLookupStart":325.59999990463257,"fetchStart":325.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":515.0999999046326,"responseEnd":544.2000000476837,"responseStart":542.2000000476837,"secureConnectionStart":325.59999990463257},{"duration":541.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":325.59999990463257,"connectEnd":325.59999990463257,"connectStart":325.59999990463257,"domainLookupEnd":325.59999990463257,"domainLookupStart":325.59999990463257,"fetchStart":325.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":514.9000000953674,"responseEnd":867.5,"responseStart":540.5,"secureConnectionStart":325.59999990463257},{"duration":226.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":325.7000000476837,"connectEnd":325.7000000476837,"connectStart":325.7000000476837,"domainLookupEnd":325.7000000476837,"domainLookupStart":325.7000000476837,"fetchStart":325.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":516.5999999046326,"responseEnd":552.5999999046326,"responseStart":544.4000000953674,"secureConnectionStart":325.7000000476837},{"duration":184.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":325.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":510.5,"responseStart":0,"secureConnectionStart":0},{"duration":227.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":325.90000009536743,"connectEnd":325.90000009536743,"connectStart":325.90000009536743,"domainLookupEnd":325.90000009536743,"domainLookupStart":325.90000009536743,"fetchStart":325.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":516.7000000476837,"responseEnd":553.4000000953674,"responseStart":545.7999999523163,"secureConnectionStart":325.90000009536743},{"duration":184.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":326.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":326.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":511,"responseStart":0,"secureConnectionStart":0},{"duration":229,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":326.09999990463257,"connectEnd":326.09999990463257,"connectStart":326.09999990463257,"domainLookupEnd":326.09999990463257,"domainLookupStart":326.09999990463257,"fetchStart":326.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":517.2999999523163,"responseEnd":555.0999999046326,"responseStart":547.2999999523163,"secureConnectionStart":326.09999990463257},{"duration":233.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":326.2999999523163,"connectEnd":326.2999999523163,"connectStart":326.2999999523163,"domainLookupEnd":326.2999999523163,"domainLookupStart":326.2999999523163,"fetchStart":326.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":517.5,"responseEnd":559.4000000953674,"responseStart":549.7000000476837,"secureConnectionStart":326.2999999523163},{"duration":460.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":332.2999999523163,"connectEnd":332.2999999523163,"connectStart":332.2999999523163,"domainLookupEnd":332.2999999523163,"domainLookupStart":332.2999999523163,"fetchStart":332.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":595.5,"responseEnd":792.5999999046326,"responseStart":789.2000000476837,"secureConnectionStart":332.2999999523163},{"duration":479.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":332.40000009536743,"connectEnd":332.40000009536743,"connectStart":332.40000009536743,"domainLookupEnd":332.40000009536743,"domainLookupStart":332.40000009536743,"fetchStart":332.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":672.2000000476837,"responseEnd":811.7999999523163,"responseStart":805.4000000953674,"secureConnectionStart":332.40000009536743},{"duration":129.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":851.7000000476837,"connectEnd":851.7000000476837,"connectStart":851.7000000476837,"domainLookupEnd":851.7000000476837,"domainLookupStart":851.7000000476837,"fetchStart":851.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":951.9000000953674,"responseEnd":981.4000000953674,"responseStart":980.4000000953674,"secureConnectionStart":851.7000000476837}],"fetchStart":0,"domainLookupStart":127,"domainLookupEnd":145,"connectStart":145,"connectEnd":164,"secureConnectionStart":153,"requestStart":165,"responseStart":319,"responseEnd":324,"domLoading":322,"domInteractive":1396,"domContentLoadedEventStart":1396,"domContentLoadedEventEnd":1459,"domComplete":2070,"loadEventStart":2070,"loadEventEnd":2070,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1378.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1379.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1379.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1380.2000000476837},{"name":"activityTabFullyLoaded","time":1467.2000000476837}],"measures":[],"correlationId":"9103e4efbefe0b","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":73,"dbReadsTimeInMs":9,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}