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

MDEV-17844 recs_off_validate() fails in page_zip_write_trx_id_and_roll_ptr()

In commit 0e5a4ac2 (MDEV-15562)
we introduced was a bogus debug check failure that does not affect
the correctness of the release build.

With a fixed-length PRIMARY KEY, we do not have to recompute
the rec_get_offsets() after restarting the mini-transaction,
because the offsets of DB_TRX_ID,DB_ROLL_PTR are not going
to change.

row_undo_mod_clust(): Invoke rec_offs_make_valid() to keep the
debug check in page_zip_write_trx_id_and_roll_ptr() happy.

The scenario to reproduce this bug should be rather unlikely:
In the time frame when row_undo_mod_clust() has committed its
first mini-transaction and has not yet started the next one,
another mini-transaction must do something that causes the page
to be reorganized, split or merged.
parent 88bcc7f2
...@@ -457,6 +457,21 @@ row_undo_mod_clust( ...@@ -457,6 +457,21 @@ row_undo_mod_clust(
2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */ 2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */
offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2]; offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
if (trx_id_offset) { if (trx_id_offset) {
#ifdef UNIV_DEBUG
ut_ad(rec_offs_validate(NULL, index, offsets));
if (buf_block_get_page_zip(
btr_pcur_get_block(&node->pcur))) {
/* Below, page_zip_write_trx_id_and_roll_ptr()
needs offsets to access DB_TRX_ID,DB_ROLL_PTR.
We already computed offsets for possibly
another record in the clustered index.
Because the PRIMARY KEY is fixed-length,
the offsets for the PRIMARY KEY and
DB_TRX_ID,DB_ROLL_PTR are still valid.
Silence the rec_offs_validate() assertion. */
rec_offs_make_valid(rec, index, true, offsets);
}
#endif
} else if (rec_is_metadata(rec, *index)) { } else if (rec_is_metadata(rec, *index)) {
ut_ad(!buf_block_get_page_zip(btr_pcur_get_block( ut_ad(!buf_block_get_page_zip(btr_pcur_get_block(
&node->pcur))); &node->pcur)));
......
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