MDEV-35619 Assertion failure in row_purge_del_mark_error

trx_sys_t::find_same_or_older_in_purge(): Correct a mistake that
was made in commit 19acb0257e
(MDEV-35508) and make the caching logic correspond to the one in
trx_sys_t::find_same_or_older(). In the more common code path
for 64-bit systems, the condition !hot was inadvertently inverted,
making us wrongly skip calls to find_same_or_older_low() when the
transaction may still be active.

Furthermore, the call should have been to find_same_or_older_low()
and not the wrapper find_same_or_older().
This commit is contained in:
Marko Mäkelä 2024-12-13 11:41:47 +02:00
parent 155203c352
commit 1097164d3f

View file

@ -971,18 +971,23 @@ public:
Our IA-32 target is not "i386" but at least "i686", that is, at least
Pentium MMX, which has a 64-bit data bus and 64-bit XMM registers. */
bool hot= false;
trx->mutex_lock();
trx_id_t &max_inactive_id= trx->max_inactive_id;
const bool hot{max_inactive_id < id && find_same_or_older(trx, id)};
if (max_inactive_id >= id);
else if (!find_same_or_older_low(trx, id))
max_inactive_id= id;
else
hot= true;
#else
Atomic_relaxed<trx_id_t> &max_inactive_id= trx->max_inactive_id_atomic;
if (max_inactive_id >= id)
return false;
trx->mutex_lock();
const bool hot{find_same_or_older(trx, id)};
#endif
if (hot)
const bool hot{find_same_or_older_low(trx, id)};
if (!hot)
max_inactive_id= id;
#endif
trx->mutex_unlock();
return hot;
}