Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 979170 - ruv modify context problem with cache_replace
Summary: ruv modify context problem with cache_replace
Status: CLOSED DUPLICATE of bug 972976
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Sankar Ramalingam
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-27 19:50 UTC by Rich Megginson
Modified: 2020-09-13 20:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-06-28 19:58:10 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 741 0 None None None 2020-09-13 20:36:58 UTC

Description Rich Megginson 2013-06-27 19:50:58 UTC
This bug is created as a clone of upstream ticket:

This causes errors like this in the errors log:

ldbm_back_add: modify_switch_entries failed
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:
mc->old_e = cached RUV ID = N DN = A
mc->new_e = not cached
  betxnpreop - inner mod
  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!
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 19:58:10 UTC

*** 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.