Bug #46588 | Backup fails to return ER_BACKUP_CONTEXT_CREATE | ||
---|---|---|---|
Submitted: | 6 Aug 2009 19:43 | Modified: | 28 Oct 2009 22:22 |
Reporter: | Chuck Bell | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 5.4.4 | OS: | Any |
Assigned to: | Rafal Somla | CPU Architecture: | Any |
[6 Aug 2009 19:43]
Chuck Bell
[7 Aug 2009 14:44]
Chuck Bell
Cannot repeat using latest team tree.
[20 Aug 2009 17:02]
Chuck Bell
Reopened because the problem has reoccurred.
[24 Sep 2009 13:38]
Rafal Somla
REFINED PROBLEM DESCRIPTION The code path forced by the above test violates assumption that backup::Logger reporting methods are called only when logger instance is initialized (after a call to Logger::init()). This happens, because in the test scenario the Backup_restore_ctx instance is destroyed before a call to Backup_restore_ctx::prepare_for_{backup,restore}() methods, where logger is initialized. In the destructor, method Backup_restore_ctx::close() calls fatal_error() (kernel.cc:1204) which then calls Logger::report_state(BUP_ERRORS) (backup_kernel.h:265). This is invalid if logger was not initialized and leads to assertion failure. PROPOSED SOLUTION In Backup_restore_ctx::close() call Logger::report_state() only if logger has been initialized. That is, only if the context object is in state PREPARED_FOR_BACKUP or PREPARED_FOR_RESTORE.
[24 Sep 2009 14:41]
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/84518 2873 Rafal Somla 2009-09-24 Bug#46588 - Backup fails to return ER_BACKUP_CONTEXT_CREATE The problem was that a call to Logger::report_state(BUP_ERRORS) inside Backup_restore_ctx::close() could happen before BACKUP or RESTORE operation has started and the logger has been initialized. This patch adds a guard to the report_state() call so that it is done only when the logger has been initialized. @ mysql-test/suite/backup/t/backup_errors_debug_2.test - Re-enable test cases which previously lead to crash. @ sql/backup/backup_kernel.h - Call report_state() in Backup_restore_ctx::close() only when logger is initialized.
[25 Sep 2009 8:30]
Ingo Strüwing
Looks fine. Approved.
[25 Sep 2009 16:18]
Rafal Somla
Pushed to team 6.0-backup tree. revision-id:rafal.somla@sun.com-20090924144008-vor3rdlbwfmfnhg7
[25 Oct 2009 13:38]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091025133616-ca4inerav4vpdnaz) (version source revid:ingo.struewing@sun.com-20090928125502-9t9uqhzsp87vmgnx) (merge vers: 6.0.14-alpha) (pib:13)
[28 Oct 2009 22:22]
Paul DuBois
Noted in 6.0.14 changelog. If a context object creation failed, BACKUP DATABASE crashed rather than handling the error.