Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1EBB111A09 for ; Mon, 5 May 2014 21:02:15 +0000 (UTC) Received: (qmail 60618 invoked by uid 500); 5 May 2014 21:02:14 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 60565 invoked by uid 500); 5 May 2014 21:02:14 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 60556 invoked by uid 99); 5 May 2014 21:02:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 21:02:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 May 2014 21:02:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1A4532388860; Mon, 5 May 2014 21:01:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1592630 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java Date: Mon, 05 May 2014 21:01:53 -0000 To: derby-commits@db.apache.org From: myrnavl@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140505210153.1A4532388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: myrnavl Date: Mon May 5 21:01:52 2014 New Revision: 1592630 URL: http://svn.apache.org/r1592630 Log: DERBY-6502; Failure in OnlineCompressTest adding calls to wait for post commit tasks in the hope of addressing instability in OnlineCompressTest. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java?rev=1592630&r1=1592629&r2=1592630&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java Mon May 5 21:01:52 2014 @@ -523,6 +523,8 @@ public class OnlineCompressTest extends ret_before = getSpaceInfo(conn, "APP", table_name, true); executeQuery(conn, "delete from " + table_name, true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted all rows, now calling compress."); @@ -598,6 +600,8 @@ public class OnlineCompressTest extends ret_before = getSpaceInfo(conn, "APP", table_name, true); executeQuery(conn, "delete from " + table_name, true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted all rows, now calling compress."); @@ -768,6 +772,8 @@ public class OnlineCompressTest extends // delete all rows and commit. executeQuery(conn, "delete from " + table_name, true); + callWaitForPostCommit(conn); + // compress all space and commit. callCompress(conn, "APP", table_name, true, true, true, true); @@ -827,6 +833,8 @@ public class OnlineCompressTest extends // results. conn.commit(); + callWaitForPostCommit(conn); + // check the table. Note that this will accumulate locks and // will commit the transaction. if (!checkConsistency(conn, schemaName, table_name)) @@ -1161,6 +1169,8 @@ public class OnlineCompressTest extends executeQuery( conn, "delete from " + table_name + " where onehalf = 0", true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted every other row, now calling compress."); @@ -1195,6 +1205,8 @@ public class OnlineCompressTest extends executeQuery( conn, "delete from " + table_name + " where onethird = 0", true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted every third row, now calling compress."); @@ -1229,6 +1241,8 @@ public class OnlineCompressTest extends conn, "delete from " + table_name + " where keycol > " + (num_rows / 2), true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted top half of the rows, now calling compress."); @@ -1273,6 +1287,8 @@ public class OnlineCompressTest extends executeQuery( conn, "delete from " + table_name + " where keycol < 500 ", true); + callWaitForPostCommit(conn); + if (verbose) testProgress("deleted keys < 500, now calling compress."); @@ -1405,6 +1421,9 @@ public class OnlineCompressTest extends // delete all the rows. ret_before = getSpaceInfo(conn, "APP", table_name, true); executeQuery(conn, "delete from " + table_name, true); + + callWaitForPostCommit(conn); + conn.commit(); if (verbose) @@ -1478,6 +1497,8 @@ public class OnlineCompressTest extends executeQuery( conn, "delete from " + table_name + " where keycol < 1000", true); + callWaitForPostCommit(conn); + conn.commit(); if (verbose) @@ -1504,6 +1525,15 @@ public class OnlineCompressTest extends test7(conn, "test7", "TEST7"); } + public static void callWaitForPostCommit(Connection conn) + throws SQLException { + CallableStatement cstmt = + conn.prepareCall( + "call wait_for_post_commit()"); + cstmt.execute(); + cstmt.close(); + } + public static void main(String[] argv) throws Throwable { @@ -1511,7 +1541,19 @@ public class OnlineCompressTest extends ij.getPropertyArg(argv); Connection conn = ij.startJBMS(); + + Statement stmt = conn.createStatement(); + // Create a procedure to be called before checking on contents + // to ensure that the background worker thread has completed + // all the post-commit work. + stmt.execute( + "CREATE PROCEDURE WAIT_FOR_POST_COMMIT() " + + "LANGUAGE JAVA EXTERNAL NAME " + + "'org.apache.derbyTesting.functionTests.util." + + "T_Access.waitForPostCommitToFinish' " + + "PARAMETER STYLE JAVA"); conn.setAutoCommit(false); + stmt.close(); try {