diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-07 11:56:22 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-07 12:16:52 +0300 |
commit | 4a79e8e482a9dbb8ebde97d23b3856eebfcf4570 (patch) | |
tree | f131cf8b62c633085eec9b971d92fb7101ce95f7 | |
parent | a5b39825853126a26b8f789a8133fec1abe55d7f (diff) | |
download | mariadb-git-4a79e8e482a9dbb8ebde97d23b3856eebfcf4570.tar.gz |
MDEV-25594: Assertion failure in DeadlockChecker::check_and_resolve()
ha_innobase::index_read(): If an autocommit non-locking transaction was
already started, refuse to access a SPATIAL INDEX.
Once a non-locking autocommit transaction has started, it must remain
in that mode (not acquire any locks).
This will hopefully fix the assertion failure that would occur in
DeadlockChecker::check_and_resolve() under heavy load, presumably
due to concurrent execution of trx_t::commit_in_memory().
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b2908fc9819..48cb81ce2c0 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8804,8 +8804,12 @@ ha_innobase::index_read( /* For R-Tree index, we will always place the page lock to pages being searched */ - if (dict_index_is_spatial(index)) { - ++m_prebuilt->trx->will_lock; + if (index->is_spatial() && !m_prebuilt->trx->will_lock) { + if (trx_is_started(m_prebuilt->trx)) { + DBUG_RETURN(HA_ERR_READ_ONLY_TRANSACTION); + } else { + m_prebuilt->trx->will_lock = true; + } } /* Note that if the index for which the search template is built is not |