Skip to content

Commit ed20e5b

Browse files
committed
After-merge fixes
1 parent 202316a commit ed20e5b

File tree

9 files changed

+70
-64
lines changed

9 files changed

+70
-64
lines changed

mysql-test/suite/galera_3nodes/disabled.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
GAL-501 : MDEV-24645 galera_3nodes.GAL-501 MTR failed: failed to open gcomm backend connection: 110
1414
GCF-354 : MDEV-25614 Galera test failure on GCF-354
15+
galera_2_cluster : MDEV-22195 temporarily disabled due to issues to be fixed with MDEV-22195
1516
galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster
1617
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
1718
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to server during query

storage/innobase/include/hash0hash.h

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2018, 2021, MariaDB Corporation.
4+
Copyright (c) 2018, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -29,8 +29,43 @@ Created 5/20/1997 Heikki Tuuri
2929
#include "ut0new.h"
3030

3131
struct hash_table_t;
32-
struct hash_cell_t{
33-
void* node; /*!< hash chain node, NULL if none */
32+
struct hash_cell_t
33+
{
34+
/** singly-linked, nullptr terminated list of hash buckets */
35+
void *node;
36+
37+
/** Append an element.
38+
@tparam T type of the element
39+
@param insert the being-inserted element
40+
@param next the next-element pointer in T */
41+
template<typename T>
42+
void append(T &insert, T *T::*next)
43+
{
44+
void **after;
45+
for (after= &node; *after;
46+
after= reinterpret_cast<void**>(&(static_cast<T*>(*after)->*next)));
47+
insert.*next= nullptr;
48+
*after= &insert;
49+
}
50+
51+
/** Insert an element after another.
52+
@tparam T type of the element
53+
@param after the element after which to insert
54+
@param insert the being-inserted element
55+
@param next the next-element pointer in T */
56+
template<typename T>
57+
void insert_after(T &after, T &insert, T *T::*next)
58+
{
59+
#ifdef UNIV_DEBUG
60+
for (const T *c= static_cast<const T*>(node); c; c= c->*next)
61+
if (c == &after)
62+
goto found;
63+
ut_error;
64+
found:
65+
#endif
66+
insert.*next= after.*next;
67+
after.*next= &insert;
68+
}
3469
};
3570

3671
/*******************************************************************//**
@@ -59,29 +94,6 @@ do {\
5994
}\
6095
} while (0)
6196

62-
/*******************************************************************//**
63-
Inserts a struct to the head of hash table. */
64-
65-
#define HASH_PREPEND(TYPE, NAME, TABLE, FOLD, DATA) \
66-
do { \
67-
hash_cell_t* cell3333; \
68-
TYPE* struct3333; \
69-
\
70-
(DATA)->NAME = NULL; \
71-
\
72-
cell3333 = &(TABLE)->array[(TABLE)->calc_hash(FOLD)]; \
73-
\
74-
if (cell3333->node == NULL) { \
75-
cell3333->node = DATA; \
76-
DATA->NAME = NULL; \
77-
} else { \
78-
struct3333 = (TYPE*) cell3333->node; \
79-
\
80-
DATA->NAME = struct3333; \
81-
\
82-
cell3333->node = DATA; \
83-
} \
84-
} while (0)
8597
#ifdef UNIV_HASH_DEBUG
8698
# define HASH_ASSERT_VALID(DATA) ut_a((void*) (DATA) != (void*) -1)
8799
# define HASH_INVALIDATE(DATA, NAME) *(void**) (&DATA->NAME) = (void*) -1

storage/innobase/include/lock0lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, 2021, MariaDB Corporation.
4+
Copyright (c) 2017, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

storage/innobase/include/lock0lock.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, 2021, MariaDB Corporation.
4+
Copyright (c) 2017, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

storage/innobase/include/lock0priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2015, 2021, MariaDB Corporation.
4+
Copyright (c) 2015, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

storage/innobase/include/lock0priv.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2018, 2021, MariaDB Corporation.
4+
Copyright (c) 2018, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

storage/innobase/include/trx0trx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2015, 2021, MariaDB Corporation.
4+
Copyright (c) 2015, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

storage/innobase/lock/lock0lock.cc

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,19 +1004,18 @@ static void lock_wait_wsrep(trx_t *trx)
10041004
/*********************************************************************//**
10051005
Checks if some other transaction has a conflicting explicit lock request
10061006
in the queue, so that we have to wait.
1007-
@return lock or NULL */
1008-
static
1009-
lock_t*
1010-
lock_rec_other_has_conflicting(
1011-
/*===========================*/
1012-
unsigned mode, /*!< in: LOCK_S or LOCK_X,
1013-
possibly ORed to LOCK_GAP or
1014-
LOC_REC_NOT_GAP,
1015-
LOCK_INSERT_INTENTION */
1016-
const hash_cell_t& cell, /*!< in: lock hash table cell */
1017-
const page_id_t id, /*!< in: page identifier */
1018-
ulint heap_no,/*!< in: heap number of the record */
1019-
const trx_t* trx) /*!< in: our transaction */
1007+
@param[in] mode LOCK_S or LOCK_X, possibly ORed to LOCK_GAP or LOC_REC_NOT_GAP,
1008+
LOCK_INSERT_INTENTION
1009+
@param[in] cell lock hash table cell
1010+
@param[in] id page identifier
1011+
@param[in] heap_no heap number of the record
1012+
@param[in] trx our transaction
1013+
@return conflicting lock and the flag which indicated if conflicting locks
1014+
which wait for the current transaction were ignored */
1015+
static lock_t *lock_rec_other_has_conflicting(unsigned mode,
1016+
const hash_cell_t &cell,
1017+
const page_id_t id,
1018+
ulint heap_no, const trx_t *trx)
10201019
{
10211020
bool is_supremum = (heap_no == PAGE_HEAP_NO_SUPREMUM);
10221021

@@ -1232,7 +1231,7 @@ lock_rec_create_low(
12321231
ut_ad(index->table->get_ref_count() || !index->table->can_be_evicted);
12331232

12341233
const auto lock_hash = &lock_sys.hash_get(type_mode);
1235-
HASH_INSERT(lock_t, hash, lock_hash, page_id.fold(), lock);
1234+
lock_hash->cell_get(page_id.fold())->append(*lock, &lock_t::hash);
12361235

12371236
if (type_mode & LOCK_WAIT) {
12381237
if (trx->lock.wait_trx) {
@@ -1258,7 +1257,6 @@ lock_rec_create_low(
12581257

12591258
/** Enqueue a waiting request for a lock which cannot be granted immediately.
12601259
Check for deadlocks.
1261-
@param[in] c_lock conflicting lock
12621260
@param[in] type_mode the requested lock mode (LOCK_S or LOCK_X)
12631261
possibly ORed with LOCK_GAP or
12641262
LOCK_REC_NOT_GAP, ORed with
@@ -1357,24 +1355,19 @@ on the record, and the request to be added is not a waiting request, we
13571355
can reuse a suitable record lock object already existing on the same page,
13581356
just setting the appropriate bit in its bitmap. This is a low-level function
13591357
which does NOT check for deadlocks or lock compatibility!
1360-
@return lock where the bit was set */
1358+
@param[in] type_mode lock mode, wait, gap etc. flags
1359+
@param[in,out] cell first hash table cell
1360+
@param[in] id page identifier
1361+
@param[in] page buffer block containing the record
1362+
@param[in] heap_no heap number of the record
1363+
@param[in] index index of record
1364+
@param[in,out] trx transaction
1365+
@param[in] caller_owns_trx_mutex TRUE if caller owns the transaction mutex */
13611366
TRANSACTIONAL_TARGET
1362-
static
1363-
void
1364-
lock_rec_add_to_queue(
1365-
/*==================*/
1366-
unsigned type_mode,/*!< in: lock mode, wait, gap
1367-
etc. flags */
1368-
hash_cell_t& cell, /*!< in,out: first hash table cell */
1369-
const page_id_t id, /*!< in: page identifier */
1370-
const page_t* page, /*!< in: buffer block containing
1371-
the record */
1372-
ulint heap_no,/*!< in: heap number of the record */
1373-
dict_index_t* index, /*!< in: index of record */
1374-
trx_t* trx, /*!< in/out: transaction */
1375-
bool caller_owns_trx_mutex)
1376-
/*!< in: TRUE if caller owns the
1377-
transaction mutex */
1367+
static void lock_rec_add_to_queue(unsigned type_mode, hash_cell_t &cell,
1368+
const page_id_t id, const page_t *page,
1369+
ulint heap_no, dict_index_t *index,
1370+
trx_t *trx, bool caller_owns_trx_mutex)
13781371
{
13791372
ut_d(lock_sys.hash_get(type_mode).assert_locked(id));
13801373
ut_ad(xtest() || caller_owns_trx_mutex == trx->mutex_is_owner());

storage/innobase/lock/lock0prdt.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2014, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2018, 2021, MariaDB Corporation.
4+
Copyright (c) 2018, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software

0 commit comments

Comments
 (0)