https://bugs.openldap.org/show_bug.cgi?id=9449
Issue ID: 9449 Summary: When the "lockdetect" is setted in slapd.conf, the db deadlock detected policy is setted incorrected Product: OpenLDAP Version: 2.4.57 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: li@lihaitao.cn Target Milestone: ---
I have the "lockdetect random" setted in slapd.conf,the expected deadlock detected policy is "DB_LOCK_RANDOM" but I got the valude "DB_LOCK_EXPIRE".
After many search of the source file, the lockdetect parse source is found on openldap-2.4.57\servers\slapd\back-bdb\config.c :Line 894-903 --------------------- case BDB_LOCKD: rc = verb_to_mask( c->argv[1], bdb_lockd ); if ( BER_BVISNULL(&bdb_lockd[rc].word) ) { fprintf( stderr, "%s: " "bad policy (%s) in "lockDetect <policy>" line\n", c->log, c->argv[1] ); return 1; } bdb->bi_lock_detect = (u_int32_t)rc; break; ---------------------
After analyse the verb_to_mask's return value, the "rc" is the index of the bdb_lockd's setting items. So it can't be passwd to bi_lock_detect. The right value is The "bdb_lockd[rc].mask". I think it is a bug, my recommendation fix is like the next.
bdb->bi_lock_detect = (u_int32_t)rc; -> bdb->bi_lock_detect = bdb_lockd[rc].mask;
https://bugs.openldap.org/show_bug.cgi?id=9449
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |TEST Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to lihaitao from comment #0)
I have the "lockdetect random" setted in slapd.conf,the expected deadlock detected policy is "DB_LOCK_RANDOM" but I got the valude "DB_LOCK_EXPIRE".
The right value is The "bdb_lockd[rc].mask".
You're right. Fixed now in git RE24. Note that back-bdb is deprecated and you should not be using this code any more; it is unlikely that there will be any more 2.4 releases.
https://bugs.openldap.org/show_bug.cgi?id=9449
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- Specifically, migrate to back-mdb and stop using back-bdb.
https://bugs.openldap.org/show_bug.cgi?id=9449
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=9449
--- Comment #3 from lihaitao li@lihaitao.cn --- (In reply to Quanah Gibson-Mount from comment #2)
Specifically, migrate to back-mdb and stop using back-bdb.
Thank you for your advice.
https://bugs.openldap.org/show_bug.cgi?id=9449
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.4.58