[SSSD] [PATCH] Perform fewer transactions during RFC2307bis initgroups
Stephen Gallagher
sgallagh at redhat.com
Mon Oct 17 14:22:07 UTC 2011
On Mon, 2011-10-17 at 13:26 +0200, Jakub Hrozek wrote:
> https://fedorahosted.org/sssd/ticket/1006
>
> Instead of saving each group as we fetch it from LDAP during initgroups,
> just build the membership diff in-memory and the perform three
> transactions:
> * save the groups if not cached already
> * save the intergroup memberships
> * save the user membership to his direct parents
>
> [PATCH 1/3] Utility functions for LDAP nested schema initgroups
> These will be used later on
Nack.
If the sysdb_transaction_commit() fails, you need to at least try to
call sysdb_transaction_cancel() (otherwise we could be left with a
transaction lock that we never free).
>
> [PATCH 2/3] Use fewer transactions during RFC2307bis initgroups
> Save the groups to a hash table and save them in three transactions
> later
>
Nack.
Instead of using three separate transactions in
sdap_initgr_rfc2307bis_done(), wrap the save_* calls in a new outer
transaction. Then they'll only get written to disk once with all the
data.
So just call sysdb_transaction_start() before save_rfc2307bis_groups()
and then call sysdb_transaction_commit() before tevent_req_done(); (And
obviously handle errors and cancel the outer transaction as needed).
> [PATCH 3/3] Use fewer transactions during IPA initgroups
> No need for a hash table because we can grab all the groups in a single
> request. Just save them in a way similar to RFC2307bis initgroups
Same comment about transactions as patch 2.
Otherwise, these look good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20111017/8c46c264/attachment.sig>
More information about the sssd-devel
mailing list