• Nikita Malyavin's avatar
    MDEV-31646 Online alter applies binlog cache limit to cache writes · d5e59c98
    Nikita Malyavin authored
    1. Make online disk writes unlimited, same as filesort does.
    2. Make proper error handling -- in 32-bit build IO_CACHE capacity limit is
    4GB, so it is quite possible to overfill there.
    3. Event_log::write_cache complicated with event reparsing, and as it was
    proven by QA, contains some mistakes. Rewrite introbuce a simpler and much
    faster version, not featuring reparsing and therefore copying a whole
    buffer at once. This also disables checksums and crypto.
    4. Handle read_log_event errors correctly: error returned is -1 (eof
    signal for alter table), and my_error is not called. Call my_error and
    always return 1. There's no test for this, since it shouldn't happen,
    see the next bullet.
    5. An event could be written partially in case of error, if it's bigger
    than the IO_CACHE buffer. Restore the position where it was before the
    error was emitted.
    
    As a result, online alter is untied of several binlog variables, which was
    a second aim of this patch.
    d5e59c98
sql_table.cc 430 KB