mariadb/storage/innobase
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
..
btr MDEV-35438 Annotate InnoDB I/O functions with noexcept 2025-01-09 07:43:24 +02:00
buf MDEV-36226 fixup: format mismatch 2025-04-02 12:53:21 +03:00
data Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
dict MDEV-36649 dict_acquire_mdl_shared() aborts when table mode is DICT_TABLE_OP_OPEN_ONLY_IF_CACHED 2025-04-22 15:17:29 +05:30
eval MDEV-27336 Crash on DROP DATABASE due to out-of-bounds result from InnoDB SUBSTR() 2021-12-21 17:33:26 +02:00
fil MDEV-33978 P_S.THREADS is not showing all server threads 2025-01-27 12:11:47 +02:00
fsp MDEV-35494 fil_space_t::fil_space_t() may be unsafe with GCC -flifetime-dse 2024-12-11 14:44:42 +02:00
fts MDEV-36061 Incorrect error handling on DDL with FULLTEXT INDEX 2025-02-13 16:28:06 +01:00
fut MDEV-32175: Reduce page_align(), page_offset() calls 2024-11-21 11:01:30 +02:00
gis Merge 10.5 into 10.6 2025-03-26 17:09:57 +02:00
ha MDEV-35472 Server crash in ha_storage_put_memlim upon reading from INNODB_LOCKS 2024-11-25 10:31:57 +02:00
handler MDEV-36182: Revert "MDEV-26674: Set innodb_use_native_aio=OFF 2025-04-17 15:31:39 +10:00
ibuf MDEV-35494 fil_space_t::fil_space_t() may be unsafe with GCC -flifetime-dse 2024-12-11 14:44:42 +02:00
include MDEV-36510 InnoDB fails to compile with clang++-20 2025-04-14 09:22:39 +03:00
lock MDEV-36639 innodb_snapshot_isolation=1 gives error for not committed row changes 2025-04-22 20:41:43 +03:00
log MDEV-36304 InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY error 2025-04-22 17:53:08 +05:30
mem Cleanup: Remove duplicated code 2024-11-29 14:16:34 +02:00
mtr MDEV-35701 trx_t::autoinc_locks causes unnecessary dynamic memory allocation 2025-01-15 16:55:01 +02:00
mysql-test/storage_engine Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
os MDEV-36226 Stall and crash when page cleaner fails to generate free pages during Async flush 2025-03-31 19:09:23 +05:30
page MDEV-32175: Reduce page_align(), page_offset() calls 2024-11-21 11:01:30 +02:00
pars MDEV-35436 dict_stats_fetch_from_ps() unnecessarily holds exclusive dict_sys.latch 2025-02-13 16:54:17 +01:00
que MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
read MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rem Merge branch '10.5' into 10.6 2024-03-13 21:02:34 +01:00
row MDEV-36360: Don't grab table-level X locks for applied inserts 2025-04-02 04:50:30 +02:00
srv MDEV-36226 Stall and crash when page cleaner fails to generate free pages during Async flush 2025-03-31 19:09:23 +05:30
sync MDEV-34973: innobase/lock0lock: add noexcept 2024-10-01 09:53:16 +03:00
trx Merge branch '10.5' into 10.6 2025-04-21 10:43:17 +02:00
unittest MDEV-35587 unit.innodb_sync leaks memory on mac 2024-12-12 10:27:36 +11:00
ut MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
bzip2.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
CMakeLists.txt MDEV-34690 lock_rec_unlock_unmodified() causes deadlock 2024-10-23 12:36:17 +03:00
COPYING.Google
COPYING.Percona
lz4.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
lzma.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
lzo.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
snappy.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00