summaryrefslogtreecommitdiff
path: root/mysql-test/include/commit.inc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@oracle.com>2011-01-28 01:25:26 +0000
committerAlfranio Correia <alfranio.correia@oracle.com>2011-01-28 01:25:26 +0000
commit235e10d987222b8cc42e1f3a9a79834912d45026 (patch)
tree3bbd228f1d5957f2855d7ad8f532333f7ff6fb34 /mysql-test/include/commit.inc
parent9c2370c25adc30c5fae8ad8854b401275b033210 (diff)
downloadmariadb-git-235e10d987222b8cc42e1f3a9a79834912d45026.tar.gz
BUG#55675 rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle
There are two calls to read_log_event() on master in mysql_binlog_send(). Each call reads 19 bytes in this test case and the error of the second read_log_event() is reported to the slave. The second read_log_event() starts from position 94 (75 + 19) to 113 (75 + 19 + 19). Usually, there are two events in the binary log: . 0 - 3 - Header . 4 - 105 - Format Descriptor Event . 106 - 304 - Query Event and both reads fail because operations are reading from invalid positions as expected. However, mysql_binlog_send() does not use the same IO_CACHE that is used to write into binary log (i.e. mysql_bin_log.log_file) for the hot binary log. It opens the binary log file directly by calling open_binlog() and creates a separated IO_CACHE. So there is a possibly that after a master has flushed the binary log file, the content has been cached by the filesystem, and has not updated the disk file. If this happens, then a slave will only see part of the file, and thus the second read_log_event() will report event truncated error. To fix the problem, if the first read_log_event() has failed, we ensure that the second one will try to read from the same position.
Diffstat (limited to 'mysql-test/include/commit.inc')
0 files changed, 0 insertions, 0 deletions