Commit 971cf595 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.6 into 10.11

parents 9ea7f712 71649b93
...@@ -5780,9 +5780,12 @@ DROP TABLE t1; ...@@ -5780,9 +5780,12 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM; CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('u1'),('u2'); INSERT INTO t1 VALUES ('u1'),('u2');
#Check and enable after fix MDEV-34895
--disable_ps2_protocol
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) ); SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
FLUSH TABLES; FLUSH TABLES;
SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) ); SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) );
--enable_ps2_protocol
# Cleanup # Cleanup
DROP TABLE t1; DROP TABLE t1;
......
--source include/no_valgrind_without_big.inc --source include/no_valgrind_without_big.inc
--source include/maybe_debug.inc
######## t/ddl_innodb.test ###### ######## t/ddl_innodb.test ######
# #
# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX # Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX
...@@ -34,6 +35,13 @@ if (!$run) ...@@ -34,6 +35,13 @@ if (!$run)
##### Some preparations needed for the ddl*.inc scripts ##### Some preparations needed for the ddl*.inc scripts
--source suite/stress/include/ddl.pre --source suite/stress/include/ddl.pre
if ($have_debug) {
--disable_query_log
SET @old_debug_dbug = @@global.debug_dbug;
SET DEBUG_DBUG="+d,ib_buf_create_intermittent_wait";
--enable_query_log
}
--source suite/stress/include/ddl1.inc --source suite/stress/include/ddl1.inc
--source suite/stress/include/ddl2.inc --source suite/stress/include/ddl2.inc
--source suite/stress/include/ddl3.inc --source suite/stress/include/ddl3.inc
...@@ -43,5 +51,11 @@ if (!$run) ...@@ -43,5 +51,11 @@ if (!$run)
--source suite/stress/include/ddl7.inc --source suite/stress/include/ddl7.inc
--source suite/stress/include/ddl8.inc --source suite/stress/include/ddl8.inc
if ($have_debug) {
--disable_query_log
SET @@global.debug_dbug = @old_debug_dbug;
--enable_query_log
}
##### Cleanup ##### Cleanup
--source suite/stress/include/ddl.cln --source suite/stress/include/ddl.cln
...@@ -3588,22 +3588,47 @@ static buf_block_t *buf_page_create_low(page_id_t page_id, ulint zip_size, ...@@ -3588,22 +3588,47 @@ static buf_block_t *buf_page_create_low(page_id_t page_id, ulint zip_size,
if (!mtr->have_x_latch(reinterpret_cast<const buf_block_t&>(*bpage))) if (!mtr->have_x_latch(reinterpret_cast<const buf_block_t&>(*bpage)))
{ {
const bool got= bpage->lock.x_lock_try(); /* Buffer-fix the block to prevent the block being concurrently freed
if (!got) after we release the buffer pool mutex. It should work fine with
concurrent load of the page (free on disk) to buffer pool due to
possible read ahead. After we find a zero filled page during load, we
call buf_pool_t::corrupted_evict, where we try to wait for all buffer
fixes to go away only after resetting the page ID and releasing the
page latch. */
auto state= bpage->fix();
DBUG_EXECUTE_IF("ib_buf_create_intermittent_wait",
{
static bool need_to_wait = false;
need_to_wait = !need_to_wait;
/* Simulate try lock failure in every alternate call. */
if (need_to_wait) {
goto must_wait;
}
});
if (!bpage->lock.x_lock_try())
{ {
#ifndef DBUG_OFF
must_wait:
#endif
mysql_mutex_unlock(&buf_pool.mutex); mysql_mutex_unlock(&buf_pool.mutex);
bpage->lock.x_lock(); bpage->lock.x_lock();
const page_id_t id{bpage->id()}; const page_id_t id{bpage->id()};
if (UNIV_UNLIKELY(id != page_id)) if (UNIV_UNLIKELY(id != page_id))
{ {
ut_ad(id.is_corrupted()); ut_ad(id.is_corrupted());
ut_ad(bpage->is_freed());
bpage->unfix();
bpage->lock.x_unlock(); bpage->lock.x_unlock();
goto retry; goto retry;
} }
mysql_mutex_lock(&buf_pool.mutex); mysql_mutex_lock(&buf_pool.mutex);
state= bpage->state();
ut_ad(!bpage->is_io_fixed(state));
ut_ad(bpage->buf_fix_count(state));
} }
auto state= bpage->fix();
ut_ad(state >= buf_page_t::FREED); ut_ad(state >= buf_page_t::FREED);
ut_ad(state < buf_page_t::READ_FIX); ut_ad(state < buf_page_t::READ_FIX);
......
...@@ -6387,7 +6387,7 @@ my_bool translog_write_record(LSN *lsn, ...@@ -6387,7 +6387,7 @@ my_bool translog_write_record(LSN *lsn,
struct st_translog_parts parts; struct st_translog_parts parts;
LEX_CUSTRING *part; LEX_CUSTRING *part;
int rc; int rc;
uint short_trid= trn->short_id; SHORT_TRANSACTION_ID short_trid= trn->short_id;
DBUG_ENTER("translog_write_record"); DBUG_ENTER("translog_write_record");
DBUG_PRINT("enter", ("type: %u (%s) ShortTrID: %u rec_len: %lu", DBUG_PRINT("enter", ("type: %u (%s) ShortTrID: %u rec_len: %lu",
(uint) type, log_record_type_descriptor[type].name, (uint) type, log_record_type_descriptor[type].name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment