Skip to content

Commit d87b725

Browse files
committed
MDEV-17844 recs_off_validate() fails in page_zip_write_trx_id_and_roll_ptr()
In commit 0e5a4ac (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.
1 parent 88bcc7f commit d87b725

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

storage/innobase/row/row0umod.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,21 @@ row_undo_mod_clust(
457457
2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */
458458
offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
459459
if (trx_id_offset) {
460+
#ifdef UNIV_DEBUG
461+
ut_ad(rec_offs_validate(NULL, index, offsets));
462+
if (buf_block_get_page_zip(
463+
btr_pcur_get_block(&node->pcur))) {
464+
/* Below, page_zip_write_trx_id_and_roll_ptr()
465+
needs offsets to access DB_TRX_ID,DB_ROLL_PTR.
466+
We already computed offsets for possibly
467+
another record in the clustered index.
468+
Because the PRIMARY KEY is fixed-length,
469+
the offsets for the PRIMARY KEY and
470+
DB_TRX_ID,DB_ROLL_PTR are still valid.
471+
Silence the rec_offs_validate() assertion. */
472+
rec_offs_make_valid(rec, index, true, offsets);
473+
}
474+
#endif
460475
} else if (rec_is_metadata(rec, *index)) {
461476
ut_ad(!buf_block_get_page_zip(btr_pcur_get_block(
462477
&node->pcur)));

0 commit comments

Comments
 (0)