Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4277

ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed after testing fix of 4268

Details

    • Normal
    • Regression Test Failure

    Description

      When testing the fix for bug 4268, ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed. This is after revision: 785298.
      $ cat error-stacktrace.out
      [Error/failure logged at Tue Jun 16 22:15:46 PDT 2009]
      junit.framework.ComparisonFailure: Unexpected SQL state. expected:<...20> but wa
      s:<...07>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:762)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:811)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver_direct(ReplicationRun.java:1381)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver(ReplicationRun.java:1302)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun_Local.testReplication_Local_existingTestsAsReplLoad(ReplicationRun_Local.
      java:148)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
      106)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.textui.TestRunner.doRun(TestRunner.java:116)
      at junit.textui.TestRunner.start(TestRunner.java:172)
      at junit.textui.TestRunner.main(TestRunner.java:138)
      Caused by: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE07,
      SQLERRMC: Could not perform operation because the database is not in replicatio
      n master mode.
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:96)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.
      java:358)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:149)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver_direct(ReplicationRun.java:1368)
      ... 28 more
      Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1
      , SQLSTATE: XRE07, SQLERRMC: Could not perform operation because the database is
      not in replication master mode.
      at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2
      075)
      at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(N
      etConnectionReply.java:540)
      at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Ne
      tConnectionReply.java:433)
      at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetCo
      nnectionReply.java:297)
      at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Net
      ConnectionReply.java:121)
      at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessR
      db(NetConnection.java:835)
      at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessR
      db(NetConnection.java:759)
      at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConn
      ection.java:592)
      at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.j
      ava:399)
      at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:2
      19)
      at org.apache.derby.client.net.NetConnection40.<init>(NetConnection40.ja
      va:77)
      at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConne
      ction(ClientJDBCObjectFactoryImpl40.java:269)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:140)
      ... 31 more

      =====Trace for ReplicationRun_Local_StateTest_part1===========
      [Error/failure logged at Tue Jun 16 22:19:28 PDT 2009]
      junit.framework.ComparisonFailure: Unexpected SQL state. expected:<...20> but wa
      s:<...07>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:762)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:811)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver_direct(ReplicationRun.java:1381)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver(ReplicationRun.java:1302)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun_Local_StateTest_part1.testReplication_Local_StateTest_part1(ReplicationRu
      n_Local_StateTest_part1.java:160)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
      106)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at junit.textui.TestRunner.doRun(TestRunner.java:116)
      at junit.textui.TestRunner.start(TestRunner.java:172)
      at junit.textui.TestRunner.main(TestRunner.java:138)
      Caused by: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XRE07,
      SQLERRMC: Could not perform operation because the database is not in replicatio
      n master mode.
      at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:96)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.
      java:358)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:149)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.Replicat
      ionRun.failOver_direct(ReplicationRun.java:1368)
      ... 28 more
      Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1
      , SQLSTATE: XRE07, SQLERRMC: Could not perform operation because the database is
      not in replication master mode.
      at org.apache.derby.client.am.Connection.completeSqlca(Connection.java:2
      075)
      at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(N
      etConnectionReply.java:540)
      at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Ne
      tConnectionReply.java:433)
      at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(NetCo
      nnectionReply.java:297)
      at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Net
      ConnectionReply.java:121)
      at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessR
      db(NetConnection.java:835)
      at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessR
      db(NetConnection.java:759)
      at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(NetConn
      ection.java:592)
      at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.j
      ava:399)
      at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:2
      19)
      at org.apache.derby.client.net.NetConnection40.<init>(NetConnection40.ja
      va:77)
      at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConne
      ction(ClientJDBCObjectFactoryImpl40.java:269)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:140)
      ... 31 more

      Attachments

        1. derby-log.zipx
          44 kB
          Lily Wei
        2. error-stacktrace-ReplicationRun_Local.out
          4 kB
          Lily Wei
        3. error-stacktrace-ReplicationRun_Local_StateTest_part1.out
          4 kB
          Lily Wei
        4. DERBY-4277_diff-p1.txt
          3 kB
          Ole Solberg
        5. DERBY-4277_stat-p1.txt
          0.3 kB
          Ole Solberg

        Issue Links

          Activity

            lilywei Lily Wei added a comment -

            Kathey pointed out this issue might be relate to 3719.

            After testing fix for 4268, ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed on my machine.

            lilywei Lily Wei added a comment - Kathey pointed out this issue might be relate to 3719. After testing fix for 4268, ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed on my machine.
            olesolberg Ole Solberg added a comment -

            I think this is an instance of the case where the replication tests assume that the final expected state is reached immediatly.
            The 'ReplicationRun.waitForConnect()' and 'ReplicationRun.waitForSQLState()' methods were intended to be used in these cases,
            but these has not been utilized everywhere they should.

            olesolberg Ole Solberg added a comment - I think this is an instance of the case where the replication tests assume that the final expected state is reached immediatly. The 'ReplicationRun.waitForConnect()' and 'ReplicationRun.waitForSQLState()' methods were intended to be used in these cases, but these has not been utilized everywhere they should.
            olesolberg Ole Solberg added a comment -

            Assigned this to do the more general task of utilizing 'ReplicationRun.waitForConnect()' and 'ReplicationRun.waitForSQLState()' where applicable - on trunk and then backport to 10.5.

            olesolberg Ole Solberg added a comment - Assigned this to do the more general task of utilizing 'ReplicationRun.waitForConnect()' and 'ReplicationRun.waitForSQLState()' where applicable - on trunk and then backport to 10.5.
            olesolberg Ole Solberg added a comment - Instances of the failure also seen in http://dbtg.thresher.com/derby/test/trunk15/jvm1.5/testing/testlog/CYGWIN_NT-5.1_i686-unknown/787757-org.apache.derbyTesting.functionTests.suites.All_diff.txt and http://dbtg.thresher.com/derby/test/trunk15/jvm1.5/testing/testlog/CYGWIN_NT-5.1_i686-unknown/787327-org.apache.derbyTesting.functionTests.suites.All_diff.txt These and other cases have incorrectly been associated with DERBY-3529 .
            olesolberg Ole Solberg added a comment -

            DERBY-4277_diff-p1 - Patch which should fix the replication state problem seen in ReplicationRun_Local_StateTest_part1_1.java.

            Still running tests...

            olesolberg Ole Solberg added a comment - DERBY-4277 _diff-p1 - Patch which should fix the replication state problem seen in ReplicationRun_Local_StateTest_part1_1.java. Still running tests...
            olesolberg Ole Solberg added a comment -

            DERBY-4277 tested: ~150 runs of ReplicationSuite, plus suites.All: no failures.

            Planning to commit the patch later today.

            olesolberg Ole Solberg added a comment - DERBY-4277 tested: ~150 runs of ReplicationSuite, plus suites.All: no failures. Planning to commit the patch later today.

            The patch looks fine to me. +1 to commit.

            Minor nit: Instead of passing (slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb) as an argument to waitForConnect(), I think you could use the local variable db which already has that value.

            knutanders Knut Anders Hatlen added a comment - The patch looks fine to me. +1 to commit. Minor nit: Instead of passing (slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb) as an argument to waitForConnect(), I think you could use the local variable db which already has that value.
            olesolberg Ole Solberg added a comment - - edited

            Committed DERBY-4277_diff-p1 to trunk with revision 789601.

            olesolberg Ole Solberg added a comment - - edited Committed DERBY-4277 _diff-p1 to trunk with revision 789601.
            dagw Dag H. Wanvik added a comment -

            Ole, I see you committed the patch for this issue, thanks!
            Should this issue be resolved or do you plan to backport it first?

            dagw Dag H. Wanvik added a comment - Ole, I see you committed the patch for this issue, thanks! Should this issue be resolved or do you plan to backport it first?

            Looks like this work was mostly done but Knut had a comment that can still be resolved.

            myrna Myrna van Lunteren added a comment - Looks like this work was mostly done but Knut had a comment that can still be resolved.

            Commit 1653975 from myrna in branch 'code/trunk'
            [ https://svn.apache.org/r1653975 ]

            DERBY-4277; ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed after testing fix of 4268
            Applying the minor improvement suggested to replace 'slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb' by 'db' in the waitForConnect() method.

            jira-bot ASF subversion and git services added a comment - Commit 1653975 from myrna in branch 'code/trunk' [ https://svn.apache.org/r1653975 ] DERBY-4277 ; ReplicationRun_Local and ReplicationRun_Local_StateTest_part1 failed after testing fix of 4268 Applying the minor improvement suggested to replace 'slaveDatabasePath + FS + slaveDbSubPath + FS + replicatedDb' by 'db' in the waitForConnect() method.

            I applied the suggested change and committed (no patch) so I think that concludes the work on this issue. Setting back to Ole as he did the actual work. Setting to be fixed in 10.6.1.0 as the version for the original check-in.

            myrna Myrna van Lunteren added a comment - I applied the suggested change and committed (no patch) so I think that concludes the work on this issue. Setting back to Ole as he did the actual work. Setting to be fixed in 10.6.1.0 as the version for the original check-in.

            People

              olesolberg Ole Solberg
              lilywei Lily Wei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: