Bug #35585 Online backup: Apparent synonyms for binlog start_position
Submitted: 26 Mar 2008 21:28 Modified: 29 Jun 2009 15:44
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.5-alpha-debug-log OS:Linux (SUSE 10 | 32-bit)
Assigned to: Chuck Bell CPU Architecture:Any

[26 Mar 2008 21:28] Peter Gulutzan
Description:
I'm using mysql-6.0-backup.

Most people have heard of the binlog start position
because it's used for "mysqlbinlog --start-position=N".

But there appear to be some alternate terms:

1. Just "position", without explanation that it is "start position".
For example the MySQL Reference Manual has
"Read_Master_Log_Pos The position up to which the I/O thread has
read in the current master binary log."
http://dev.mysql.com/doc/refman/6.0/en/show-slave-status.html

2. SHOW BINLOG EVENTS has five components: Log_name, Pos,
Event_type, Server_id, End_log_pos, Info. It seems that the
binlog start position in this case is not 'Pos' but
'End_log_pos', although the documentation doesn't say so.
http://dev.mysql.com/doc/refman/6.0/en/show-binlog-events.html

3. In sql/log.cc and sql/sql_repl.cc and backup/data_backup.cc
it's "binlog position".

4. In sql/rpl_injector.h it's "binlog_pos".

This has now become important because online backup has a new
column named binlog_pos in mysql.online_backup.

I believe "binlog start position" is correct and that use of
alternate terms merely causes confusion if they're the same thing.

How to repeat:
mysql> backup database * to '*' ;
+-----------+
| backup_id |
+-----------+
| 1         |
+-----------+
1 row in set (0.67 sec)

mysql> select * from mysql.online_backup\G
*************************** 1. row ***************************
          backup_id: 1
         process_id: 0
         binlog_pos: 194
        binlog_file: /tmp/tmp5.000001
       backup_state: complete
          operation: backup
          error_num: 0
        num_objects: 4
        total_bytes: 1
validity_point_time: 2008-03-26 21:24:54
         start_time: 2008-03-26 21:24:54
          stop_time: 2008-03-26 21:24:55
host_or_server_name: localhost
           username: root
        backup_file: *
       user_comment:
            command: backup database * to '*'
            engines: Snapshot, Default
1 row in set (0.00 sec)
[27 Mar 2008 12:02] MySQL Verification Team
Thank you for the bug report.
[13 May 2009 19:59] Chuck Bell
The solution to this bug shall concentrate solely on the MySQL Backup code and shall not change anything to do with the server and related code. For the backup code, tests, and logs, all 'backup_pos[..]' that reference the binlog start position shall become 'backup_start_pos'. In addition, code, tests, and logs that use 'binlog_pos' to refer to both the binlog file and binlog start position shall become 'binlog_info'.
[13 May 2009 20:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/73974

2810 Chuck Bell	2009-05-13
      BUG#35585 : Online backup: Apparent synonyms for binlog start_position
      
      There are synonyms used in the backup code, tests, and logs 
      that refer to the binlog start position as 'binlog_pos'. This
      is confusing and should be changed to match the documentation
      and general practice of replication and binary logs.
      
      This patch changes the backup code, tests, and logs such that
      all 'backup_pos[..]' that reference the binlog start position 
      have been changed to 'backup_start_pos' and where 'binlog_pos' 
      is used to refer to both the binlog file and binlog start 
      position have been changed to 'binlog_info'.
      modified:
        client/backup_stream.c
        client/mysqlbackup.cc
        mysql-test/suite/backup/r/backup.result
        mysql-test/suite/backup/r/backup_logs.result
        mysql-test/suite/backup/t/backup.test
        mysql-test/suite/backup_ptr/r/backup_ptr_commits.result
        mysql-test/suite/backup_ptr/t/backup_ptr.test
        mysql-test/suite/backup_ptr/t/backup_ptr_commits.test
        mysql-test/suite/backup_ptr/t/backup_ptr_objects.test
        mysql-test/suite/rpl/r/rpl_backup_extra.result
        mysql-test/suite/rpl/t/rpl_backup_extra.test
        mysql-test/suite/rpl/t/rpl_backup_ptr.test
        scripts/mysql_system_tables.sql
        scripts/mysql_system_tables_fix.sql
        sql/backup/data_backup.cc
        sql/backup/image_info.cc
        sql/backup/image_info.h
        sql/backup/kernel.cc
        sql/backup/logger.h
        sql/backup/stream_v1.c
        sql/backup/stream_v1.h
        sql/log.cc
        sql/log.h
        sql/si_logs.cc
        sql/si_logs.h
[19 May 2009 13:31] Ingo Strüwing
Umpf, I meant to switch it "in-review" as the second reviewer did not yet look at it. OTOH, the patch consists of renaming only. No functional change, so one review might be sufficient. I leave it to Chuck, to decide if to switch it back to "in-review", or accept a sinlge approval.
[20 May 2009 18:04] Jørgen Løland
Good to push
[21 May 2009 13:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74703

2704 Chuck Bell	2009-05-21
      BUG#35585 : Online backup: Apparent synonyms for binlog start_position
      
      There are synonyms used in the backup code, tests, and logs 
      that refer to the binlog start position as 'binlog_pos'. This
      is confusing and should be changed to match the documentation
      and general practice of replication and binary logs.
      
      This patch changes the backup code, tests, and logs such that
      all 'backup_pos[..]' that reference the binlog start position 
      have been changed to 'backup_start_pos' and where 'binlog_pos' 
      is used to refer to both the binlog file and binlog start 
      position have been changed to 'binlog_info'.
      modified:
        client/backup_stream.c
        client/mysqlbackup.cc
        mysql-test/suite/backup/r/backup.result
        mysql-test/suite/backup/r/backup_logs.result
        mysql-test/suite/backup/t/backup.test
        mysql-test/suite/backup_ptr/r/backup_ptr_commits.result
        mysql-test/suite/backup_ptr/t/backup_ptr.test
        mysql-test/suite/backup_ptr/t/backup_ptr_commits.test
        mysql-test/suite/backup_ptr/t/backup_ptr_objects.test
        mysql-test/suite/rpl/r/rpl_backup_extra.result
        mysql-test/suite/rpl/t/rpl_backup_extra.test
        mysql-test/suite/rpl/t/rpl_backup_ptr.test
        scripts/mysql_system_tables.sql
        scripts/mysql_system_tables_fix.sql
        sql/backup/data_backup.cc
        sql/backup/image_info.cc
        sql/backup/image_info.h
        sql/backup/kernel.cc
        sql/backup/logger.h
        sql/backup/stream_v1.c
        sql/backup/stream_v1.h
        sql/log.cc
        sql/log.h
        sql/si_logs.cc
        sql/si_logs.h
[26 May 2009 20:00] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74981

2812 Chuck Bell	2009-05-26
      BUG#35585 : Synonyms for backup start position
      
      This patch corrects a result file issue in PB after the push of 
      this bug fix.
      modified:
        mysql-test/suite/funcs_1/r/is_columns_mysql.result
[29 Jun 2009 14:54] Chuck Bell
Pushed to 5.4.4. on 25 June.
[29 Jun 2009 15:44] Paul DuBois
No changelog entry needed. Not in any released version.