Bug 979170 - ruv modify context problem with cache_replace
ruv modify context problem with cache_replace
Status: CLOSED DUPLICATE of bug 972976
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base (Show other bugs)
6.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Rich Megginson
Sankar Ramalingam
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-27 15:50 EDT by Rich Megginson
Modified: 2013-06-28 15:58 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-28 15:58:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rich Megginson 2013-06-27 15:50:58 EDT
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/47404

This causes errors like this in the errors log:

ldbm_back_add: modify_switch_entries failed
and
ldbm_back_modify: modify_switch_entries failed

The problem is that the struct _modify_context->old_entry can be removed from the cache between the call to ldbm_txn_ruv_modify_context() and the call to modify_switch_entries(), by a BETXN PRE Op plugin.  Consider the following:

{{{
outer add:
ldbm_txn_ruv_modify_context:
mc->old_e = cached RUV ID = N DN = A
mc->new_e = not cached
  betxnpreop - inner mod
  ldbm_txn_ruv_modify_context:
  mc->old_e = cached RUV ID = N DN = A # points to same cache entry as above old_e
  mc->new_e = not cached
  ... do op - call modify_update_all()
  ... success ...
  modify_switch_entries - cache_replace old_e, new_e
    delete RUV ID from ID hash
    delete RUV DN from DN hash
    add new_e to RUV ID hash
    add new_e to RUV DN hash
    mark old_e as DELETED
    new_e refcnt == 1 # NOTE: should this be new_e refcnt = old_e refcnt instead?
  cache_return new_e - entrycache_return
    new_e->refcnt-- # now 0
    if (not DELETED)
      add new_e to lru list
      if (CACHE_FULL) # TRUE - cache is full
        entrycache_flush - iterate through lru list
          entrycache_remove_int new_e
            remove RUV ID from ID hash
            remove RUV DN from DN hash
            mark new_e as DELETED
            # NOTE: at this point, there is no RUV ID or DN in cache!
    backentry_free(new_e)
outer
modify_switch_entries - cache_replace old_e, new_e
  remove_hash RUV ID - FAIL
  remove_hash RUV DN - FAIL
  return 1 - FAIL
}}}
This most commonly happens with DNA as DNA is the only BETXN PREOP (in 1.2.11) that modifies the database.
After the call to the BETXN PREOP, we need to make sure mc->old_entry still points to something - not sure how best to do that.
Comment 1 Nathan Kinder 2013-06-28 15:58:10 EDT

*** This bug has been marked as a duplicate of bug 972976 ***

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