Commit c9e3ac39 authored by Marko Mäkelä's avatar Marko Mäkelä

squash! 4058381b

trx_write_serialisation_history(): Move some code from
trx_purge_add_undo_to_history().
parent 0e3b98ae
......@@ -268,12 +268,7 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
ut_ad(mach_read_from_2(undo_header + TRX_UNDO_NEEDS_PURGE) <= 1);
ut_ad(rseg->needs_purge > trx->id);
if (rseg->last_page_no == FIL_NULL)
{
rseg->last_page_no= undo->hdr_page_no;
rseg->set_last_commit(undo->hdr_offset, trx->rw_trx_hash_element->no);
}
ut_ad(rseg->last_page_no != FIL_NULL);
rseg->history_size++;
......
......@@ -992,12 +992,14 @@ static void trx_write_serialisation_history(trx_t *trx, mtr_t *mtr)
{
mysql_mutex_lock(&purge_sys.pq_mutex);
trx_sys.assign_new_trx_no(trx);
const trx_id_t end{trx->rw_trx_hash_element->no};
/* If the rollback segment is not empty, trx->no cannot be less
than any trx_t::no already in rseg. User threads only produce
events when a rollback segment is empty. */
purge_sys.purge_queue.push(TrxUndoRsegs(trx->rw_trx_hash_element->no,
*rseg));
purge_sys.purge_queue.push(TrxUndoRsegs{end, *rseg});
mysql_mutex_unlock(&purge_sys.pq_mutex);
rseg->last_page_no= undo->hdr_page_no;
rseg->set_last_commit(undo->hdr_offset, end);
}
else
trx_sys.assign_new_trx_no(trx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment