summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-01-31 09:54:43 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-01-31 09:54:43 +0200
commitd87b725eebbddb6d319ee99e51924a62635185a1 (patch)
tree89f5a6410305a20535b9ad1d42fcacc421f5a236
parent88bcc7f21c294f90140eb5468f7c95ce10dc18e4 (diff)
downloadmariadb-git-d87b725eebbddb6d319ee99e51924a62635185a1.tar.gz
MDEV-17844 recs_off_validate() fails in page_zip_write_trx_id_and_roll_ptr()
In commit 0e5a4ac2532c64a545796c787354dc41d61d0e62 (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.
-rw-r--r--storage/innobase/row/row0umod.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc
index e028e0ccb56..d2707130439 100644
--- a/storage/innobase/row/row0umod.cc
+++ b/storage/innobase/row/row0umod.cc
@@ -457,6 +457,21 @@ row_undo_mod_clust(
2 columns so that we can access DB_TRX_ID, DB_ROLL_PTR. */
offset_t offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
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)) {
ut_ad(!buf_block_get_page_zip(btr_pcur_get_block(
&node->pcur)));