Karaf
  1. Karaf
  2. KARAF-689

Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.1.6, 2.2.2, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None
    • Environment:

      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

      Description

      When running Karaf in Master/Slave mode a Karaf instance can wrongly obtain a lock when the locking table is empty on a Oracle DB.
      Karaf creates a lock table and a lock record in de OracleDB upon first usage. When the lock record is removed afterwards without dropping the table then the locking mechanisme does not work anymore and any instance can wrongly obtain a lock.

      This is not an issue for other database systems, because the implementation for other DB systems periodically tries to update the lock record and verify how many records are updated. According to the documentation in the code the "update" functionality has been removed for Oracle because it can exhaust the Oracle UNDO log.

      I created a patch which does not use the "update" functionality, but executes an extra check after we acquired the lock. It checks if the SELECT FOR UPDATE used for the lock has not been executed on an empty selection, because when the selection is empty then the locking functionality will not work as expected.

      Can you apply this patch to the branches karaf-2.1.x and karaf-2.2.x and the trunk. I looked at the SVN history of the files I have modified and noticed that they are the same in both branches and the trunk.
      The patch has been created against the karaf-2.1.x branch.

      1. patch.txt
        9 kB
        Ton Swieb
      2. patch.txt
        9 kB
        Ton Swieb

        Activity

        Ton Swieb created issue -
        Ton Swieb made changes -
        Field Original Value New Value
        Attachment patch.txt [ 12483930 ]
        Jamie goodyear made changes -
        Assignee Jamie goodyear [ jgoodyear ]
        Jamie goodyear made changes -
        Fix Version/s 2.1.6 [ 12316340 ]
        Fix Version/s 2.2.2 [ 12316339 ]
        Fix Version/s 3.0.0 [ 12316040 ]
        Jamie goodyear made changes -
        Attachment karaf689.txt [ 12483934 ]
        Jamie goodyear made changes -
        Comment [ test ]
        Jamie goodyear made changes -
        Attachment karaf689.txt [ 12483934 ]
        Ton Swieb made changes -
        Attachment patch.txt [ 12483935 ]
        Jamie goodyear made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Jamie goodyear made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jamie goodyear made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jamie goodyear
            Reporter:
            Ton Swieb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development