Please review: [Bug 745259] Incorrect entryUSN index under high load in replicated environment
by Noriko Hosoi
https://bugzilla.redhat.com/show_bug.cgi?id=745259
https://bugzilla.redhat.com/attachment.cgi?id=530413&action=diff
https://bugzilla.redhat.com/attachment.cgi?id=530413&action=edit
Description:
. Changed the backend entry lock from PR_Lock to PR_Monitor to
allow the re-entrant locking. In ldbm_back_delete and ldbm_
back_modify, backend entry lock was released before calling
be_preop plugins and re-acquired just after that to avoid
the deadlock by the be_preop plugins called from the same
thread. The short no-lock window was the cause of the entry-
usn corruption. By replacing PR_Lock with the re-entrant
PR_Monitor, we could eliminate the no-lock window.
. USN plugin: made add, modify, and modrdn usn plugins
transaction aware.
Note: delete plugins are intact. USN delete operation converts
an entry to a tombstone entry, which is not suitable to move
to inside of the transaction.
Additional changes
. Introduced SLAPI_PLUGIN_BE_TXNABORT_POST_*_FN.
. In ldbm_back_delete, SLAPI_PLUGIN_BE_TXN_PRE/POST_DELETE_FN are
changed to apply just to the normal entries (not to the tombstone
entries).
. Changed the condition to call dblayer_txn_abort from (retry_count
> 0) to (retry_count>= 0) to cover the error in the first trial.
. Cleaned up compiler warnings.
Thanks,
--noriko
11 years, 11 months
Please review (take 3): Reduce the number of DN normalization
by Noriko Hosoi
Special thanks to Rich for his reviews and comments. I introduced
slapi_modify_internal_set_pb_ext to pass Slapi_DN which reduces the
unnecessary Slapi_DN generation and DN normalization. (The attached
patch is gzip'ed.)
Thanks,
--noriko
Reduce the number of DN normalization
. Adding SLAPI_TARGET_SDN as well as its macros, SLAPI_SEARCH_TARGET_
SDN SLAPI_ADD_TARGET_SDN, SLAPI_MODIFY_TARGET_SDN, etc.
. Adding SLAPI_MODRDN_NEWSUPERIOR_SDN.
. SLAPI_TARGET_DN and SLAPI_MODRDN_NEWSUPERIOR are kept for the back-
ward compatibility. But they are marked as deprecated. They are
pointing dn in SLAPI_TARGET_SDN and SLAPI_MODRDN_NEWSUPERIOR_SDN,
respectively.
. slapi_pblock_set(.., SLAPI_TARGET_DN/SLAPI_MODRDN_NEWSUPERIOR, dn)
takes dn string and reset Slapi_DN to SLAPI_TARGET_SDN/SLAPI_MODRDN_
NEWSUPERIOR_SDN.
. slapi_pblock_get(.., SLAPI_TARGET_DN/SLAPI_MODRDN_NEWSUPERIOR, &dn)
retrieves dn out of SLAPI_TARGET_SDN/SLAPI_MODRDN_NEWSUPERIOR_SDN.
. Replacing slapi_dn_normalization_ext call with generating Slapi_DN
APIs (e.g., slapi_sdn_new_dn_...) as much as possible and stash it
in pblock using SLAPI_TARGET_SDN.
. When a normalized DN string is needed, get it using
slapi_sdn_get_[n]dn
from the stashed Slapi_DN.
. Introduced a new field to Slapi_DN.
"udn" for the original DN; "dn" is a normalized DN; "ndn" is a case-
ignored normalized DN.
Taking advantage of the knowledge of the stage of the DN, call the
most efficient DN creating API (e.g., slapi_sdn_new_dn_... vs.
slapi_sdn_new_normdn_... vs. slapi_sdn_new_ndn_...)
Others
. Replacing inefficient array assignment with memset (acl.c) and
memcpy (idl_common.c).
. Fixing invalid memory access in LASDnsBuild
(lib/libaccess/lasdns.cpp).
. Fixing compiler warnings.
11 years, 11 months
Please review: Reduce the number of DN normalization
by Noriko Hosoi
Reduce the number of DN normalization
. Replacing SLAPI_TARGET_DN with SLAPI_TARGET_SDN (also its macros,
e.g., SLAPI_SEARCH_TARGET_SDN and SLAPI_ADD_TARGET_SDN).
. Replacing the type of SLAPI_MODRDN_NEWSUPERIOR from (char *) to
(Slapi_DN *), as well.
. Replacing slapi_dn_normalization_ext call with generating Slapi_DN
APIs (e.g., slapi_sdn_new_dn_...) as much as possible and stash it
in pblock using SLAPI_TARGET_SDN.
. When a normalized DN string is needed, get it using slapi_sdn_get_[n]dn
from the stashed Slapi_DN.
. Introduced a new field to Slapi_DN.
"udn" for the original DN; "dn" is a normalized DN; "ndn" is a case-
ignored normalized DN.
Taking advantage of the knowledge of the stage of the DN, call the
most efficient DN creating API (e.g., slapi_sdn_new_dn_... vs.
slapi_sdn_new_normdn_... vs. slapi_sdn_new_ndn_...)
Others
. Replacing inefficient array assignment with memset (acl.c) and
memcpy (idl_common.c).
. Fixing invalid memory access in LASDnsBuild (lib/libaccess/lasdns.cpp).
. Even if Slapi_counter is disabled, the server is allowed to start
(back-ldbm/cache.c).
. Fixing compiler warnings.
Sorry, it's huge...
11 years, 11 months
Please review: convert memberof to use transactions
by Rich Megginson
There are 3 patches. 0001 fixes a problem with betxn and modrdn to make
the ENTRY_POST_OP available to betxnpostop plugins. 0002 allows us to
pass the plugin config entry to plugin_init functions (yay! finally!).
0003 is the actual change to memberof.
11 years, 11 months