diff options
author | Monty <monty@mariadb.org> | 2020-10-16 19:36:24 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-10-21 03:09:29 +0300 |
commit | 2c8c15483d15d7a8e5b266ffcfbe7cf3503949f9 (patch) | |
tree | 9d0df3420c6404f11539c66c68f623ad1c69ee59 /storage/maria | |
parent | 71d263a19891e0382d4eec4f3169a4968b032ead (diff) | |
download | mariadb-git-2c8c15483d15d7a8e5b266ffcfbe7cf3503949f9.tar.gz |
MDEV-23730 s3.replication_partition 'innodb,mix' segv
This failure was caused because of several bugs:
- Someone had removed s3-slave-ignore-updates=1 from slave.cnf, which
caused the slave to remove files that the master was working on.
- Bug in ha_partition::change_partitions() that didn't reset m_new_file
in case of errors. This caused crashes in ha_maria::extra() as the
maria handler was called on files that was already closed.
- In ma_pagecache there was a bug that when one got a read error one a
big block (s3 block), it left the flag PCBLOCK_BIG_READ on for the page
which cased an assert when the page where flushed.
- Flush all cached tables in case of ignored ALTER TABLE
Note that when merging code from 10.3, that fixes the partition bug, use
the code from this patch instead.
Changes to ma_pagecache.cc written or reviewed by Sanja
Diffstat (limited to 'storage/maria')
-rw-r--r-- | storage/maria/ma_pagecache.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 0a55018db0f..bf646115bd9 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -2810,7 +2810,7 @@ static void read_big_block(PAGECACHE *pagecache, if (block_to_read->status & PCBLOCK_ERROR) { /* We get first block with an error so all operation failed */ - goto error; + DBUG_VOID_RETURN; } if (block_to_read->status & PCBLOCK_BIG_READ) { @@ -2842,7 +2842,11 @@ static void read_big_block(PAGECACHE *pagecache, // page should be read by other thread DBUG_ASSERT(block->status & PCBLOCK_READ || block->status & PCBLOCK_ERROR); - DBUG_ASSERT(block->status & PCBLOCK_BIG_READ); + /* + It is possible that other thread already removed the flag (in + case of two threads waiting) but it will not make harm to try to + remove it even in that case. + */ block->status&= ~PCBLOCK_BIG_READ; // all is read => lets finish nice DBUG_ASSERT(block_to_read != block); @@ -2960,9 +2964,8 @@ static void read_big_block(PAGECACHE *pagecache, } pagecache->big_block_free(&data); - block_to_read->status&= ~PCBLOCK_BIG_READ; - end: + block_to_read->status&= ~PCBLOCK_BIG_READ; if (block_to_read != block) { remove_reader(block_to_read); |