summaryrefslogtreecommitdiff
path: root/storage/xtradb/mtr
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2009-08-03 22:09:53 +0200
committerunknown <knielsen@knielsen-hq.org>2009-08-03 22:09:53 +0200
commitcb6a28aaf9acbaca39ff1ebc983f2b1058a4f585 (patch)
tree6736fb670438aa39f253531bb35dc425cae2a993 /storage/xtradb/mtr
parente84748406cac825127279a16482756539267ec17 (diff)
parent237485ccd692cb3df5bac1ac74a00487f42bf93d (diff)
downloadmariadb-git-cb6a28aaf9acbaca39ff1ebc983f2b1058a4f585.tar.gz
Merge XtraDB 6 into MariaDB.
Diffstat (limited to 'storage/xtradb/mtr')
-rw-r--r--storage/xtradb/mtr/mtr0mtr.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/storage/xtradb/mtr/mtr0mtr.c b/storage/xtradb/mtr/mtr0mtr.c
index 881751b560e..703f9b18eed 100644
--- a/storage/xtradb/mtr/mtr0mtr.c
+++ b/storage/xtradb/mtr/mtr0mtr.c
@@ -102,6 +102,38 @@ mtr_memo_pop_all(
}
}
+UNIV_INLINE
+void
+mtr_memo_note_modification_all(
+/*===========================*/
+ mtr_t* mtr) /* in: mtr */
+{
+ mtr_memo_slot_t* slot;
+ dyn_array_t* memo;
+ ulint offset;
+
+ ut_ad(mtr);
+ ut_ad(mtr->magic_n == MTR_MAGIC_N);
+ ut_ad(mtr->state == MTR_COMMITTING); /* Currently only used in
+ commit */
+ ut_ad(mtr->modifications);
+
+ memo = &(mtr->memo);
+
+ offset = dyn_array_get_data_size(memo);
+
+ while (offset > 0) {
+ offset -= sizeof(mtr_memo_slot_t);
+ slot = dyn_array_get_element(memo, offset);
+
+ if (UNIV_LIKELY(slot->object != NULL) &&
+ slot->type == MTR_MEMO_PAGE_X_FIX) {
+ buf_flush_note_modification(
+ (buf_block_t*)slot->object, mtr);
+ }
+ }
+}
+
/****************************************************************
Writes the contents of a mini-transaction log, if any, to the database log. */
static
@@ -180,6 +212,8 @@ mtr_commit(
if (write_log) {
mtr_log_reserve_and_write(mtr);
+
+ mtr_memo_note_modification_all(mtr);
}
/* We first update the modification info to buffer pages, and only
@@ -190,12 +224,13 @@ mtr_commit(
required when we insert modified buffer pages in to the flush list
which must be sorted on oldest_modification. */
- mtr_memo_pop_all(mtr);
-
if (write_log) {
log_release();
}
+ /* All unlocking has been moved here, after log_sys mutex release. */
+ mtr_memo_pop_all(mtr);
+
ut_d(mtr->state = MTR_COMMITTED);
dyn_array_free(&(mtr->memo));
dyn_array_free(&(mtr->log));
@@ -263,6 +298,12 @@ mtr_memo_release(
slot = dyn_array_get_element(memo, offset);
if ((object == slot->object) && (type == slot->type)) {
+ if (mtr->modifications &&
+ UNIV_LIKELY(slot->object != NULL) &&
+ slot->type == MTR_MEMO_PAGE_X_FIX) {
+ buf_flush_note_modification(
+ (buf_block_t*)slot->object, mtr);
+ }
mtr_memo_slot_release(mtr, slot);