Univention Bugzilla – Attachment 3139 Details for
Bug 18619
Performance-Optimierung des AD Connectors in grossen Umgebungen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ad-connector-performance_mapping-poll.patch
ad-connector-performance_mapping-poll.patch (text/plain), 5.77 KB, created by
Stefan Gohmann
on 2011-03-24 13:54:13 CET
(
hide
)
Description:
ad-connector-performance_mapping-poll.patch
Filename:
MIME Type:
Creator:
Stefan Gohmann
Created:
2011-03-24 13:54:13 CET
Size:
5.77 KB
patch
obsolete
>Index: debian/changelog >=================================================================== >--- debian/changelog (Revision 23156) >+++ debian/changelog (Arbeitskopie) >@@ -1,3 +1,15 @@ >+univention-ad-connector (5.0.18-1) unstable; urgency=low >+ >+ * mapping.py: Remove object_memberships_sync_from_ucs from the list of >+ post_con_modify_functions because the group object will changed if >+ the groupmember ship was changed on UCS. This will improve the sync >+ performance (Bug #21010, Bug #18619) >+ * poll_ucs: Create a list of all DNs which should be synced in this >+ run. If the DN will synced later skip the sync for this object at >+ this point (Bug #21010, Bug #18619) >+ >+ -- Stefan Gohmann <gohmann@univention.de> Thu, 24 Mar 2011 13:46:20 +0100 >+ > univention-ad-connector (5.0.17-1) unstable; urgency=low > > * fixed name of connector/ad/mapping/group/language in umc module (Bug #20195) >Index: conffiles/etc/univention/connector/ad/mapping.py >=================================================================== >--- conffiles/etc/univention/connector/ad/mapping.py (Revision 23156) >+++ conffiles/etc/univention/connector/ad/mapping.py (Arbeitskopie) >@@ -101,7 +101,6 @@ > post_con_modify_functions=[ univention.connector.ad.set_userPrincipalName_from_ucr, > univention.connector.ad.password.password_sync_ucs, > univention.connector.ad.primary_group_sync_from_ucs, >- univention.connector.ad.object_memberships_sync_from_ucs, > univention.connector.ad.disable_user_from_ucs, > ], > >Index: modules/univention/connector/__init__.py >=================================================================== >--- modules/univention/connector/__init__.py (Revision 23156) >+++ modules/univention/connector/__init__.py (Arbeitskopie) >@@ -471,6 +471,12 @@ > > dn,new,old,old_dn=cPickle.load(f) > >+ try: >+ ud.debug(ud.LDAP, ud.PROCESS, "Synchronize: %s" % dn) >+ except: >+ ud.debug(ud.LDAP, ud.PROCESS, "Synchronize: object from file %s" % filename) >+ pass >+ > def recode_attribs(attribs): > nattribs={} > for key in attribs.keys(): >@@ -683,7 +689,27 @@ > # dummy > pass > >- >+ def _generate_dn_list_from(self, files): >+ ''' >+ Save all filenames in a dictonary with dn as key >+ If more than one pickle file was created for one DN we could skip the first one >+ ''' >+ self.dn_list = {} >+ for listener_file in files: >+ filename = os.path.join(self.listener_dir, listener_file) >+ if not filename == "%s/tmp" % self.baseConfig['%s/ad/listener/dir' % self.CONFIGBASENAME]: >+ if not filename in self.rejected_files: >+ try: >+ f=file(filename,'r') >+ except IOError: # file not found so there's nothing to sync >+ continue >+ >+ dn,new,old,old_dn=cPickle.load(f) >+ if not self.dn_list.get(dn): >+ self.dn_list[dn]=[filename] >+ else: >+ self.dn_list[dn].append(filename) >+ > def poll_ucs(self): > ''' > poll changes from UCS: iterates over files exported by directory-listener module >@@ -693,7 +719,7 @@ > > change_counter = 0 > >- rejected_files = self._list_rejected_filenames_ucs() >+ self.rejected_files = self._list_rejected_filenames_ucs() > > print "--------------------------------------" > print "try to sync %s changes from UCS" % (len(os.listdir(self.listener_dir))-1) >@@ -702,34 +728,55 @@ > done_counter = 0 > files = os.listdir(self.listener_dir) > files.sort() >+ >+ # Create a dictonary with all DNs >+ self._generate_dn_list_from(files) >+ > for listener_file in files: > sync_successfull = False > delete_file = False > filename = os.path.join(self.listener_dir, listener_file) > if not filename == "%s/tmp" % self.baseConfig['%s/ad/listener/dir' % self.CONFIGBASENAME]: >- if not filename in rejected_files: >+ if not filename in self.rejected_files: > try: >- sync_successfull = self.__sync_file_from_ucs(filename) >- except (ldap.SERVER_DOWN, SystemExit): >- raise >- except: # FIXME: which exception is to be caught? >- self._save_rejected_ucs(filename, 'unknown') >- self._debug_traceback(ud.WARN, >- "sync failed, saved as rejected \n\t%s" % filename) >- if sync_successfull: >- os.remove(os.path.join(self.listener_dir,listener_file)) >- change_counter += 1 >+ f=file(filename,'r') >+ except IOError: # file not found so there's nothing to sync >+ continue > >+ dn,new,old,old_dn=cPickle.load(f) >+ >+ if len(self.dn_list.get(dn, [])) < 2: >+ # If the list contains more then one file, the DN will be synced later >+ try: >+ sync_successfull = self.__sync_file_from_ucs(filename) >+ except (ldap.SERVER_DOWN, SystemExit): >+ raise >+ except: # FIXME: which exception is to be caught? >+ self._save_rejected_ucs(filename, 'unknown') >+ self._debug_traceback(ud.WARN, >+ "sync failed, saved as rejected \n\t%s" % filename) >+ if sync_successfull: >+ os.remove(os.path.join(self.listener_dir,listener_file)) >+ change_counter += 1 >+ else: >+ try: >+ ud.debug(ud.LDAP, ud.PROCESS, 'Drop %s. The DN %s will synced later' % (filename, dn)) >+ except: >+ ud.debug(ud.LDAP, ud.PROCESS, 'Drop %s. The object will synced later' % (filename)) >+ >+ if self.dn_list.get(dn): >+ self.dn_list[dn].remove(filename) >+ > done_counter += 1 > print "%s"%done_counter, > sys.stdout.flush() > > print "" > >- rejected_files = self._list_rejected_filenames_ucs() >+ self.rejected_files = self._list_rejected_filenames_ucs() > >- if rejected_files: >- print "Changes from UCS: %s (%s saved rejected)" % (change_counter, len(rejected_files)) >+ if self.rejected_files: >+ print "Changes from UCS: %s (%s saved rejected)" % (change_counter, len(self.rejected_files)) > else: > print "Changes from UCS: %s (%s saved rejected)" % (change_counter, '0') > print "--------------------------------------"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18619
: 3139 |
3291
|
3292