• Monty's avatar
    MDEV-23691 S3 storage engine: delayed slave can drop the table · 71d263a1
    Monty authored
    This commit fixed the problems with S3 after the "DROP TABLE FORCE" changes.
    It also fixes all failing replication S3 tests.
    
    A slave is delayed if it is trying to execute replicated queries on a
    table that is already converted to S3 by the master later in the binlog.
    
    Fixes for replication events on S3 tables for delayed slaves:
    - INSERT and INSERT ... SELECT and CREATE TABLE are ignored but written
      to the binary log.   UPDATE & DELETE will be fixed in a future commit.
    
    Other things:
    - On slaves with --s3-slave-ignore-updates set, allow S3 tables to be
      opened in read-write mode. This was done to be able to
      ignore-but-replicate queries like insert.  Without this change any
      open of an S3 table failed with 'Table is read only' which is too
      early to be able to replicate the original query.
    - Errors are now printed if handler::extra() call fails in
      wait_while_tables_are_used().
    - Error message for row changes are changed from HA_ERR_WRONG_COMMAND
      to HA_ERR_TABLE_READONLY.
    - Disable some maria_extra() calls for S3 tables. This could cause
      S3 tables to fail in some cases.
    - Added missing thr_lock_delete() to ma_open() in case of failure.
    - Removed from mysql_prepare_insert() the not needed argument 'table'.
    71d263a1
log.cc 332 KB