summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatya Bodapati <satya.bodapati@oracle.com>2013-01-28 20:13:44 +0530
committerSatya Bodapati <satya.bodapati@oracle.com>2013-01-28 20:13:44 +0530
commit3d2a741a98782a6bca7ff2a76403901e49c36325 (patch)
tree58a5704ca2b006f65cb5cd061c2bc4918b3377df
parent2eb4b3be7c4ecc005dac3ffd2f9391b77d656662 (diff)
downloadmariadb-git-3d2a741a98782a6bca7ff2a76403901e49c36325.tar.gz
Bug#16183892 - INNODB PURGE BUFFERING IS NOT CRASH-SAFE
With innodb_change_buffering enabled, Innodb buffers all modifications to secondary index leaf pages when the leaf pages are not in buffer pool. Crash InnoDB while an IBUF_OP_DELETE is being applied. Restart and note that the same record can be applied again which may lead to crash. Mark the change buffer record processed, so that it will not be merged again in case the server crashes between the following mtr_commit() and the subsequent mtr_commit() of deleting the change buffer record. Testcase: No testcase because it is difficult to get the timing right with the two asyncronous task purge and change buffering Approved by Marko. rb#1893
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 70af56b99f2..11505121fa2 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -4685,6 +4685,16 @@ loop:
== page_no);
ut_ad(ibuf_rec_get_space(&mtr, rec) == space);
+ /* Mark the change buffer record processed,
+ so that it will not be merged again in case
+ the server crashes between the following
+ mtr_commit() and the subsequent mtr_commit()
+ of deleting the change buffer record. */
+
+ btr_cur_set_deleted_flag_for_ibuf(
+ btr_pcur_get_rec(&pcur), NULL,
+ TRUE, &mtr);
+
btr_pcur_store_position(&pcur, &mtr);
ibuf_btr_pcur_commit_specify_mtr(&pcur, &mtr);