db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r376502 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/store/raw/data/ iapi/store/raw/xact/ impl/store/raw/data/ impl/store/raw/xact/
Date Fri, 10 Feb 2006 00:12:03 GMT
Author: mikem
Date: Thu Feb  9 16:12:00 2006
New Revision: 376502

URL: http://svn.apache.org/viewcvs?rev=376502&view=rev
Log:
DERBY-888

Add specific errors for failure while doing initpage redo recovery attempt.
Remove "loadTran" references, that term isn't really useful to current code.
All cases now apply to redo recovery.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerBasicOperation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerOperation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InitPageOperation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/PageBasicOperation.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
Thu Feb  9 16:12:00 2006
@@ -168,11 +168,14 @@
 		throws StandardException;
 
 	/**
-		re-Create a container during recovery load tran.
+		re-Create a container during redo recovery.
+
+        Used if container is found to not exist during redo recovery of
+        log records creating the container.
 
 		@exception StandardException Standard Cloudscape Error policy
 	 */
-	public void reCreateContainerForLoadTran(RawTransaction t,
+	public void reCreateContainerForRedoRecovery(RawTransaction t,
 			long segmentId, long containerId, ByteArray containerInfo)
 		 throws StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/RawContainerHandle.java
Thu Feb  9 16:12:00 2006
@@ -89,13 +89,17 @@
 	/** Backup restore support */
 
 	/**
-		ReCreate a page for load tran - called by recovery redo ONLY
+		ReCreate a page for redo recovery.
+
+        Used during redo recovery while trying to apply log records which
+        are creating the page.
 
 		@exception StandardException Standard Cloudscape error policy
 	 */
-	public Page reCreatePageForLoadTran(int pageFormat, 
-										long pageNumber, 
-										long pageOffset)
+	public Page reCreatePageForRedoRecovery(
+    int     pageFormat, 
+    long    pageNumber, 
+    long    pageOffset)
 		 throws StandardException;
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
Thu Feb  9 16:12:00 2006
@@ -267,11 +267,14 @@
 		 throws StandardException;
 
 	/**
-		Recreate a container during load tran - use only by media recovery.
+		Recreate a container during redo recovery.
+
+        Used during redo recovery when processing log records trying to 
+        create a container, but no container is found in the db.
 
 		@exception StandardException  Standard cloudscape exception policy
 	 */
-	public abstract void reCreateContainerForLoadTran
+	public abstract void reCreateContainerForRedoRecovery
 		(long segmentId, long containerId, ByteArray containerInfo)
 		throws StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainer.java
Thu Feb  9 16:12:00 2006
@@ -651,25 +651,46 @@
 	protected abstract BasePage getAnyPage(BaseContainerHandle handle, long pageNumber)
 		 throws StandardException;
 
-	/**
-		ReCreate a page for load tran.  The argument passed in need to be
-		sufficient for the page cache to materialize a brand new page and write
-		it to disk.  The reason why this method is necessary is because we
-		first create the page, write it to disk, and then log the init page log
-		record to make sure there are enough space on disk.  During load tran,
-		the page creation part is missing.
-
-		<p>Load tran will do no preallocation.
-
-		<p>Only called during recovery redo.
-
-		@exception StandardException Cloudscape Standard error policy
-	 */
+    /**
+     * ReCreate a page for rollforward recovery.  
+     * <p>
+     * During redo recovery it is possible for the system to try to redo
+     * the creation of a page (ie. going from non-existence to version 0).
+     * It first trys to read the page from disk, but a few different types
+     * of errors can occur:
+     *     o the page does not exist at all on disk, this can happen during
+     *       rollforward recovery applied to a backup where the file was
+     *       copied and the page was added to the file during the time frame
+     *       of the backup but after the physical file was copied.
+     *     o space in the file exists, but it was never initalized.  This
+     *       can happen if you happen to crash at just the right moment during
+     *       the allocation process.  Also
+     *       on some OS's it is possible to read from a part of the file that
+     *       was not ever written - resulting in garbage from the store's 
+     *       point of view (often the result is all 0's).  
+     *
+     * All these errors are easy to recover from as the system can easily 
+     * create a version 0 from scratch and write it to disk.
+     *
+     * Because the system does not sync allocation of data pages, it is also
+     * possible at this point that whlie writing the version 0 to disk to 
+     * create it we may encounter an out of disk space error (caught in this
+     * routine as a StandardException from the create() call.  We can't 
+     * recovery from this without help from outside, so the caught exception
+     * is nested and a new exception thrown which the recovery system will
+     * output to the user asking them to check their disk for space/errors.
+     *
+     * The arguments passed in need to be sufficient for the page cache to 
+     * materialize a brand new page and write it to disk.  
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
 	protected abstract BasePage
-	reCreatePageForLoadTran(BaseContainerHandle handle,
-							int pageFormat,
-							long pageNumber,
-							long pageOffset)
+	reCreatePageForRedoRecovery(
+    BaseContainerHandle handle,
+    int pageFormat,
+    long pageNumber,
+    long pageOffset)
 		 throws StandardException;
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
Thu Feb  9 16:12:00 2006
@@ -590,11 +590,38 @@
 		return container.getAnyPage(this, pageNumber, true /* wait */);
 	}
 
-	/**
-		Re-create this page for load tran.  Called by recovery redo ONLY
-		@exception StandardException Cloudscape Standard error policy
-	 */
-	public Page reCreatePageForLoadTran(
+    /**
+     * ReCreate a page for rollforward recovery.  
+     * <p>
+     * During redo recovery it is possible for the system to try to redo
+     * the creation of a page (ie. going from non-existence to version 0).
+     * It first trys to read the page from disk, but a few different types
+     * of errors can occur:
+     *     o the page does not exist at all on disk, this can happen during
+     *       rollforward recovery applied to a backup where the file was
+     *       copied and the page was added to the file during the time frame
+     *       of the backup but after the physical file was copied.
+     *     o space in the file exists, but it was never initalized.  This
+     *       can happen if you happen to crash at just the right moment during
+     *       the allocation process.  Also
+     *       on some OS's it is possible to read from a part of the file that
+     *       was not ever written - resulting in garbage from the store's 
+     *       point of view (often the result is all 0's).  
+     *
+     * All these errors are easy to recover from as the system can easily 
+     * create a version 0 from scratch and write it to disk.
+     *
+     * Because the system does not sync allocation of data pages, it is also
+     * possible at this point that whlie writing the version 0 to disk to 
+     * create it we may encounter an out of disk space error (caught in this
+     * routine as a StandardException from the create() call.  We can't 
+     * recovery from this without help from outside, so the caught exception
+     * is nested and a new exception thrown which the recovery system will
+     * output to the user asking them to check their disk for space/errors.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+	public Page reCreatePageForRedoRecovery(
     int     pageFormat,
     long    pageNumber, 
     long    pageOffset)
@@ -602,7 +629,7 @@
 	{
 		checkUpdateOpen();
 
-		return container.reCreatePageForLoadTran(
+		return container.reCreatePageForRedoRecovery(
 					this, pageFormat, pageNumber, pageOffset);
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Thu Feb  9 16:12:00 2006
@@ -992,13 +992,13 @@
 	}
 
 	/**
-		re-Create a container during recovery load tran.
+		re-Create a container during redo recovery.
 
 		called ONLY during recovery load tran.
 
 		@exception StandardException Standard Cloudscape Error policy
 	 */
-	public void reCreateContainerForLoadTran(
+	public void reCreateContainerForRedoRecovery(
     RawTransaction  t, 
     long            segmentId, 
     long            containerId, 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerBasicOperation.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerBasicOperation.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerBasicOperation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerBasicOperation.java
Thu Feb  9 16:12:00 2006
@@ -152,18 +152,28 @@
 			if (containerHdl == null)
 			{
 				if (SanityManager.DEBUG) 
+                {
 					if(SanityManager.DEBUG_ON("LoadTran"))
-						SanityManager.DEBUG_PRINT("Trace", "cannot find container " + containerId + 
-												  ", now attempt last ditch effort");
+                    {
+						SanityManager.DEBUG_PRINT(
+                            "Trace", 
+                            "cannot find container " + containerId + 
+                                  ", now attempt last ditch effort");
+                    }
+                }
 				
 
-				containerHdl = findContainerForLoadTran(rtran);
+				containerHdl = findContainerForRedoRecovery(rtran);
 
 				if (SanityManager.DEBUG) 
+                {
 					if(SanityManager.DEBUG_ON("LoadTran"))
+                    {
 						SanityManager.DEBUG_PRINT("Trace",
-												  " findContainerForLoadTran, got container=" +
-												  (containerHdl != null));
+                            " findContainerForRedoRecovery, got container=" + 
+                            (containerHdl != null));
+                    }
+                }
 
 			}
 		}	
@@ -185,7 +195,8 @@
 
 		@exception StandardException Cloudscape Standard error policy
 	 */
-	protected RawContainerHandle findContainerForLoadTran(RawTransaction tran) 
+	protected RawContainerHandle findContainerForRedoRecovery(
+    RawTransaction tran) 
 		 throws StandardException 
 	{
 		return null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerOperation.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerOperation.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerOperation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerOperation.java
Thu Feb  9 16:12:00 2006
@@ -141,7 +141,7 @@
 
 
 	/*
-	 * override ContainerBasicOperation's findContainerForLoadTran
+	 * override ContainerBasicOperation's findContainerForRedoRecovery
 	 */
 	/**
         Find container for load tran.
@@ -151,7 +151,8 @@
 
 		@exception StandardException Standard Cloudscape policy.
 	 */
-	protected RawContainerHandle findContainerForLoadTran(RawTransaction xact)
+	protected RawContainerHandle findContainerForRedoRecovery(
+    RawTransaction xact)
 		 throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -161,7 +162,7 @@
 		long sid = containerId.getSegmentId();
 		long cid = containerId.getContainerId();
 
-		xact.reCreateContainerForLoadTran(sid, cid, createByteArray);
+		xact.reCreateContainerForRedoRecovery(sid, cid, createByteArray);
 
 		// now we should be able to open this container
 		return xact.openDroppedContainer(containerId, (LockingPolicy)null);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
Thu Feb  9 16:12:00 2006
@@ -1715,12 +1715,13 @@
                 // there is no more reusable page.  Unless we are called 
                 // explicitly to bulk increase the container size in a preload 
                 // or in a create container.
-			    if (!noIO && (bulkIncreaseContainerSize ||
-						  (pageNumber > lastPreallocPage &&
-						   pageNumber > PreAllocThreshold)))
+			    if (!noIO && 
+                    (bulkIncreaseContainerSize ||
+					 (pageNumber > lastPreallocPage && 
+                      pageNumber > PreAllocThreshold)))
 			    {
-				    allocPage.preAllocatePage(this, PreAllocThreshold,
-				    						  PreAllocSize);
+				    allocPage.preAllocatePage(
+                        this, PreAllocThreshold, PreAllocSize);
 			    }
 
 			    // update last preAllocated Page, it may have been changed by 
@@ -2177,12 +2178,13 @@
 		// 1'st element is whether or not to sync the page to disk
 		// 2'nd element is the pagesize
 		// 3'rd element is spareSpace
-		// 4'th element is the number of bytes to reserve for the container header
+		// 4'th element is number of bytes to reserve for the container header
 		// 5'th element is the minimumRecordSize
 		// NOTE: the arg list here must match the one in allocPage
 
 		// No I/O at all if this new page is requested as part of a create
-		// and load statement or this new alloc page is in a temporary container.
+		// and load statement or this new alloc page is in a temporary 
+        // container.
 		// In the former case, BaseContainer will allow the MODE_UNLOGGED
 		// bit to go thru to the nested top transaction alloc handle.
 		// In the later case, there is no nested top transaction and the
@@ -2195,7 +2197,7 @@
 		createAllocPageArgs[0] = AllocPage.FORMAT_NUMBER;	
 		createAllocPageArgs[1] = noIO ? 0 : CachedPage.WRITE_SYNC;
 		createAllocPageArgs[2] = pageSize;
-		createAllocPageArgs[3] = 0;		// allocation page have no need for spare
+		createAllocPageArgs[3] = 0;		// allocation page has no need for spare
 		createAllocPageArgs[4] = containerInfoSize;
 		createAllocPageArgs[5] = minimumRecordSize;
 
@@ -2463,24 +2465,52 @@
 		return page;
 	}
 
-	/**
-		ReCreate a page for load tran/rollforward recovery.  
-		Only called during recovery redo
-
-		@exception StandardException Cloudscape Standard error policy
-	*/
-	protected BasePage reCreatePageForLoadTran(BaseContainerHandle handle,
-											   int pageFormat,
-											   long pageNumber,
-											   long pageOffset)
+    /**
+     * ReCreate a page for rollforward recovery.  
+     * <p>
+     * During redo recovery it is possible for the system to try to redo
+     * the creation of a page (ie. going from non-existence to version 0).
+     * It first trys to read the page from disk, but a few different types
+     * of errors can occur:
+     *     o the page does not exist at all on disk, this can happen during
+     *       rollforward recovery applied to a backup where the file was
+     *       copied and the page was added to the file during the time frame
+     *       of the backup but after the physical file was copied.
+     *     o space in the file exists, but it was never initalized.  This
+     *       can happen if you happen to crash at just the right moment during
+     *       the allocation process.  Also
+     *       on some OS's it is possible to read from a part of the file that
+     *       was not ever written - resulting in garbage from the store's 
+     *       point of view (often the result is all 0's).  
+     *
+     * All these errors are easy to recover from as the system can easily 
+     * create a version 0 from scratch and write it to disk.
+     *
+     * Because the system does not sync allocation of data pages, it is also
+     * possible at this point that whlie writing the version 0 to disk to 
+     * create it we may encounter an out of disk space error (caught in this
+     * routine as a StandardException from the create() call.  We can't 
+     * recovery from this without help from outside, so the caught exception
+     * is nested and a new exception thrown which the recovery system will
+     * output to the user asking them to check their disk for space/errors.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+	protected BasePage reCreatePageForRedoRecovery(
+    BaseContainerHandle handle,
+    int                 pageFormat,
+    long                pageNumber,
+    long                pageOffset)
 		 throws StandardException
 	{
-		// recreating a page should be done only if are in the  middle of rollforward recovery
or
-		// if derby.storage.patchInitPageRecoverError is set to true.
+		// recreating a page should be done only if are in the middle of 
+        // rollforward recovery or if derby.storage.patchInitPageRecoverError 
+        // is set to true.
 
 		//check if we are in rollforward recovery
 		boolean rollForwardRecovery = 
 			((RawTransaction)handle.getTransaction()).inRollForwardRecovery();
+
 		if (!rollForwardRecovery && !(PropertyUtil.getSystemBoolean(
                     RawStoreFactory.PATCH_INITPAGE_RECOVER_ERROR)))
 		{
@@ -2523,7 +2553,7 @@
 			reCreatePageArgs[0] = pageFormat;
 			reCreatePageArgs[1] = CachedPage.WRITE_SYNC;
 			reCreatePageArgs[2] = pageSize;
-			reCreatePageArgs[3] = 0;		// allocation page have no need for spare
+			reCreatePageArgs[3] = 0; // allocation page has no need for spare
 			reCreatePageArgs[4] = containerInfoSize;
 			reCreatePageArgs[5] = minimumRecordSize;
 		}
@@ -2534,33 +2564,46 @@
 		}
 
         if (SanityManager.DEBUG) 
-			if(SanityManager.DEBUG_ON("LoadTran"))
-				SanityManager.DEBUG_PRINT("Trace", "recreating page " + pkey + " for load tran");
+        {
+			if (SanityManager.DEBUG_ON("LoadTran"))
+				SanityManager.DEBUG_PRINT(
+                    "Trace", "recreating page " + pkey + " for load tran");
+        }
 
 		// Can't just call initPage because that wants to log an initPage
 		// operation, whereas we are here because of an initPage operation in
 		// the log already.
 		BasePage page = null;
 		boolean releasePage = true;
+
 		try
 		{
-			// a brand new page, initialize and a new page in cache
-			page = (BasePage) pageCache.create(pkey, reCreatePageArgs);
-
-			if (SanityManager.DEBUG)
+            try
             {
-                if (page == null)
-                    SanityManager.THROWASSERT(
-                        "reCreating page " + pkey + " failed");
+                // a brand new page, initialize a new page in cache
+                page = (BasePage) pageCache.create(pkey, reCreatePageArgs);
+            }
+            catch (StandardException se)
+            {
+                throw StandardException.newException(
+                    SQLState.FILE_NEW_PAGE_DURING_RECOVERY, se, pkey);
             }
 
-			releasePage = false;
-			page = latchPage(handle, page, false /* never need to wait */);
+            if (page != null)
+            {
+                releasePage = false;
+                page = latchPage(handle, page, false /* never need to wait */);
 
-			if (page == null)
+                if (page == null)
+                {
+                    throw StandardException.newException(
+                            SQLState.FILE_NEW_PAGE_NOT_LATCHED, pkey);
+                }
+            }
+            else
             {
-				throw StandardException.newException(
-                        SQLState.FILE_NEW_PAGE_NOT_LATCHED, pkey);
+                throw StandardException.newException(
+                    SQLState.FILE_NEW_PAGE_DURING_RECOVERY, pkey);
             }
 
 		}
@@ -2568,9 +2611,9 @@
 		{
 			if (releasePage && page != null)
 			{
-				// release the new page from cache if it errors 
-				// out before the exclusive lock is set
-				// error in load tran, we are doomed anyway
+				// release the new page from cache if it errors out before 
+                // the exclusive lock is set error in roll forward recovery.
+                // , we are doomed anyway
 				pageCache.release((Cacheable)page);
 				page = null;
 			}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InitPageOperation.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InitPageOperation.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InitPageOperation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/InitPageOperation.java
Thu Feb  9 16:12:00 2006
@@ -155,7 +155,7 @@
 	}
 
 	/*
-	 * Override PageBasicOperation's getPageForLoadTran
+	 * Override PageBasicOperation's getPageForRedoRecovery
 	 */
 	/**
 		If we are in load tran, this page may not exist for the container yet.
@@ -166,17 +166,17 @@
 
 		@exception StandardException Standard Cloudscape policy.
 	*/
-	protected BasePage getPageForLoadTran(Transaction xact)
+	protected BasePage getPageForRedoRecovery(Transaction xact)
 		 throws StandardException
 	{
-		BasePage p = super.getPageForLoadTran(xact);
+		BasePage p = super.getPageForRedoRecovery(xact);
 		if (p != null)
 			return p;
 
 		// create the page
 		// RESOLVE: we need the page format to properly recreate an Alloc page
 		// NEED TO UPGRADE this log record.
-		p = (BasePage)containerHdl.reCreatePageForLoadTran(
+		p = (BasePage)containerHdl.reCreatePageForRedoRecovery(
 						pageFormatId,								   
 						getPageId().getPageNumber(), 
 						pageOffset);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/PageBasicOperation.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/PageBasicOperation.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/PageBasicOperation.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/PageBasicOperation.java
Thu Feb  9 16:12:00 2006
@@ -312,7 +312,7 @@
 		//We do this if derby.storage.patchInitPageRecoverError is set.
 		if (page == null && getPageException != null && pageVersion == 0)
 			if (PropertyUtil.getSystemBoolean(RawStoreFactory.PATCH_INITPAGE_RECOVER_ERROR))
-				page = getPageForLoadTran(xact);
+				page = getPageForRedoRecovery(xact);
 		
 		// maybe we are in rollforward recovery and this is an init page operation,
 		// give subclass a chance to create the page
@@ -328,16 +328,16 @@
 				if (SanityManager.DEBUG) 
 					if(SanityManager.DEBUG_ON("LoadTran"))
 						SanityManager.DEBUG_PRINT(
-											  "Trace", "got null page " + pageId + 
-											  " and getPageException, now attempt last ditch effort");
+                            "Trace", "got null page " + pageId + 
+                            " and getPageException, attempt last ditch effort");
 
-				page = getPageForLoadTran(xact);
+				page = getPageForRedoRecovery(xact);
 				
 				if (SanityManager.DEBUG) 
 					if(SanityManager.DEBUG_ON("LoadTran"))
 						SanityManager.DEBUG_PRINT(
-											  "Trace"," getPageForLoadTran, got page=" + 
-											  (page != null));
+                            "Trace"," getPageForRedoRecovery, got page=" + 
+                            (page != null));
 			}	
 		}
 
@@ -363,7 +363,7 @@
 
 		@exception StandardException Cloudscape Standard error policy
 	 */
-	protected BasePage getPageForLoadTran(Transaction xact)
+	protected BasePage getPageForRedoRecovery(Transaction xact)
 		 throws StandardException
 	{
 		return null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
Thu Feb  9 16:12:00 2006
@@ -536,9 +536,22 @@
 		return true;
 	}
 
-	/**
-		@exception StandardException Standard Cloudscape error policy
-	*/
+    /**
+     * Clean the container.
+     * <p>
+     * Write out the container header and sync all dirty pages of this
+     * container to disk before returning.
+     * <p>
+     * checkpoint calls this interface through callbacks by telling
+     * the cache manager to clean all containers in the open container
+     * cache.  This sync of the file happens as part of writing and then
+     * syncing the container header in writeRAFHeader().
+     * <p>
+     *
+     * @param boolean Is clean called because container is being removed?
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
 	public void clean(boolean forRemove) throws StandardException
 	{
 		boolean waited = false;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=376502&r1=376501&r2=376502&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java Thu Feb
 9 16:12:00 2006
@@ -1365,18 +1365,22 @@
 	}
 
 	/**
-		Recreate a container during load tran - use only by media recovery.
+		Recreate a container during redo recovery.
+
+        Used only during redo recovery while processing log records which
+        are trying to create a container, and no valid container is found
+        in the database.
 
 		@exception StandardException  Standard cloudscape exception policy
-		@see RawTransaction#reCreateContainerForLoadTran
+		@see RawTransaction#reCreateContainerForRedoRecovery
 	 */
-	public void reCreateContainerForLoadTran
+	public void reCreateContainerForRedoRecovery
 		(long segmentId, long containerId, ByteArray containerInfo)
 		throws StandardException
 	{
 		setActiveState();
 
-		dataFactory.reCreateContainerForLoadTran(
+		dataFactory.reCreateContainerForRedoRecovery(
 			this, segmentId, containerId, containerInfo);
 	}
 



Mime
View raw message