Permalink
Browse files

BUG#21126772 VALGRIND FAILURE IN ENGINES/FUNCS SUITE

Problem :
---------
This is a regression of bug-19138298. During purge, if
btr_pcur_restore_position fails, we set found_clust to FALSE
so that it can find a possible clustered index record in future
calls for the same undo entry. This, however, overwrites the
old_rec_buf while initializing pcur again in next call.

The leak is reproducible in local environment and with the
test provided along with bug-19138298.

Solution :
----------
If btr_pcur_restore_position() fails close the cursor.

Reviewed-by: Marko Makela <Marko.Makela@oracle.com>
Reviewed-by: Annamalai Gurusami <Annamalai.Gurusami@oracle.com>

RB: 9074
  • Loading branch information...
Debarun Banerjee
Debarun Banerjee committed Jun 3, 2015
1 parent 50be523 commit 4b8304a9a41c8382d18e084608c33e5c27bec311
Showing with 14 additions and 4 deletions.
  1. +14 −4 storage/innobase/row/row0purge.c
@@ -80,7 +80,7 @@ row_purge_node_create(
/***********************************************************//**
Repositions the pcur in the purge node on the clustered index record,
if found.
if found. If the record is not found, close pcur.
@return TRUE if the record was found */
static
ibool
@@ -106,6 +106,11 @@ row_purge_reposition_pcur(
}
}
/* Close the current cursor if we fail to position it correctly. */
if (!node->found_clust) {
btr_pcur_close(&node->pcur);
}
return(node->found_clust);
}
@@ -143,8 +148,8 @@ row_purge_remove_clust_if_poss_low(
if (!success) {
/* The record is already removed */
btr_pcur_commit_specify_mtr(pcur, &mtr);
/* Persistent cursor is closed if reposition fails. */
mtr_commit(&mtr);
return(TRUE);
}
@@ -258,7 +263,12 @@ row_purge_poss_sec(
btr_pcur_get_rec(&node->pcur),
&mtr, index, entry);
btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
/* Persistent cursor is closed if reposition fails. */
if (node->found_clust) {
btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
} else {
mtr_commit(&mtr);
}
return(can_delete);
}

0 comments on commit 4b8304a

Please sign in to comment.