[MDEV-24367] S3 Engine: delayed slave may stop with an error Created: 2020-12-08 Updated: 2020-12-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication, Storage Engine - S3 |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Michael Widenius |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | replication | ||
| Issue Links: |
|
||||
| Description |
|
(I am not sure if this property is a bug or a fundamental limitation. If it is a limitation, it's not documented, and we need to define this limitation) The issue: It is tempting to define the limitation as "For any dbname.tablename, you should decide beforehand what storage engine you're going to use, and only use that engine". The problem is that for S3 you can't do that - the only way to fill the S3 table is to create an Aria table (or other local table?) and then do "ALTER TABLE t ENGINE=S3". That is, it's unavoidable that t is a local table first, and then it's an S3 table. A testcase:
This will fail with:
SHOW SLAVE STATUS:
|
| Comments |
| Comment by Sergei Petrunia [ 2020-12-08 ] | ||||
|
One possible way to solve this: What if the table in S3 included a replication GTID value from the CREATE TABLE statement. Let it be CREATE_GTID. If the slave's current_GTID is before the CREATE_GTID, the slave cannot see the table. | ||||
| Comment by Sergei Petrunia [ 2020-12-09 ] | ||||
|
My recollection of monty's suggestion in the discussion yesterday: The described problem occurs due to the slave "seeing" the same table in both
The slave is applying the binlog which describes past operations on the local table (B) but it also can see the present remote table (A). The idea is: if the slave thread is about to create a local table and there is a naming conflict with a remote table, it should "hide" the remote table by deleting its .frm file. This should be only allowed to happen when the thread creating the local table is a replication slave thread. (We don't want a regular user to be able to do create table t (...) engine=myisam and silently hide the remote table t with it. This is error-prone.) Things to check: are we sure there's no situation where the server discovers that the table exists in both engines and raises an error condition? | ||||
| Comment by Sergei Petrunia [ 2020-12-09 ] | ||||
|
A possible workaround is:
That is, the workflow should be like:
|