mariadb/storage
Marko Mäkelä 7614f8fb5d MDEV-38589: SELECT unnecessarily waits for log write
The design of "binlog group commit" involves carrying some state across
transaction boundaries. This includes trx_t::commit_lsn, which keeps track
of how much write-ahead log needs to be written. Unfortunately, this
field was not reset in a commit where a log write was elided. That would
cause an unnecessary wait in a subsequent read-only transaction that
happened to reuse the same transaction object.

trx_deregister_from_2pc(): Reset trx->commit_lsn so that
an earlier write that was executed in the same client connection
will not result in an unnecessary wait during a subsequent read
operation.

trx_commit_complete_for_mysql(): Unless we are inside a binlog
group commit, reset trx->commit_lsn.

unlock_and_close_files(): Reset trx->commit_lsn after durably
writing the log, and remove a redundant log write call from some
callers.

trx_t::rollback_finish(): Clear commit_lsn, because a rolled-back
transaction will not need to be durably written.

trx_t::clear_and_free(): Wrapper function to suppress a debug check
in trx_t::free().

Also, remove some redundant ut_ad(!trx->will_lock) that will be checked
in trx_t::free().

Reviewed by: Vladislav Vaintroub
2026-01-28 13:24:09 +02:00
..
archive Merge 10.6 into 10.11 2024-06-27 10:26:09 +03:00
blackhole MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
columnstore Merge branch '10.6' into 10.11 2025-10-22 09:44:15 +02:00
connect MDEV-37633 Connect UDF functions push empty string warning. 2025-09-12 16:29:04 +10:00
csv Merge 10.6 into 10.11 2025-08-22 06:47:54 +03:00
example MDEV-36729: ha_example::show_func_example is incorrectly defined 2025-05-29 10:10:52 +10:00
federated Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
federatedx MDEV-29874: FederatedX error 10000 on multi-table UPDATE/DELETE 2025-10-22 15:35:54 +07:00
heap Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
innobase MDEV-38589: SELECT unnecessarily waits for log write 2026-01-28 13:24:09 +02:00
maria Merge branch '10.6' into 10.11 2025-12-19 14:18:11 +11:00
mroonga Fix compiler warnings 2025-09-30 12:06:31 +03:00
myisam Merge branch '10.6' into 10.11 2025-09-12 13:08:40 +02:00
myisammrg Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00
oqgraph Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
perfschema Merge 10.6 into 10.11 2025-08-22 06:47:54 +03:00
rocksdb MDEV-38110 Sever shutdown prevented by RocksDB setting rocksdb_pause_background_work 2026-01-14 19:44:54 +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 MDEV-38540 - spider/bugfix.perfschema fails sporadically 2026-01-12 23:00:13 +04:00
test_sql_discovery Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00