Bug 848384 - ORA-02049 (locking issue) during upgrade of AS7 plugin with Oracle
Summary: ORA-02049 (locking issue) during upgrade of AS7 plugin with Oracle
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.4
Hardware: i386
OS: All
high
urgent
Target Milestone: ---
: RHQ 4.5.0
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 846353
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-15 13:11 UTC by Jay Shaughnessy
Modified: 2013-09-01 10:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 846353
Environment:
Last Closed: 2013-09-01 10:03:58 UTC
Embargoed:


Attachments (Terms of Use)

Comment 1 Jay Shaughnessy 2012-08-15 13:15:59 UTC
master commit c9eb53bb8dab7393d9b5383fbe5bab99088487ed

    After a lot of investigation it seems that the problem occurs occasionally
    when we remove obsolete properties from resource configuration.  It does
    not happen every time, in fact it's fairly rare, although for the same DB,
    and the same plugin update, it is repeatable.  This makes it seem like the
    locking issue is due mainly to unpredictable locking at the db level, and
    likely the fact that we occasionally hit a page lock due to some other
    prior update to the config table.  Since the config table stores so many
    different types of data it's not obvious how we would identify the conflict.
    
    The approach taken was to try and reduce possible conflict by increasing the
    granularity of metadata update transactions.  Prior to this change we used a
    single encompassing transaction for a plugin update, that means all types
    were updated under one umbrella transaction.  Not one transaction, because
    we already use nested transactions in several places, but using one umbrella
    transaction increases the chance of that transaction holding a lock that
    could affect a nested transaction.
    
    We still maintain the umbrella transaction but this commit breaks it up
    such that a nested transaction is used for the update of each resource
    type in the plugin.
    
    That means each type update will not hold any locks when it has completed.
    This change seems to be working as the AS7 plugin now updates successfully.
    
    Additionally:
    - added some more INFO level logging to give some basic progress during a
      plugin update.
    - added some more debug logging as well
    - removed a bunch of unnecessary em.flush calls
    - used the return value of some em.merge calls to ensure using the up to
      date entity.


Test Notes:
Upgrades of as many plugin plugins as possible from older versions to latest (4.5 versions) for oracle and postgres.  If possible, data in inventory will make the test even more robust, although it was not necessary for the original issue.

Comment 2 Heiko W. Rupp 2013-09-01 10:03:58 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.


Note You need to log in before you can comment on or make changes to this bug.