0594d5f Ticket #289 - allow betxn plugin config changes

Authored and Committed by rmeggins 12 years ago
    Ticket #289 - allow betxn plugin config changes
    
    https://fedorahosted.org/389/ticket/289
    Resolves: Ticket #289
    Bug Description: allow betxn plugin config changes
    Reviewed by: nhosoi (Thanks!)
    Branch: master
    Fix Description: Some plugins use pre/post op callbacks for both dse
    entries and regular database entries.  We could not just make them betxn
    callback because the DSE code does not know about betxn nor be plugins.
    This changes the DSE code to be able to call both be and betxn plugins.
    Since there are no transactions in the DSE backend we call the callbacks
    in this order:
    dse preop callbacks
    if (success)
      be preop plugins
    if (success)
      be txn preop plugins
    if (success)
      do the operation
    if (success)
      dse postop callbacks
    set RESULT_CODE and OPRETURN
    be txn postop plugins
    if (be preop plugins were called)
      be postop plugins
    
    In general, we only call be preop and be txn preop if the previous callbacks
    and other checking succeeded.  We always call the be and be txn postop
    callbacks, even upon error, because there are some be and be txn postops
    that need to know if there was an error so they can "rollback" - usn, dna,
    replication to cancel pending csn, etc.
    
    The hard part was making similar semantics so that you could call regular
    pre/post op plugins as be or betxn plugins.  Some plugins look at
    SLAPI_PLUGIN_OPRETURN and some look at SLAPI_RESULT_CODE to determine if
    the preops and main operations failed.  The code had to ensure that both
    of these were set to reasonable values before calling any type of postop
    plugins.
    
    As a result of this change, we can, in general, turn any pre/post op plugin
    into a betxn pre/post op plugin and expect it to work as before.  There will
    be some plugins that require special handling (e.g. dna, replication).
    Platforms tested: RHEL6 x86_64, Fedora 16
    Flag Day: no
    Doc impact: no
    
        
file modified
+382 -202
file modified
+4 -0