I have reviewed and run tests on this patch. It has been committed as 326824

Suresh Thalamati (JIRA) wrote:
     [ http://issues.apache.org/jira/browse/DERBY-239?page=all ]

Suresh Thalamati updated DERBY-239:
-----------------------------------

    Attachment: onlinebackup_1.diff


This patch adds some code necessary to support  real-time online backup that
does not block writes when database backup is in progress. All the current functional tests passed with these changes. It would be great if some can review and commit this patch.
This patch changes the way data segment and log is backed up without blocking
the writes.
Data Segment Backup:

   o  The containers to be backed up are found by scanning the files in seg0.
o Each container is backed up by reading all the pages through the page cache, and then writing to the backup container. Pages are latched while writing into the backup container. o Not necessary to backup containers in any particular order , All updates
      that happens after a container is backed will be redone using the
transaction log on restore.
  MT cases:
1) Each page is latched when it is written to the backup to prevent partial written pages sneaking into the backup. 2) Thread that is backing up the container will stop if another thread requests removal of the container when container is being backed up. 3) Truncate of the container blocks if the container is being backed up. 4) Partially created containers will not be backed up. Container cache will not return the container items until the creation is complete. (No changes are not for this case , that is how it currently works).
Transaction Log Backup:

    Transaction Log file  backup in two phases:
    1) First Check point info and the the log files are backed up before the
data segment. 2) After the data segment is backed up , all the log files that are generated after tha backup started are also copied into the backup.
  MT cases:
      1) If there is a checkpoint in progress, backup will wait for the
       checkpoint to complete before copying checkpoint control information
       into the backup.
Testing : All functional tests(derbyall suite) passed on jdk142/Windows XP.
svn status:
M      java\engine\org\apache\derby\impl\store\raw\log\ReadOnly.java
M      java\engine\org\apache\derby\impl\store\raw\log\LogToFile.java
M      java\engine\org\apache\derby\impl\store\raw\RawStore.java
M      java\engine\org\apache\derby\impl\store\raw\data\BasePage.java
M      java\engine\org\apache\derby\impl\store\raw\data\InputStreamContainer.jav
a
M      java\engine\org\apache\derby\impl\store\raw\data\BaseDataFileFactory.java

M      java\engine\org\apache\derby\impl\store\raw\data\CachedPage.java
M      java\engine\org\apache\derby\impl\store\raw\data\FileContainer.java
M      java\engine\org\apache\derby\impl\store\raw\data\BaseContainer.java
M      java\engine\org\apache\derby\impl\store\raw\data\BaseContainerHandle.java

M      java\engine\org\apache\derby\impl\store\raw\data\RAFContainer.java
M      java\engine\org\apache\derby\iapi\store\raw\log\LogFactory.java
M      java\engine\org\apache\derby\iapi\store\raw\data\DataFactory.java
M      java\engine\org\apache\derby\iapi\store\raw\ContainerHandle.java



Need a online backup feature  that does not block update operations   when 
online backup is in progress.
--------------------------------------------------------------------------------------------------------

        Key: DERBY-239
        URL: http://issues.apache.org/jira/browse/DERBY-239
    Project: Derby
       Type: New Feature
 Components: Store
   Versions: 10.1.1.0
   Reporter: Suresh Thalamati
   Assignee: Suresh Thalamati
Attachments: onlinebackup.html, onlinebackup_1.diff

Currently Derby allows users to perfoms  online backups using 
SYSCS_UTIL.SYSCS_BACKUP_DATABASE() procedure,  but while the backup is in 
progress, update operations are temporarily blocked, but read operations can 
still proceed.
Blocking update operations can be real issue specifically in client server environments, because user requests will be blocked for a long time if a backup is in the progress on the server.



Reply via email to