Bug #36323 The build-in backup/restore drivers should support cancel() API call
Submitted: 24 Apr 2008 17:23 Modified: 11 Aug 2008 23:54
Reporter: Rafal Somla Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0-backup OS:Any
Assigned to: Chuck Bell CPU Architecture:Any

[24 Apr 2008 17:23] Rafal Somla
Description:
A backup/restore driver should implement cancel() method which is used by backup kernel to cancel ongoing backup/restore operation. This method should cleanly interrupt ongoing operation and shut down the driver. 

In case of the built-in drivers which spawn a separate table locking thread and initialize read operation for a table, these preparations should be reversed if cancel() is called. None of these is done by the current implementation of cancel() and that should be fixed.

When implementing cancel() method, take into account these properties of the kernel/driver protocol:

- Driver should be ready to receive cancel() request at any moment after its initialization with begin(). 

- Normally, begin() is paired with a call to end(). If cancel() is called then it replaces the end() call:

- After a call to driver's end() or cancel() method, no other methods will be invoked by the backup kernel, except for free() which is called to destroy driver's instance.

- cancel() can return ERROR, in which case backup kernel will report problem and assume that driver is in error state. However, it will still call free() to destroy driver instance.

How to repeat:
Code inspection (backup/be_default.cc)
[5 May 2008 19:20] Chuck Bell
Patch ready for review.

http://lists.mysql.com/commits/46366
[14 May 2008 14: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/46693

ChangeSet@1.2613, 2008-05-14 10:10:27-04:00, cbell@mysql_cab_desk. +4 -0
  BUG#36323 : The build-in backup/restore drivers should support cancel()
API call
  
  Patch changes default drivers to allow cancel operation in middle of
  operation. Also allows for better cleanup in event of an error in the
  driver.
[14 May 2008 14:12] Chuck Bell
New patch ready for review.

http://lists.mysql.com/commits/46693
[12 Jun 2008 17:44] 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/47807

2634 Chuck Bell	2008-06-12
      BUG#36323 : The build-in backup/restore drivers should support cancel() API call
        
      Patch changes default drivers to allow cancel operation in middle of
      operation. Also allows for better cleanup in event of an error in the
      driver.
[12 Jun 2008 17:45] 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/47808

2634 Chuck Bell	2008-06-12
      BUG#36323 : The build-in backup/restore drivers should support cancel() API call
        
      Patch changes default drivers to allow cancel operation in middle of
      operation. Also allows for better cleanup in event of an error in the
      driver.
[12 Jun 2008 17:52] 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/47809

2634 Chuck Bell	2008-06-12
      BUG#36323 : The build-in backup/restore drivers should support cancel() API call
        
      Patch changes default drivers to allow cancel operation in middle of
      operation. Also allows for better cleanup in event of an error in the
      driver.
[12 Jun 2008 18:05] Chuck Bell
Patch queued. Note: had to convert patch to BZR (was BK). Commit email is here:

http://lists.mysql.com/commits/47808
[8 Aug 2008 16:31] Chuck Bell
Fix was pushed into 6.0.6.
[11 Aug 2008 23:54] Paul DuBois
Noted in 6.0.6 changelog.

The default drivers for BACKUP DATABASE and RESTORE now support a
cancel operation, which also allows better cleanup if a driver error
occurs.
[13 Sep 2008 19:47] Bugs System
Pushed into 6.0.6-alpha  (revid:cbell@mysql.com-20080612174347-wm20vgf0zcbh2xc2) (version source revid:sergefp@mysql.com-20080611231653-nmuqmw6dedjra79i) (pib:3)