You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by mi...@apache.org on 2014/11/25 05:23:19 UTC

svn commit: r1641526 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java

Author: mikem
Date: Tue Nov 25 04:23:19 2014
New Revision: 1641526

URL: http://svn.apache.org/r1641526
Log:
DERBY-4057 Space is not reclaimed if transaction is rolled back

a few changes to make the ClobReclamationTest better behaved across a variety
of platforms.  The test tries to measure background thread behavior, and needs
to allow for machines/jvms that might be single threaded and slow.  

In one case added a sleep after all aborts to allow the background thread
to catch up and mark all pages but head one free.  

In other case added more to the fudge factor of how much immediate insert
might progress before background thread can catch up and make free page 
available.  If this does not work may just need to add sleep after every 
insert.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java?rev=1641526&r1=1641525&r2=1641526&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java Tue Nov 25 04:23:19 2014
@@ -240,6 +240,19 @@ public class ClobReclamationTest extends
             ps.executeUpdate();
             rollback();
         }
+
+        // sleep 5 seconds to give background space reclamation worker thread 
+        // a chance to reclaim all the aborted insert space.
+        
+        try 
+        {
+            Thread.sleep(5000);
+        }
+        catch (Exception ex)
+        {
+            // just ignore interrupted sleep
+        }
+
         checkNumAllocatedPages("CLOBTAB2",1);
     }
 
@@ -301,11 +314,11 @@ public class ClobReclamationTest extends
         // issue with test and maybe a sleep of some sort is necessary after
         // the rollback.  
 
-        // declaring correct run if only max if free pages from 5 pages worth
+        // declaring correct run if only max if free pages from 10 pages worth
         // of free space remains.
         // ((clob length / page size ) * 5) + 
         //     1 page for int divide round off - 1 for the head page.
-        checkNumFreePagesMax("CLOBTAB3", ((clob_length / 32000) * 5) + 1 - 1);
+        checkNumFreePagesMax("CLOBTAB3", ((clob_length / 32000) * 10) + 1 - 1);
         commit();
 
         // running inplace compress should reclaim all the remaining aborted