Skip to content

Commit f41a41f

Browse files
committed
Merge branch 'merge-xtradb-5.5' into 5.5
2 parents 82e9f6d + db79f4c commit f41a41f

File tree

7 files changed

+109
-26
lines changed

7 files changed

+109
-26
lines changed

storage/xtradb/dict/dict0dict.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,8 +2668,9 @@ dict_foreign_remove_from_cache(
26682668
const ib_rbt_node_t* node
26692669
= rbt_lookup(rbt, foreign->id);
26702670

2671-
if (node) {
2672-
dict_foreign_t* val = *(dict_foreign_t**) node->value;
2671+
if (node != NULL) {
2672+
dict_foreign_t* val
2673+
= *(dict_foreign_t**) node->value;
26732674

26742675
if (val == foreign) {
26752676
rbt_delete(rbt, foreign->id);
@@ -2690,8 +2691,9 @@ dict_foreign_remove_from_cache(
26902691
const ib_rbt_node_t* node
26912692
= rbt_lookup(rbt, foreign->id);
26922693

2693-
if (node) {
2694-
dict_foreign_t* val = *(dict_foreign_t**) node->value;
2694+
if (node != NULL) {
2695+
dict_foreign_t* val
2696+
= *(dict_foreign_t**) node->value;
26952697

26962698
if (val == foreign) {
26972699
rbt_delete(rbt, foreign->id);

storage/xtradb/include/row0purge.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
3+
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -111,6 +111,17 @@ struct purge_node_struct{
111111
purge of a row */
112112
};
113113

114+
#ifdef UNIV_DEBUG
115+
/***********************************************************//**
116+
Validate the persisent cursor in the purge node. The purge node has two
117+
references to the clustered index record - one via the ref member, and the
118+
other via the persistent cursor. These two references must match each
119+
other if the found_clust flag is set.
120+
@return true if the persistent cursor is consistent with the ref member.*/
121+
ibool
122+
row_purge_validate_pcur(purge_node_t* node);
123+
#endif /* UNIV_DEBUG */
124+
114125
#ifndef UNIV_NONINL
115126
#include "row0purge.ic"
116127
#endif

storage/xtradb/include/srv0srv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ extern ulong srv_ibuf_active_contract;
270270
extern ulong srv_ibuf_accel_rate;
271271
extern ulint srv_checkpoint_age_target;
272272
extern ulong srv_flush_neighbor_pages;
273-
extern ulint srv_deprecated_enable_unsafe_group_commit;
274273
extern ulong srv_read_ahead;
275274
extern ulong srv_adaptive_flushing_method;
276275

storage/xtradb/include/univ.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */
6464
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
6565

6666
#ifndef PERCONA_INNODB_VERSION
67-
#define PERCONA_INNODB_VERSION 37.3
67+
#define PERCONA_INNODB_VERSION 37.4
6868
#endif
6969

70-
#define INNODB_VERSION_STR "5.5.44-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
70+
#define INNODB_VERSION_STR "5.5.45-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
7171

7272
#define REFMAN "http://dev.mysql.com/doc/refman/" \
7373
IB_TO_STR(MYSQL_MAJOR_VERSION) "." \

storage/xtradb/os/os0file.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************************
22
3-
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
3+
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2009, Percona Inc.
55
66
Portions of this file contain modifications contributed and copyrighted
@@ -1376,16 +1376,19 @@ os_file_create_simple_no_error_handling_func(
13761376
#else /* __WIN__ */
13771377
os_file_t file;
13781378
int create_flag;
1379+
const char* mode_str = NULL;
13791380

13801381
ut_a(name);
13811382

13821383
if (create_mode == OS_FILE_OPEN) {
1384+
mode_str = "OPEN";
13831385
if (access_type == OS_FILE_READ_ONLY) {
13841386
create_flag = O_RDONLY;
13851387
} else {
13861388
create_flag = O_RDWR;
13871389
}
13881390
} else if (create_mode == OS_FILE_CREATE) {
1391+
mode_str = "CREATE";
13891392
create_flag = O_RDWR | O_CREAT | O_EXCL;
13901393
} else {
13911394
create_flag = 0;
@@ -1410,6 +1413,14 @@ os_file_create_simple_no_error_handling_func(
14101413
#endif
14111414
} else {
14121415
*success = TRUE;
1416+
1417+
/* This function is always called for data files, we should
1418+
disable OS caching (O_DIRECT) here as we do in
1419+
os_file_create_func(), so we open the same file in the same
1420+
mode, see man page of open(2). */
1421+
if (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
1422+
os_file_set_nocache(file, name, mode_str);
1423+
}
14131424
}
14141425

14151426
return(file);

storage/xtradb/row/row0purge.c

Lines changed: 77 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -43,6 +43,7 @@ Created 3/14/1997 Heikki Tuuri
4343
#include "row0vers.h"
4444
#include "row0mysql.h"
4545
#include "log0log.h"
46+
#include "rem0cmp.h"
4647

4748
/*************************************************************************
4849
IMPORTANT NOTE: Any operation that generates redo MUST check that there
@@ -80,7 +81,7 @@ row_purge_node_create(
8081

8182
/***********************************************************//**
8283
Repositions the pcur in the purge node on the clustered index record,
83-
if found.
84+
if found. If the record is not found, close pcur.
8485
@return TRUE if the record was found */
8586
static
8687
ibool
@@ -90,23 +91,28 @@ row_purge_reposition_pcur(
9091
purge_node_t* node, /*!< in: row purge node */
9192
mtr_t* mtr) /*!< in: mtr */
9293
{
93-
ibool found;
94-
9594
if (node->found_clust) {
96-
found = btr_pcur_restore_position(mode, &(node->pcur), mtr);
95+
ut_ad(row_purge_validate_pcur(node));
9796

98-
return(found);
99-
}
97+
node->found_clust = btr_pcur_restore_position(
98+
mode, &(node->pcur), mtr);
99+
100+
} else {
101+
102+
node->found_clust = row_search_on_row_ref(
103+
&(node->pcur), mode, node->table, node->ref, mtr);
100104

101-
found = row_search_on_row_ref(&(node->pcur), mode, node->table,
102-
node->ref, mtr);
103-
node->found_clust = found;
105+
if (node->found_clust) {
106+
btr_pcur_store_position(&(node->pcur), mtr);
107+
}
108+
}
104109

105-
if (found) {
106-
btr_pcur_store_position(&(node->pcur), mtr);
110+
/* Close the current cursor if we fail to position it correctly. */
111+
if (!node->found_clust) {
112+
btr_pcur_close(&node->pcur);
107113
}
108114

109-
return(found);
115+
return(node->found_clust);
110116
}
111117

112118
/***********************************************************//**
@@ -143,8 +149,8 @@ row_purge_remove_clust_if_poss_low(
143149

144150
if (!success) {
145151
/* The record is already removed */
146-
147-
btr_pcur_commit_specify_mtr(pcur, &mtr);
152+
/* Persistent cursor is closed if reposition fails. */
153+
mtr_commit(&mtr);
148154

149155
return(TRUE);
150156
}
@@ -258,7 +264,12 @@ row_purge_poss_sec(
258264
btr_pcur_get_rec(&node->pcur),
259265
&mtr, index, entry);
260266

261-
btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
267+
/* Persistent cursor is closed if reposition fails. */
268+
if (node->found_clust) {
269+
btr_pcur_commit_specify_mtr(&node->pcur, &mtr);
270+
} else {
271+
mtr_commit(&mtr);
272+
}
262273

263274
return(can_delete);
264275
}
@@ -806,3 +817,53 @@ row_purge_step(
806817

807818
return(thr);
808819
}
820+
821+
#ifdef UNIV_DEBUG
822+
/***********************************************************//**
823+
Validate the persisent cursor in the purge node. The purge node has two
824+
references to the clustered index record - one via the ref member, and the
825+
other via the persistent cursor. These two references must match each
826+
other if the found_clust flag is set.
827+
@return true if the stored copy of persistent cursor is consistent
828+
with the ref member.*/
829+
ibool
830+
row_purge_validate_pcur(
831+
purge_node_t* node)
832+
{
833+
dict_index_t* clust_index;
834+
ulint* offsets;
835+
int st;
836+
837+
if (!node->found_clust) {
838+
return(TRUE);
839+
}
840+
841+
if (node->index == NULL) {
842+
return(TRUE);
843+
}
844+
845+
if (node->pcur.old_stored != BTR_PCUR_OLD_STORED) {
846+
return(TRUE);
847+
}
848+
849+
clust_index = node->pcur.btr_cur.index;
850+
851+
offsets = rec_get_offsets(node->pcur.old_rec, clust_index, NULL,
852+
node->pcur.old_n_fields, &node->heap);
853+
854+
/* Here we are comparing the purge ref record and the stored initial
855+
part in persistent cursor. Both cases we store n_uniq fields of the
856+
cluster index and so it is fine to do the comparison. We note this
857+
dependency here as pcur and ref belong to different modules. */
858+
st = cmp_dtuple_rec(node->ref, node->pcur.old_rec, offsets);
859+
860+
if (st != 0) {
861+
fprintf(stderr, "Purge node pcur validation failed\n");
862+
dtuple_print(stderr, node->ref);
863+
rec_print(stderr, node->pcur.old_rec, clust_index);
864+
return(FALSE);
865+
}
866+
867+
return(TRUE);
868+
}
869+
#endif /* UNIV_DEBUG */

storage/xtradb/srv/srv0srv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ UNIV_INTERN ulong srv_ibuf_accel_rate = 100;
438438
UNIV_INTERN ulint srv_checkpoint_age_target = 0;
439439
UNIV_INTERN ulong srv_flush_neighbor_pages = 1; /* 0:disable 1:area 2:contiguous */
440440

441-
UNIV_INTERN ulint srv_deprecated_enable_unsafe_group_commit = 0;
442441
UNIV_INTERN ulong srv_read_ahead = 3; /* 1: random 2: linear 3: Both */
443442
UNIV_INTERN ulong srv_adaptive_flushing_method = 0; /* 0: native 1: estimate 2: keep_average */
444443

0 commit comments

Comments
 (0)