glassfish
  1. glassfish
  2. GLASSFISH-14188

TM should listen to stop instance event to rollback active transactions

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: future release
    • Component/s: jts
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Inconsistent global tx with stop/start cluster instance
      glassfish-3.1-b25.zip

      The admincli delegated recovery tests have the cases with kill or stop instance.

      Following the suggestion:
      https://glassfish.dev.java.net/issues/show_bug.cgi?id=13884
      "Please change the test to kill the instance while transaction is
      in the prepare phase to test transaction-recovery.
      Stopped instance can rollback it's connections."

      I disabled the tests with stop instance, the delegated recovery works
      fine on oracle db.

      With looking into the failure in details, inconsistent global tx
      with stop/start cluster instance is observed with or without the delegated recovery.

      I created a target to run tests without admincli delegated recovery as below,
      and run tests for oracle, mysql, or derby in sqe env.

      % cd $SPS_HOME/pe/transaction/recovery/cliweb2
      % ant ee oracle4 all_dbg
      % ant ee mysql all_dbg
      % ant ee all_dbg

      where all_dbg target has 2 tests,
      t4-stopInstanceNoRecovery
      t5-stopStartInstanceRecovery

      t4 passed in all 3 runs.
      t5 failed in 2 runs, but passed in 1 run.

      http://sqe-hudson.sfbay.sun.com:8080/hudson/view/Sherry_v31/job/sherry-txnd-clu-db/

      #19 oracle4, cliweb2, run_dbg
      DB1=oracle, DB2=derby
      [java] Processing line: RESULTS:3
      [java] FAILURE
      [java] did not get expectedResult=RESULTS:6
      [java] - tx-cliweb2-t5-stopStartInstanceRecovery: FAIL -
      [#|2010-10-25T10:06:26.478-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      VerifyServlet,type=two|#]
      [#|2010-10-25T10:06:26.482-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE1 : BBB480801|#]
      [#|2010-10-25T10:06:26.482-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE2 : BBB480802|#]
      [#|2010-10-25T10:06:26.482-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE3 : BBB480803|#]
      [#|2010-10-25T10:06:26.488-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      -------verifyxa, DB1: 3; DB2: 0|#]
      [#|2010-10-25T10:06:26.494-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      two, ret=3|#]

      #20 oracle4, cliweb2, run_dbg
      DB1=mysql, DB2=derby
      [java] - tx-cliweb2-t5-stopStartInstanceRecovery: FAIL -

      [#|2010-10-25T10:28:19.767-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      VerifyServlet,type=two|#]
      [#|2010-10-25T10:28:22.084-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO1 : BBB480801|#]
      [#|2010-10-25T10:28:22.084-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO2 : BBB480802|#]
      [#|2010-10-25T10:28:22.084-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO3 : BBB480803|#]
      [#|2010-10-25T10:28:22.086-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      -------verifyxa, DB1: 0; DB2: 3|#]
      [#|2010-10-25T10:28:22.290-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      two, ret=3|#]

      #21, derby, cliweb2, run_dbg
      DB1=derby, DB2=derby
      [java] - tx-cliweb2-t5-stopStartInstanceRecovery: PASS -

      [#|2010-10-25T10:45:05.578-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      VerifyServlet,type=two|#]

      [#|2010-10-25T10:45:07.652-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE1 : BBB480801|#]

      [#|2010-10-25T10:45:07.653-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE2 : BBB480802|#]

      [#|2010-10-25T10:45:07.653-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBONE3 : BBB480803|#]

      [#|2010-10-25T10:45:07.699-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO1 : BBB480801|#]

      [#|2010-10-25T10:45:07.700-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO2 : BBB480802|#]

      [#|2010-10-25T10:45:07.700-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      Found: BAA48080DBTWO3 : BBB480803|#]

      [#|2010-10-25T10:45:07.700-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      -------verifyxa, DB1: 3; DB2: 3|#]

      [#|2010-10-25T10:45:07.705-0700|INFO|glassfish3.1|null|_ThreadID=15;_ThreadName=Thread-1;|
      two, ret=6|#]

        Activity

        Hide
        marina vatkina added a comment -

        I'm not sure I understand where is the problem.

        Is it that Oracle rolls back a prepared transaction if the instance is stopped
        (i.e. connection.close() is called)?

        Show
        marina vatkina added a comment - I'm not sure I understand where is the problem. Is it that Oracle rolls back a prepared transaction if the instance is stopped (i.e. connection.close() is called)?
        Hide
        marina vatkina added a comment -

        Will need to look at cleaner tx completion on instance stop. This is the same
        behavior as in the prior releases.

        Show
        marina vatkina added a comment - Will need to look at cleaner tx completion on instance stop. This is the same behavior as in the prior releases.

          People

          • Assignee:
            marina vatkina
            Reporter:
            sherryshen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: