MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:April 22 2010 9:56am
Subject:bzr commit into mysql-6.0-backup branch (Rafal.Somla:2949)
View as plain text  
#At file:///ext/mysql/bzr/backup/native-innodb/ based on revid:rafal.somla@stripped

 2949 Rafal Somla	2010-04-22
      Fixing VP creation code. Now, the lsn of VPN is not read from disk,
      but taken from intenral innodb structures. Also, it was wrong to
      assume that at VP we need to take last checkpoint lsn. Instead, we
      just use the last lsn in the log.
     @ inb/backup.cc
        Read VP lsn from the internal innodb log structure.

    modified:
      inb/backup.cc
=== modified file 'inb/backup.cc'
--- a/inb/backup.cc	2010-04-22 08:05:22 +0000
+++ b/inb/backup.cc	2010-04-22 09:55:57 +0000
@@ -70,50 +70,6 @@ inb::Backup_driver::Backup_driver(const 
 static char name_buf[5000];
 
 
-static
-void
-back_read_cp_info(
-/*==============*/
-        const char *log_dir,
-        dulint*    lsn,            /* out: checkpoint lsn */
-        ulint*          offset,         /* out: checkpoint offset in
-                                        the log group */
-        ulint*          fsp_limit,      /* out: fsp limit */
-        dulint*    cp_no,          /* out: checkpoint number */
-        dulint*    first_header_lsn)/* out: lsn of the start of
-                                        the first log file in the log group */
-{
-        os_file_t       log_file;
-        ibool           success;
-        byte            buf[LOG_CHECKPOINT_2 + OS_FILE_LOG_BLOCK_SIZE];
-        //char            name[5000];
-
-        sprintf(name_buf, "%s%s%lu", log_dir, "ib_logfile", (ulint)0);
-
-        /* Read the log header info from the first log file */
-
-        log_file = os_file_create_simple(name_buf, OS_FILE_OPEN, OS_FILE_READ_ONLY,
-                                                                &success);
-        if (!success) {
-          assert(false);
-          return;
-        }
-        
-        os_file_read(log_file, buf, 0, 0,
-                               LOG_CHECKPOINT_2 + OS_FILE_LOG_BLOCK_SIZE);
-
-        success = recv_read_cp_info_for_backup(buf, lsn, offset, fsp_limit,
-                                               cp_no, first_header_lsn);
-
-        if (!success) {
-          assert(false);
-          return;
-        }
-
-        os_file_close(log_file);
-}
-
-
 result_t inb::Backup_driver::begin(size_t)
 {
   if (srv_file_per_table)
@@ -222,16 +178,8 @@ result_t inb::Backup_driver::lock()
 {
   msg("Creating VP");
 
-  ulint  dummy1, dummy2;
-  dulint dummy3, dummy4;
-
-  /* TODO: 
-     - back_read_cp_info() does disk I/O - this should not be done inside 
-       lock() method.
-     - proper VP creation in sync with innodb engine (read currnet cp from the
-       engine)
-  */
-  back_read_cp_info(m_log_dir, &m_vp_lsn, &dummy1, &dummy2, &dummy3, &dummy4);
+  // Save current lsn as VP lsn.
+  m_vp_lsn= log_sys->lsn;
   msg("  vp lsn is %lu, current lsn is %lu", m_vp_lsn.low, m_end_lsn.low);
   log_stage= FINI;      // send_log() method will finish copying of log records now.
   return OK;


Attachment: [text/bzr-bundle] bzr/rafal.somla@sun.com-20100422095557-sd0ap3dd5zc042pk.bundle
Thread
bzr commit into mysql-6.0-backup branch (Rafal.Somla:2949)Rafal Somla22 Apr