summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-03-25 00:52:56 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-03-26 12:06:13 +0530
commitc433c9587f374103ee20751f6214e979fad63cab (patch)
treeb5a0ed8d509267edd07dd3b7f8a8eed55e5a4fd2
parentb40245e49d07845b15ea35f7166beea52a9322dd (diff)
downloadmariadb-git-c433c9587f374103ee20751f6214e979fad63cab.tar.gz
- Trying to fix the duplicate key crash
-rw-r--r--storage/innobase/include/trx0trx.h30
-rw-r--r--storage/innobase/include/trx0undo.h3
-rw-r--r--storage/innobase/row/row0vers.cc3
-rw-r--r--storage/innobase/trx/trx0undo.cc4
4 files changed, 36 insertions, 4 deletions
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index f77ef2e96e3..eaa887e04da 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -572,6 +572,33 @@ struct trx_rsegs_t {
trx_temp_undo_t m_noredo;
};
+/** Undo record information like rollback segment id, page_id, offset */
+struct trx_undo_rec_info
+{
+ const trx_t *trx;
+ buf_block_t *block;
+ ulint offset;
+ ulint type;
+ ulint cmpl_info;
+ bool updated_extern;
+ undo_no_t undo_no;
+ trx_undo_rec_t *undo_rec;
+ upd_t *update= nullptr;
+
+ trx_undo_rec_info(const trx_t *trx_, buf_block_t *block_,
+ ulint offset_):
+ trx(trx_), block(block_), offset(offset_) {}
+
+ void assign_value(ulint type_, ulint cmpl_info_, bool updated_ext,
+ undo_no_t undo_no_)
+ {
+ type= type_;
+ cmpl_info= cmpl_info_;
+ updated_extern= updated_ext;
+ undo_no= undo_no_;
+ }
+};
+
struct trx_t : ilist_node<>
{
private:
@@ -891,6 +918,7 @@ public:
LF_PINS *rw_trx_hash_pins;
ulint magic_n;
+ trx_undo_rec_info *rec_info= nullptr;
/** @return whether any persistent undo log has been generated */
bool has_logged_persistent() const
{
@@ -938,7 +966,7 @@ public:
inline bool rollback_finish();
private:
/** Apply any changes to tables for which online DDL is in progress. */
- ATTRIBUTE_COLD void apply_log() const;
+ ATTRIBUTE_COLD void apply_log();
/** Process tables that were modified by the committing transaction. */
inline void commit_tables();
/** Mark a transaction committed in the main memory data structures. */
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 2680f1c2513..125d74275d0 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -327,6 +327,7 @@ struct trx_undo_t {
segment are chained into lists */
};
+#if 0
/** Undo record information like rollback segment id, page_id, offset */
struct trx_undo_rec_info
{
@@ -353,7 +354,7 @@ struct trx_undo_rec_info
undo_no= undo_no_;
}
};
-
+#endif
#endif /* !UNIV_INNOCHECKSUM */
/** The offset of the undo log page header on pages of the undo log */
diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc
index 695c6dba472..207fd5594fd 100644
--- a/storage/innobase/row/row0vers.cc
+++ b/storage/innobase/row/row0vers.cc
@@ -192,7 +192,8 @@ row_vers_impl_x_locked_low(
trx_undo_prev_version_build(
clust_rec, mtr, version, clust_index, clust_offsets,
heap, &prev_version, NULL,
- dict_index_has_virtual(index) ? &vrow : NULL, 0);
+ dict_index_has_virtual(index) ? &vrow : NULL, 0,
+ caller_trx->rec_info);
ut_d(trx->mutex_lock());
const bool committed = trx_state_eq(
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index 17ea57c118d..cd307a22ff4 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -385,7 +385,7 @@ static void trx_undo_rec_apply_log(trx_undo_rec_t *rec,
/** Apply any changes to tables for which online DDL is in progress. */
-ATTRIBUTE_COLD void trx_t::apply_log() const
+ATTRIBUTE_COLD void trx_t::apply_log()
{
if (undo_no == 0 || apply_online_log == false)
return;
@@ -413,11 +413,13 @@ ATTRIBUTE_COLD void trx_t::apply_log() const
while (rec)
{
trx_undo_rec_info undo_rec_info(this, block, page_offset(rec));
+ rec_info= &undo_rec_info;
trx_undo_rec_apply_log(rec, online_log_tables, &undo_rec_info,
heap);
rec= trx_undo_page_get_next_rec(block, page_offset(rec),
page_id.page_no(),
undo->hdr_offset);
+ rec_info= nullptr;
}
uint32_t next= mach_read_from_4(TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE +