mariadb/storage
Vlad Lesin 47e687b109 MDEV-36639 innodb_snapshot_isolation=1 gives error for not committed row changes
Set solution is to check if transaction, which modified a record, is
still active in lock_clust_rec_read_check_and_lock(). if yes, then just
request a lock. If no, then, depending on if the current transaction read
view can see the changes, return eighter DB_RECORD_CHANGED or request a
lock.

We can do the check in lock_clust_rec_read_check_and_lock() because
transaction tries to set a lock on the record which cursor points to after
transaction resuming and cursor position restoring. If the lock already
exists, then we don't request the lock again. But for the current commit
it's important that lock_clust_rec_read_check_and_lock() will be invoked
again for the same record, so we can do the check again after
transaction, which modified a record, was committed or rolled back.

MDEV-33802(4aa9291) is partially reverted. If some transaction holds
implicit lock on some record and transaction with snapshot isolation level
requests conflicting lock on the same record, it should be blocked instead
of returning DB_RECORD_CHANGED to have ability to continue execution when
implicit lock owner is rolled back.

The construction
--------------------------------------------------------------------------
let $wait_condition=
  select count(*) = 1 from information_schema.processlist
  where state = 'Updating' and info = 'UPDATE t SET b = 2 WHERE a';
--source include/wait_condition.inc
--------------------------------------------------------------------------

is not reliable enought to make sure transaction is blocked in test
case, the test failed sporadically with
--------------------------------------------------------------------------
./mtr --max-test-fail=1 --parallel=96 lock_isolation{,,,,,,,}{,,,}{,,} \
--repeat=500
--------------------------------------------------------------------------

command. That's why it was replaced with debug sync-points.

Reviewed by: Marko Mäkelä
2025-04-22 20:41:43 +03:00
..
archive Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00
blackhole MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
columnstore ColumnStore 6.4.10-1 2025-01-29 10:44:18 +01:00
connect Merge branch '10.5' into '10.6' 2025-04-15 01:49:48 +02:00
csv MDEV-34348: Miscellaneous fixes 2024-11-23 08:14:23 -07:00
example Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
federated Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
federatedx MDEV-36341 UBSAN: FederatedX fill_server runtime error: applying non-zero offset to null pointer 2025-04-07 11:04:53 +02:00
heap Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
innobase MDEV-36639 innodb_snapshot_isolation=1 gives error for not committed row changes 2025-04-22 20:41:43 +03:00
maria MENT-2235 Aria engine: log initialization failed 2025-03-09 12:50:56 +02:00
mroonga Merge branch '10.5' into '10.6' 2025-04-15 01:49:48 +02:00
myisam Merge branch '10.5' into '10.6' 2025-02-27 04:02:33 +01:00
myisammrg Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
oqgraph Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
perfschema MDEV-35384 Table performance_schema.session_status and other two tables are not shown in information_schema.tables for normal users 2025-01-09 10:00:35 +01:00
rocksdb mysqltest: fix --sorted_results 2025-01-09 10:00:36 +01:00
sequence MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
sphinx Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
spider Merge branch '10.5' into 10.6 2025-04-21 10:43:17 +02:00
test_sql_discovery Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00