Bug 563365 - Error handling problems in the backend functions
Summary: Error handling problems in the backend functions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Database - General
Version: 1.3.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434914
TreeView+ depends on / blocked
 
Reported: 2010-02-09 23:48 UTC by Noriko Hosoi
Modified: 2015-12-07 16:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:30:50 UTC
Embargoed:


Attachments (Terms of Use)
git patch file (25.56 KB, patch)
2010-02-09 23:55 UTC, Noriko Hosoi
nkinder: review+
Details | Diff
git patch file (Directory_Server_8_2_Branch) (21.28 KB, patch)
2010-02-10 01:27 UTC, Noriko Hosoi
no flags Details | Diff
steps in gdb for add operation (3.38 KB, text/plain)
2010-06-04 18:20 UTC, Noriko Hosoi
no flags Details

Description Noriko Hosoi 2010-02-09 23:48:24 UTC
Description of problem:
1) Error handling in ldbm_back_{add,delete,modify,modrdn} functions was incomplete.  When any error occurs after the transaction begins, the changes made after that should be aborted.  There were some cases the abort was not called.
2) If modrdn failed in ldbm_bacK_modrdn, new DN in the DN cache was not removed.

Comment 1 Noriko Hosoi 2010-02-09 23:55:35 UTC
Created attachment 389871 [details]
git patch file

Files:
   ldap/servers/slapd/back-ldbm/id2entry.c
   ldap/servers/slapd/back-ldbm/ldbm_add.c
   ldap/servers/slapd/back-ldbm/ldbm_delete.c
   ldap/servers/slapd/back-ldbm/ldbm_modify.c
   ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
   ldap/servers/slapd/libglobs.c

Description:
1) modified the code so that the changes are aborted if an error is detected in back_ldbm_{add,delete,modify,modrdn}.
2) ldap_back_modrdn deletes DN from the DN cache if the modrdn operation failed.
3) config_set_instancedir has the explicit function type int.

Comment 2 Noriko Hosoi 2010-02-10 01:27:53 UTC
Created attachment 389879 [details]
git patch file (Directory_Server_8_2_Branch)

Files:
 ldap/servers/slapd/back-ldbm/ldbm_add.c
 ldap/servers/slapd/back-ldbm/ldbm_delete.c
 ldap/servers/slapd/back-ldbm/ldbm_modify.c
 ldap/servers/slapd/back-ldbm/ldbm_modrdn.c

Description:
Back ported (1) in the 9.0 fix to 8.2.
1) Error handling in ldbm_back_{add,delete,modify,modrdn} functions was
incomplete.  When any error occurs after the transaction begins, the
changes made after that should be aborted.  There were some cases the
abort was not called.

Comment 3 Noriko Hosoi 2010-02-11 01:24:38 UTC
Reviewed by Nathan (Thank you!!)

Pushed to master as well as Directory_Server_8_2_Branch.

[master]
$ git merge work
Updating f81e7ea..508af98
Fast forward
 ldap/servers/slapd/back-ldbm/id2entry.c    |    2 +-
 ldap/servers/slapd/back-ldbm/ldbm_add.c    |   67 +++++++++++----------------
 ldap/servers/slapd/back-ldbm/ldbm_delete.c |   53 +++++++++++++++------
 ldap/servers/slapd/back-ldbm/ldbm_modify.c |   19 +++++--
 ldap/servers/slapd/back-ldbm/ldbm_modrdn.c |   69 +++++++++++++++++++++-------
 ldap/servers/slapd/libglobs.c              |    1 +
 6 files changed, 132 insertions(+), 79 deletions(-)
$ git push
Counting objects: 23, done.
Delta compression using 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 2.86 KiB, done.
Total 12 (delta 10), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   f81e7ea..508af98  master -> master

[Directory_Server_8_2_Branch]
$ git push origin ds82-local:Directory_Server_8_2_Branch
Counting objects: 19, done.
Delta compression using 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 2.30 KiB, done.
Total 10 (delta 8), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   0fc8628..1ae9a08  ds82-local -> Directory_Server_8_2_Branch

Comment 5 Jenny Severance 2010-06-04 16:35:39 UTC
can you please add steps to verify - thanks!

Comment 6 Noriko Hosoi 2010-06-04 17:29:24 UTC
I'm afraid there are no simple steps to verify this bug.  I ran into this bug when I was working on the subtree rename project.  While the new entryrdn index code was half-baked, it returned unexpected errors and I found the parent functions listed above failed to abort the update request.  Now we cannot expect such failures.  (Plus 8.2 does not include the subtree rename code.)

I would run some update operations against the server attached to the debugger, break in the listed functions and force to take an abort path by setting an error code to some return values.  I guess it's out of QE's interest. :)  If you don't mind, let me verify this bug.

Comment 7 Jenny Severance 2010-06-04 17:45:22 UTC
please do :-)  Thanks Noriko!

Comment 8 Noriko Hosoi 2010-06-04 18:20:56 UTC
Created attachment 421319 [details]
steps in gdb for add operation

Once a fake error code is set, the add operation is correctly aborted.  I also verified that modify, modrdn, and delete work fine.


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