From 96a15486c504ac2eca8e5e1dc325cbb125a4ba8e Mon Sep 17 00:00:00 2001 From: PavelShilin89 Date: Tue, 28 Oct 2025 09:50:59 +0000 Subject: [PATCH 1/9] Updated conflict-handling-verification.rec [skip ci] --- .../conflict-handling-verification.rec | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 test/clt-tests/replication/conflict-handling-verification.rec diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec new file mode 100644 index 0000000000..6c31fde52e --- /dev/null +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -0,0 +1,127 @@ +Replication Conflict Handling Verification (Issue #3847) + +This test verifies that the replication conflict resolution mechanism correctly handles +concurrent transactions across cluster nodes according to Galera rules. + +NOTE: This test requires a pre-configured 3-node cluster with nodes accessible on: +- Node 1: 127.0.0.1:31106 (replication: 31112) +- Node 2: 127.0.0.1:31206 (replication: 31212) +- Node 3: 127.0.0.1:31306 (replication: 31312) + +The test validates: +1. Non-conflicting transactions on different documents succeed +2. Conflicting transactions on same documents are detected and rejected +3. Data consistency is maintained across all nodes after conflicts +4. The original bug from issue #3847 is fixed (REPLACE vs DELETE conflict) + +For single-node testing, this test creates a simple demonstration of the expected behavior. + +––– comment ––– +=== Single-Node Demonstration (Cluster test requires multi-node setup) === +––– comment ––– +Start Manticore Search +––– input ––– +rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd > /dev/null +––– output ––– +––– input ––– +if timeout 10 grep -qm1 'accepting connections' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Manticore started'; else echo 'Timeout'; fi +––– output ––– +Manticore started +––– comment ––– +=== Create test cluster and table === +––– input ––– +mysql -h0 -P9306 -e "CREATE CLUSTER test" +––– output ––– +––– input ––– +mysql -h0 -P9306 -e "CREATE TABLE tbl1 (id bigint, attr1 int)" +––– output ––– +––– input ––– +mysql -h0 -P9306 -e "ALTER CLUSTER test ADD tbl1" +––– output ––– +––– comment ––– +=== Populate test data === +––– input ––– +mysql -h0 -P9306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (1,1), (3,2), (10,3), (11,4), (12,5), (13,6), (14,7), (15,8), (20,9)" +––– output ––– +––– input ––– +mysql -h0 -P9306 -NB -e "SELECT COUNT(*) FROM test:tbl1" +––– output ––– ++------+ +| 9 | ++------+ +––– comment ––– +=== Test basic operations that would conflict in multi-node setup === +––– comment ––– +Test REPLACE operation +––– input ––– +mysql -h0 -P9306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (11,100), (12,200), (13,300)" +––– output ––– +––– input ––– +mysql -h0 -P9306 -NB -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (11,12,13) ORDER BY id ASC" +––– output ––– +11 100 +12 200 +13 300 +––– comment ––– +Test DELETE operation +––– input ––– +mysql -h0 -P9306 -e "DELETE FROM test:tbl1 WHERE id=13" +––– output ––– +––– input ––– +mysql -h0 -P9306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=13" +––– output ––– ++------+ +| 0 | ++------+ +––– comment ––– +Test UPDATE operation +––– input ––– +mysql -h0 -P9306 -e "UPDATE test:tbl1 SET attr1=999 WHERE id=12" +––– output ––– +––– input ––– +mysql -h0 -P9306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12" +––– output ––– ++------+ +| 999 | ++------+ +––– comment ––– +=== Verify cluster status === +––– input ––– +mysql -h0 -P9306 -e "SHOW STATUS LIKE 'cluster%'" | grep -E "cluster_name|cluster_size" +––– output ––– +#!/.*cluster_name.*test.*/!# +#!/.*cluster_size.*/!# +––– comment ––– +=== Multi-Node Conflict Test Instructions === +––– input ––– +echo "=== MULTI-NODE CLUSTER TEST REQUIREMENTS ==="; echo "This test requires 3 Manticore nodes running on:"; echo " Node 1: 127.0.0.1:31106 (replication: 31112)"; echo " Node 2: 127.0.0.1:31206 (replication: 31212)"; echo " Node 3: 127.0.0.1:31306 (replication: 31312)"; echo ""; echo "Test Scenarios:"; echo "A. Non-Conflicting (should succeed):"; echo " - Different documents: UPDATE id=13 & REPLACE id=10"; echo " - Different inserts: INSERT id=100 & INSERT id=200"; echo ""; echo "B. Conflicting (should detect conflict):"; echo " - Same document: UPDATE id=13 & REPLACE id=13"; echo " - Range conflict: UPDATE id>13 & REPLACE id=14"; echo " - Double DELETE: DELETE id=1 & DELETE id=1"; echo " - Double UPDATE: UPDATE id=15 SET attr1=111 & UPDATE id=15 SET attr1=222"; echo ""; echo "C. 3-Node Tests:"; echo " - 3 different docs: REPLACE id=1, id=10, id=20 (all succeed)"; echo " - 3 same doc: UPDATE id=12 on all nodes (2 conflicts)"; echo ""; echo "Expected: Conflicts detected, data consistent across nodes"; echo "See issue #3847 for details" +––– output ––– +=== MULTI-NODE CLUSTER TEST REQUIREMENTS === +This test requires 3 Manticore nodes running on: + Node 1: 127.0.0.1:31106 (replication: 31112) + Node 2: 127.0.0.1:31206 (replication: 31212) + Node 3: 127.0.0.1:31306 (replication: 31312) + +Test Scenarios: +A. Non-Conflicting (should succeed): + - Different documents: UPDATE id=13 & REPLACE id=10 + - Different inserts: INSERT id=100 & INSERT id=200 + +B. Conflicting (should detect conflict): + - Same document: UPDATE id=13 & REPLACE id=13 + - Range conflict: UPDATE id>13 & REPLACE id=14 + - Double DELETE: DELETE id=1 & DELETE id=1 + - Double UPDATE: UPDATE id=15 SET attr1=111 & UPDATE id=15 SET attr1=222 + +C. 3-Node Tests: + - 3 different docs: REPLACE id=1, id=10, id=20 (all succeed) + - 3 same doc: UPDATE id=12 on all nodes (2 conflicts) + +Expected: Conflicts detected, data consistent across nodes +See issue #3847 for details +––– comment ––– +=== Cleanup === +––– input ––– +mysql -h0 -P9306 -e "DROP TABLE test:tbl1" 2>/dev/null; mysql -h0 -P9306 -e "DROP CLUSTER test" 2>/dev/null; echo "Test completed" +––– output ––– +Test completed \ No newline at end of file From 1108a8ade8eab0103b296a7a77c634257a9fce0f Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Fri, 31 Oct 2025 11:36:57 +0100 Subject: [PATCH 2/9] Update conflict-handling-verification.rec --- .../conflict-handling-verification.rec | 386 ++++++++++++++---- 1 file changed, 302 insertions(+), 84 deletions(-) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec index 6c31fde52e..e919121ac0 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -1,127 +1,345 @@ -Replication Conflict Handling Verification (Issue #3847) - -This test verifies that the replication conflict resolution mechanism correctly handles -concurrent transactions across cluster nodes according to Galera rules. - -NOTE: This test requires a pre-configured 3-node cluster with nodes accessible on: -- Node 1: 127.0.0.1:31106 (replication: 31112) -- Node 2: 127.0.0.1:31206 (replication: 31212) -- Node 3: 127.0.0.1:31306 (replication: 31312) - -The test validates: -1. Non-conflicting transactions on different documents succeed -2. Conflicting transactions on same documents are detected and rejected -3. Data consistency is maintained across all nodes after conflicts -4. The original bug from issue #3847 is fixed (REPLACE vs DELETE conflict) - -For single-node testing, this test creates a simple demonstration of the expected behavior. - +––– input ––– +set -b +m +––– output ––– +––– input ––– +export INSTANCE=1 +––– output ––– +––– block: ../base/replication/start-searchd-precach ––– +––– input ––– +export INSTANCE=2 +––– output ––– +––– block: ../base/replication/start-searchd-precach ––– +––– input ––– +export INSTANCE=3 +––– output ––– +––– block: ../base/replication/start-searchd-precach ––– ––– comment ––– -=== Single-Node Demonstration (Cluster test requires multi-node setup) === +Create 3-node cluster and add test table +––– input ––– +mkdir /var/{lib,log}/manticore-{1,2,3}/test +––– output ––– +––– input ––– +mysql -h0 -P1306 -e "CREATE CLUSTER test 'test' as path"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P2306 -e "JOIN CLUSTER test at '127.0.0.1:1312' 'test' as path"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P3306 -e "JOIN CLUSTER test at '127.0.0.1:1312' 'test' as path"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P1306 -e "CREATE TABLE tbl1 (id bigint, attr1 int)"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P1306 -e "ALTER CLUSTER test ADD tbl1"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P1306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (1,1), (3,2), (10,3), (11,4), (12,5), (13,6), (14,7), (15,8), (20,9)"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +9 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +9 +––– input ––– +mysql -h0 -P3306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +9 ––– comment ––– -Start Manticore Search +Test 1: UPDATE different doc & REPLACE different doc (NO conflict expected) ––– input ––– -rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd > /dev/null +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 999)" & wait ––– output ––– ––– input ––– -if timeout 10 grep -qm1 'accepting connections' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Manticore started'; else echo 'Timeout'; fi +mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 13)\G" ––– output ––– -Manticore started +*************************** 1. row *************************** + id: 10 +attr1: 999 +*************************** 2. row *************************** + id: 13 +attr1: 1 +––– input ––– +mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 13)\G" +––– output ––– +*************************** 1. row *************************** + id: 10 +attr1: 999 +*************************** 2. row *************************** + id: 13 +attr1: 1 ––– comment ––– -=== Create test cluster and table === +Test 2: REPLACE different docs (NO conflict expected) ––– input ––– -mysql -h0 -P9306 -e "CREATE CLUSTER test" +mysql -h0 -P2306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (11, 111)" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 101)" & wait ––– output ––– ––– input ––– -mysql -h0 -P9306 -e "CREATE TABLE tbl1 (id bigint, attr1 int)" +mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 11)\G" ––– output ––– +*************************** 1. row *************************** + id: 11 +attr1: 111 +*************************** 2. row *************************** + id: 10 +attr1: 101 ––– input ––– -mysql -h0 -P9306 -e "ALTER CLUSTER test ADD tbl1" +mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 11)\G" ––– output ––– +*************************** 1. row *************************** + id: 11 +attr1: 111 +*************************** 2. row *************************** + id: 10 +attr1: 101 ––– comment ––– -=== Populate test data === +Test 3: DELETE & REPLACE different docs (NO conflict expected) +––– input ––– +mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 102)" & wait +––– output ––– +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=3\G" +––– output ––– +*************************** 1. row *************************** +0 ––– input ––– -mysql -h0 -P9306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (1,1), (3,2), (10,3), (11,4), (12,5), (13,6), (14,7), (15,8), (20,9)" +mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=10\G" ––– output ––– +*************************** 1. row *************************** +102 ––– input ––– -mysql -h0 -P9306 -NB -e "SELECT COUNT(*) FROM test:tbl1" +mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=10\G" ––– output ––– -+------+ -| 9 | -+------+ +*************************** 1. row *************************** +102 ––– comment ––– -=== Test basic operations that would conflict in multi-node setup === +Test 4: INSERT different ids (NO conflict expected) +––– input ––– +mysql -h0 -P2306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (100, 1)" & mysql -h0 -P1306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (200, 2)" & wait +––– output ––– +––– input ––– +mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (100, 200)\G" +––– output ––– +*************************** 1. row *************************** + id: 100 +attr1: 1 +*************************** 2. row *************************** + id: 200 +attr1: 2 ––– comment ––– -Test REPLACE operation +Test 5: UPDATE & REPLACE same doc (CONFLICT expected) +––– input ––– +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait +––– output ––– +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 13 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=13\G" +––– output ––– +*************************** 1. row *************************** +999 ––– input ––– -mysql -h0 -P9306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (11,100), (12,200), (13,300)" +mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=13\G" ––– output ––– +*************************** 1. row *************************** +999 +––– comment ––– +Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected - NEW detects this!) ––– input ––– -mysql -h0 -P9306 -NB -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (11,12,13) ORDER BY id ASC" +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait ––– output ––– -11 100 -12 200 -13 300 +ERROR 1064 (42000) at line 1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 15 ––– comment ––– -Test DELETE operation +Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected - NEW detects this!) ––– input ––– -mysql -h0 -P9306 -e "DELETE FROM test:tbl1 WHERE id=13" +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? ––– output ––– +0 ––– input ––– -mysql -h0 -P9306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=13" +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait ––– output ––– -+------+ -| 0 | -+------+ +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 18 ––– comment ––– -Test UPDATE operation +Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected - NEW detects this!) ––– input ––– -mysql -h0 -P9306 -e "UPDATE test:tbl1 SET attr1=999 WHERE id=12" +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? ––– output ––– +0 ––– input ––– -mysql -h0 -P9306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12" +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait ––– output ––– -+------+ -| 999 | -+------+ +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 21 ––– comment ––– -=== Verify cluster status === +Test 9: DELETE & REPLACE same doc (CONFLICT expected) +––– input ––– +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? +––– output ––– +0 ––– input ––– -mysql -h0 -P9306 -e "SHOW STATUS LIKE 'cluster%'" | grep -E "cluster_name|cluster_size" +mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait ––– output ––– -#!/.*cluster_name.*test.*/!# -#!/.*cluster_size.*/!# +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 24 ––– comment ––– -=== Multi-Node Conflict Test Instructions === +Test 10: 2x DELETE same doc (CONFLICT expected) +––– input ––– +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)"; echo $? +––– output ––– +0 ––– input ––– -echo "=== MULTI-NODE CLUSTER TEST REQUIREMENTS ==="; echo "This test requires 3 Manticore nodes running on:"; echo " Node 1: 127.0.0.1:31106 (replication: 31112)"; echo " Node 2: 127.0.0.1:31206 (replication: 31212)"; echo " Node 3: 127.0.0.1:31306 (replication: 31312)"; echo ""; echo "Test Scenarios:"; echo "A. Non-Conflicting (should succeed):"; echo " - Different documents: UPDATE id=13 & REPLACE id=10"; echo " - Different inserts: INSERT id=100 & INSERT id=200"; echo ""; echo "B. Conflicting (should detect conflict):"; echo " - Same document: UPDATE id=13 & REPLACE id=13"; echo " - Range conflict: UPDATE id>13 & REPLACE id=14"; echo " - Double DELETE: DELETE id=1 & DELETE id=1"; echo " - Double UPDATE: UPDATE id=15 SET attr1=111 & UPDATE id=15 SET attr1=222"; echo ""; echo "C. 3-Node Tests:"; echo " - 3 different docs: REPLACE id=1, id=10, id=20 (all succeed)"; echo " - 3 same doc: UPDATE id=12 on all nodes (2 conflicts)"; echo ""; echo "Expected: Conflicts detected, data consistent across nodes"; echo "See issue #3847 for details" +mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait ––– output ––– -=== MULTI-NODE CLUSTER TEST REQUIREMENTS === -This test requires 3 Manticore nodes running on: - Node 1: 127.0.0.1:31106 (replication: 31112) - Node 2: 127.0.0.1:31206 (replication: 31212) - Node 3: 127.0.0.1:31306 (replication: 31312) - -Test Scenarios: -A. Non-Conflicting (should succeed): - - Different documents: UPDATE id=13 & REPLACE id=10 - - Different inserts: INSERT id=100 & INSERT id=200 - -B. Conflicting (should detect conflict): - - Same document: UPDATE id=13 & REPLACE id=13 - - Range conflict: UPDATE id>13 & REPLACE id=14 - - Double DELETE: DELETE id=1 & DELETE id=1 - - Double UPDATE: UPDATE id=15 SET attr1=111 & UPDATE id=15 SET attr1=222 - -C. 3-Node Tests: - - 3 different docs: REPLACE id=1, id=10, id=20 (all succeed) - - 3 same doc: UPDATE id=12 on all nodes (2 conflicts) - -Expected: Conflicts detected, data consistent across nodes -See issue #3847 for details +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 27 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=1\G" +––– output ––– +*************************** 1. row *************************** +0 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=1\G" +––– output ––– +*************************** 1. row *************************** +0 +––– comment ––– +Test 11: 2x UPDATE same doc (CONFLICT expected) +––– input ––– +mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait +––– output ––– +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 29 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" +––– output ––– +*************************** 1. row *************************** +111 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" +––– output ––– +*************************** 1. row *************************** +111 +––– comment ––– +Test 12: 3x REPLACE different docs on 3 nodes (NO conflict expected) +––– input ––– +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1001)" & mysql -h0 -P2306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 1010)" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (20, 1020)" & wait +––– output ––– +––– input ––– +mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" +––– output ––– +*************************** 1. row *************************** + id: 1 +attr1: 1001 +*************************** 2. row *************************** + id: 20 +attr1: 1020 +*************************** 3. row *************************** + id: 10 +attr1: 1010 +––– input ––– +mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" +––– output ––– +*************************** 1. row *************************** + id: 1 +attr1: 1001 +*************************** 2. row *************************** + id: 20 +attr1: 1020 +*************************** 3. row *************************** + id: 10 +attr1: 1010 +––– input ––– +mysql -h0 -P3306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" +––– output ––– +*************************** 1. row *************************** + id: 1 +attr1: 1001 +*************************** 2. row *************************** + id: 20 +attr1: 1020 +*************************** 3. row *************************** + id: 10 +attr1: 1010 +––– comment ––– +Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) +––– input ––– +mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait +––– output ––– +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 34 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" +––– output ––– +*************************** 1. row *************************** +300 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" +––– output ––– +*************************** 1. row *************************** +300 +––– input ––– +mysql -h0 -P3306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" +––– output ––– +*************************** 1. row *************************** +300 +––– comment ––– +Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) +––– input ––– +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)"; echo $? +––– output ––– +0 +––– input ––– +mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait +––– output ––– +ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 38 +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=14\G" +––– output ––– +*************************** 1. row *************************** +0 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=14\G" +––– output ––– +*************************** 1. row *************************** +0 +––– input ––– +mysql -h0 -P3306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" +––– output ––– +*************************** 1. row *************************** +1500 ––– comment ––– -=== Cleanup === +Final verification: Check synchronization and no FATAL errors +––– input ––– +mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +10 +––– input ––– +mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +10 +––– input ––– +mysql -h0 -P3306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" +––– output ––– +*************************** 1. row *************************** +10 +––– input ––– +mysql -h0 -P1306 -e "SELECT * FROM test:tbl1" > /tmp/node1.txt; mysql -h0 -P2306 -e "SELECT * FROM test:tbl1" > /tmp/node2.txt; mysql -h0 -P3306 -e "SELECT * FROM test:tbl1" > /tmp/node3.txt; diff /tmp/node1.txt /tmp/node2.txt && diff /tmp/node2.txt /tmp/node3.txt && echo "All nodes synchronized" || echo "Discrepancies detected" +––– output ––– +All nodes synchronized ––– input ––– -mysql -h0 -P9306 -e "DROP TABLE test:tbl1" 2>/dev/null; mysql -h0 -P9306 -e "DROP CLUSTER test" 2>/dev/null; echo "Test completed" +for i in 1 2 3; do grep -q 'FATAL:' /var/log/manticore-${i}/searchd.log ; echo "Node #$i – $?"; done ––– output ––– -Test completed \ No newline at end of file +Node #1 – 1 +Node #2 – 1 +Node #3 – 1 From b2640115f61dac112de45275e14d457f461fc954 Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Mon, 3 Nov 2025 02:13:27 +0100 Subject: [PATCH 3/9] Update translator --- translator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translator b/translator index 0776792585..3afcbbd01e 160000 --- a/translator +++ b/translator @@ -1 +1 @@ -Subproject commit 0776792585905de18b7bdba13a6eda36507d047a +Subproject commit 3afcbbd01e311d573994543c0dd5eb7a5ac99c77 From 6ab7850fc9eee35eefc58f9c160824abcd945ede Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Mon, 3 Nov 2025 03:13:00 +0100 Subject: [PATCH 4/9] Update conflict-handling-verification.rec --- .../conflict-handling-verification.rec | 256 +++--------------- 1 file changed, 44 insertions(+), 212 deletions(-) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec index e919121ac0..44f2f779b5 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -62,284 +62,116 @@ Test 1: UPDATE different doc & REPLACE different doc (NO conflict expected) ––– input ––– mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 999)" & wait ––– output ––– -––– input ––– -mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 13)\G" -––– output ––– -*************************** 1. row *************************** - id: 10 -attr1: 999 -*************************** 2. row *************************** - id: 13 -attr1: 1 -––– input ––– -mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 13)\G" -––– output ––– -*************************** 1. row *************************** - id: 10 -attr1: 999 -*************************** 2. row *************************** - id: 13 -attr1: 1 ––– comment ––– Test 2: REPLACE different docs (NO conflict expected) ––– input ––– mysql -h0 -P2306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (11, 111)" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 101)" & wait ––– output ––– -––– input ––– -mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 11)\G" -––– output ––– -*************************** 1. row *************************** - id: 11 -attr1: 111 -*************************** 2. row *************************** - id: 10 -attr1: 101 -––– input ––– -mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (10, 11)\G" -––– output ––– -*************************** 1. row *************************** - id: 11 -attr1: 111 -*************************** 2. row *************************** - id: 10 -attr1: 101 ––– comment ––– Test 3: DELETE & REPLACE different docs (NO conflict expected) ––– input ––– mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 102)" & wait ––– output ––– -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=3\G" -––– output ––– -*************************** 1. row *************************** -0 -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=10\G" -––– output ––– -*************************** 1. row *************************** -102 -––– input ––– -mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=10\G" -––– output ––– -*************************** 1. row *************************** -102 ––– comment ––– Test 4: INSERT different ids (NO conflict expected) ––– input ––– mysql -h0 -P2306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (100, 1)" & mysql -h0 -P1306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (200, 2)" & wait ––– output ––– -––– input ––– -mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (100, 200)\G" -––– output ––– -*************************** 1. row *************************** - id: 100 -attr1: 1 -*************************** 2. row *************************** - id: 200 -attr1: 2 ––– comment ––– -Test 5: UPDATE & REPLACE same doc (CONFLICT expected) -––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; echo $? -––– output ––– -0 +Test 5: UPDATE & REPLACE same doc (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait +mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; sleep 2 ––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 13 ––– input ––– -mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=13\G" +conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -*************************** 1. row *************************** -999 -––– input ––– -mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=13\G" -––– output ––– -*************************** 1. row *************************** -999 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected - NEW detects this!) +Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait +conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -ERROR 1064 (42000) at line 1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 15 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected - NEW detects this!) -––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? -––– output ––– -0 +Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait +conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 18 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected - NEW detects this!) -––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? -––– output ––– -0 +Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait +conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 21 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 9: DELETE & REPLACE same doc (CONFLICT expected) +Test 9: DELETE & REPLACE same doc (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)"; echo $? +conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -0 -––– input ––– -mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait -––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 24 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 10: 2x DELETE same doc (CONFLICT expected) -––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)"; echo $? -––– output ––– -0 -––– input ––– -mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait -––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 27 -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=1\G" -––– output ––– -*************************** 1. row *************************** -0 +Test 10: 2x DELETE same doc (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=1\G" +conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -*************************** 1. row *************************** -0 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 11: 2x UPDATE same doc (CONFLICT expected) -––– input ––– -mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait -––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 29 -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" -––– output ––– -*************************** 1. row *************************** -111 +Test 11: 2x UPDATE same doc (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" +conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -*************************** 1. row *************************** -111 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– Test 12: 3x REPLACE different docs on 3 nodes (NO conflict expected) ––– input ––– mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1001)" & mysql -h0 -P2306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 1010)" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (20, 1020)" & wait ––– output ––– -––– input ––– -mysql -h0 -P1306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" -––– output ––– -*************************** 1. row *************************** - id: 1 -attr1: 1001 -*************************** 2. row *************************** - id: 20 -attr1: 1020 -*************************** 3. row *************************** - id: 10 -attr1: 1010 -––– input ––– -mysql -h0 -P2306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" -––– output ––– -*************************** 1. row *************************** - id: 1 -attr1: 1001 -*************************** 2. row *************************** - id: 20 -attr1: 1020 -*************************** 3. row *************************** - id: 10 -attr1: 1010 -––– input ––– -mysql -h0 -P3306 -e "SELECT id, attr1 FROM test:tbl1 WHERE id IN (1, 10, 20)\G" -––– output ––– -*************************** 1. row *************************** - id: 1 -attr1: 1001 -*************************** 2. row *************************** - id: 20 -attr1: 1020 -*************************** 3. row *************************** - id: 10 -attr1: 1010 ––– comment ––– -Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) +Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait +conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 34 -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" -––– output ––– -*************************** 1. row *************************** -300 -––– input ––– -mysql -h0 -P2306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" -––– output ––– -*************************** 1. row *************************** -300 -––– input ––– -mysql -h0 -P3306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=12\G" -––– output ––– -*************************** 1. row *************************** -300 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– -Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) -––– input ––– -mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)"; echo $? -––– output ––– -0 +Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait +conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– -ERROR 1064 (42000) at line 1: table tbl1: error at PostRollback, code 3 (transaction aborted, server can continue), seqno 38 -––– input ––– -mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=14\G" -––– output ––– -*************************** 1. row *************************** -0 -––– input ––– -mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1 WHERE id=14\G" -––– output ––– -*************************** 1. row *************************** -0 -––– input ––– -mysql -h0 -P3306 -NB -e "SELECT attr1 FROM test:tbl1 WHERE id=15\G" -––– output ––– -*************************** 1. row *************************** -1500 +Conflicts: %{NUMBER}/10 +PASS ––– comment ––– Final verification: Check synchronization and no FATAL errors ––– input ––– mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" ––– output ––– *************************** 1. row *************************** -10 +%{NUMBER} ––– input ––– mysql -h0 -P2306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" ––– output ––– *************************** 1. row *************************** -10 +%{NUMBER} ––– input ––– mysql -h0 -P3306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" ––– output ––– *************************** 1. row *************************** -10 +%{NUMBER} ––– input ––– mysql -h0 -P1306 -e "SELECT * FROM test:tbl1" > /tmp/node1.txt; mysql -h0 -P2306 -e "SELECT * FROM test:tbl1" > /tmp/node2.txt; mysql -h0 -P3306 -e "SELECT * FROM test:tbl1" > /tmp/node3.txt; diff /tmp/node1.txt /tmp/node2.txt && diff /tmp/node2.txt /tmp/node3.txt && echo "All nodes synchronized" || echo "Discrepancies detected" ––– output ––– All nodes synchronized ––– input ––– -for i in 1 2 3; do grep -q 'FATAL:' /var/log/manticore-${i}/searchd.log ; echo "Node #$i – $?"; done +for i in 1 2 3; do grep -q 'FATAL:' /var/log/manticore-${i}/searchd.log && echo "Node #$i has FATAL" || echo "Node #$i OK"; done ––– output ––– -Node #1 – 1 -Node #2 – 1 -Node #3 – 1 +Node #1 OK +Node #2 OK +Node #3 OK From 93c50affd9bff154d33221f02768ea8fd8723a75 Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Mon, 3 Nov 2025 14:07:51 +0100 Subject: [PATCH 5/9] Increase in the number of cycles to 30 --- .../conflict-handling-verification.rec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec index 44f2f779b5..deefe46c9d 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -83,49 +83,49 @@ Test 5: UPDATE & REPLACE same doc (CONFLICT expected) - run 10 times mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; sleep 2 ––– output ––– ––– input ––– -conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 9: DELETE & REPLACE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 10: 2x DELETE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 11: 2x UPDATE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS @@ -137,14 +137,14 @@ mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1001)" & mysq ––– comment ––– Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..10}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS From 2ed3e517e30be87472f5f9c16550230b08871b65 Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Mon, 3 Nov 2025 23:00:26 +0100 Subject: [PATCH 6/9] Added manticore-load to increase conflict probability in replication test --- .../conflict-handling-verification.rec | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec index deefe46c9d..8729f1e834 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -58,6 +58,12 @@ mysql -h0 -P3306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" *************************** 1. row *************************** 9 ––– comment ––– +Start background load to increase conflict probability +––– input ––– +manticore-load --host=127.0.0.1 --port=1306 --query="REPLACE INTO test:tbl1 (id, attr1) VALUES (%RAND, %RAND)" --host=127.0.0.1 --port=2306 --together > /dev/null 2>&1 & LOAD_PID=$!; sleep 1; echo "Load started: $LOAD_PID" +––– output ––– +Load started: %{NUMBER} +––– comment ––– Test 1: UPDATE different doc & REPLACE different doc (NO conflict expected) ––– input ––– mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 999)" & wait @@ -83,49 +89,49 @@ Test 5: UPDATE & REPLACE same doc (CONFLICT expected) - run 10 times mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; sleep 2 ––– output ––– ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 9: DELETE & REPLACE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 10: 2x DELETE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 11: 2x UPDATE same doc (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS @@ -137,18 +143,24 @@ mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1001)" & mysq ––– comment ––– Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) - run 10 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 2; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 2 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– Conflicts: %{NUMBER}/10 PASS ––– comment ––– +Stop background load +––– input ––– +kill $LOAD_PID 2>/dev/null; wait $LOAD_PID 2>/dev/null; echo "Load stopped" +––– output ––– +Load stopped +––– comment ––– Final verification: Check synchronization and no FATAL errors ––– input ––– mysql -h0 -P1306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" From a99000f95bd5f1e0974caedfa535b69d55c1a27c Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Tue, 4 Nov 2025 14:30:59 +0100 Subject: [PATCH 7/9] Added threads=4 for manticore-load --- test/clt-tests/replication/conflict-handling-verification.rec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/replication/conflict-handling-verification.rec index 8729f1e834..b6b396452d 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/replication/conflict-handling-verification.rec @@ -60,7 +60,7 @@ mysql -h0 -P3306 -NB -e "SELECT COUNT(*) FROM test:tbl1\G" ––– comment ––– Start background load to increase conflict probability ––– input ––– -manticore-load --host=127.0.0.1 --port=1306 --query="REPLACE INTO test:tbl1 (id, attr1) VALUES (%RAND, %RAND)" --host=127.0.0.1 --port=2306 --together > /dev/null 2>&1 & LOAD_PID=$!; sleep 1; echo "Load started: $LOAD_PID" +manticore-load --host=127.0.0.1 --threads=4 --port=1306 --query="REPLACE INTO test:tbl1 (id, attr1) VALUES (%RAND, %RAND)" --host=127.0.0.1 --port=2306 --together > /dev/null 2>&1 & LOAD_PID=$!; sleep 1; echo "Load started: $LOAD_PID" ––– output ––– Load started: %{NUMBER} ––– comment ––– From b02dc8518ae9170da8b97e0f712ae429960c9302 Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Tue, 4 Nov 2025 16:15:41 +0100 Subject: [PATCH 8/9] Update 3847-conflict-handling-verification.rec --- .../3847-conflict-handling-verification.rec} | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) rename test/clt-tests/{replication/conflict-handling-verification.rec => bugs/3847-conflict-handling-verification.rec} (86%) diff --git a/test/clt-tests/replication/conflict-handling-verification.rec b/test/clt-tests/bugs/3847-conflict-handling-verification.rec similarity index 86% rename from test/clt-tests/replication/conflict-handling-verification.rec rename to test/clt-tests/bugs/3847-conflict-handling-verification.rec index b6b396452d..722cc99478 100644 --- a/test/clt-tests/replication/conflict-handling-verification.rec +++ b/test/clt-tests/bugs/3847-conflict-handling-verification.rec @@ -1,6 +1,11 @@ ––– input ––– set -b +m ––– output ––– +––– comment ––– +Limit searchd to 4 threads for consistent conflict detection (add only if not present) +––– input ––– +grep -q 'threads = 4' test/clt-tests/base/searchd-with-flexible-ports.conf || sed -i '/searchd {/a\ threads = 4' test/clt-tests/base/searchd-with-flexible-ports.conf +––– output ––– ––– input ––– export INSTANCE=1 ––– output ––– @@ -84,56 +89,56 @@ Test 4: INSERT different ids (NO conflict expected) mysql -h0 -P2306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (100, 1)" & mysql -h0 -P1306 -e "INSERT INTO test:tbl1 (id, attr1) VALUES (200, 2)" & wait ––– output ––– ––– comment ––– -Test 5: UPDATE & REPLACE same doc (CONFLICT expected) - run 10 times +Test 5: UPDATE & REPLACE same doc (CONFLICT expected) - run 30 times ––– input ––– mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; sleep 2 ––– output ––– ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +≈ PASS ––– comment ––– -Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 10 times +Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id>13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 888)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected) - run 10 times +Test 7: UPDATE WHERE attr & REPLACE (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 333)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected) - run 10 times +Test 8: UPDATE WHERE attr & DELETE (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE attr1=2" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=3" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 9: DELETE & REPLACE same doc (CONFLICT expected) - run 10 times +Test 9: DELETE & REPLACE same doc (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 2)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=3" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (3, 303)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 10: 2x DELETE same doc (CONFLICT expected) - run 10 times +Test 10: 2x DELETE same doc (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=1" & mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=1" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 11: 2x UPDATE same doc (CONFLICT expected) - run 10 times +Test 11: 2x UPDATE same doc (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=111 WHERE id=15" & mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=222 WHERE id=15" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– Test 12: 3x REPLACE different docs on 3 nodes (NO conflict expected) @@ -141,18 +146,18 @@ Test 12: 3x REPLACE different docs on 3 nodes (NO conflict expected) mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (1, 1001)" & mysql -h0 -P2306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (10, 1010)" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (20, 1020)" & wait ––– output ––– ––– comment ––– -Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) - run 10 times +Test 13: 3x UPDATE same doc on 3 nodes (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P1306 -e "UPDATE test:tbl1 SET attr1=100 WHERE id=12" & mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=200 WHERE id=12" & mysql -h0 -P3306 -e "UPDATE test:tbl1 SET attr1=300 WHERE id=12" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– -Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) - run 10 times +Test 14: 2x DELETE + REPLACE on 3 nodes (CONFLICT expected) - run 30 times ––– input ––– -conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/10"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" +conflicts=0; for i in {1..30}; do mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (14, 14)" > /dev/null 2>&1; sleep 3; result=$( (mysql -h0 -P1306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P2306 -e "DELETE FROM test:tbl1 WHERE id=14" & mysql -h0 -P3306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (15, 1500)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -Conflicts: %{NUMBER}/10 +Conflicts: %{NUMBER}/30 PASS ––– comment ––– Stop background load From 8e29e3bb41927155e7e63fe7d45b23e7c4215d34 Mon Sep 17 00:00:00 2001 From: Pavel_Shilin Date: Tue, 4 Nov 2025 22:04:18 +0100 Subject: [PATCH 9/9] Extra characters removed --- test/clt-tests/bugs/3847-conflict-handling-verification.rec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/clt-tests/bugs/3847-conflict-handling-verification.rec b/test/clt-tests/bugs/3847-conflict-handling-verification.rec index 722cc99478..08e7fca1d5 100644 --- a/test/clt-tests/bugs/3847-conflict-handling-verification.rec +++ b/test/clt-tests/bugs/3847-conflict-handling-verification.rec @@ -96,7 +96,7 @@ mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 6)"; sleep 2 ––– input ––– conflicts=0; for i in {1..30}; do result=$( (mysql -h0 -P2306 -e "UPDATE test:tbl1 SET attr1=1 WHERE id=13" & mysql -h0 -P1306 -e "REPLACE INTO test:tbl1 (id, attr1) VALUES (13, 999)" & wait) 2>&1 ); if echo "$result" | grep -q "error at PostRollback"; then ((conflicts++)); fi; done; echo "Conflicts: $conflicts/30"; test $conflicts -ge 1 && echo "PASS" || echo "FAIL" ––– output ––– -≈ +Conflicts: %{NUMBER}/30 PASS ––– comment ––– Test 6: UPDATE WHERE id> & REPLACE (CONFLICT expected) - run 30 times