1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-02 14:22:51 +03:00

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
This commit is contained in:
Satya Bodapati
2013-01-28 20:13:44 +05:30
parent 3c5326f8cc
commit d63f54c67d

View File

@ -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);