dbfab50 Ticket 47451 - add/enable/disable/remove plugins without server restart

Authored and Committed by mreynolds 10 years ago
71 files changed. 2920 lines added. 1167 lines removed.
ldap/ldif/template-dse.ldif.in
file modified
+1 -0
ldap/schema/01core389.ldif
file modified
+1 -0
ldap/servers/plugins/acct_usability/acct_usability.c
file modified
+1 -8
ldap/servers/plugins/acctpolicy/acct_config.c
file modified
+9 -0
ldap/servers/plugins/acctpolicy/acct_init.c
file modified
+19 -0
ldap/servers/plugins/acctpolicy/acctpolicy.h
file modified
+1 -0
ldap/servers/plugins/acl/acl.h
file modified
+1 -0
ldap/servers/plugins/acl/acl_ext.c
file modified
+15 -1
ldap/servers/plugins/acl/aclgroup.c
file modified
+2 -2
ldap/servers/plugins/acl/aclplugin.c
file modified
+1 -0
ldap/servers/plugins/automember/automember.c
file modified
+21 -114
ldap/servers/plugins/chainingdb/cb.h
file modified
+4 -3
ldap/servers/plugins/chainingdb/cb_close.c
file modified
+47 -29
ldap/servers/plugins/chainingdb/cb_instance.c
file modified
+29 -31
ldap/servers/plugins/cos/cos.c
file modified
+2 -1
ldap/servers/plugins/cos/cos_cache.c
file modified
+7 -7
ldap/servers/plugins/deref/deref.c
file modified
+1 -8
ldap/servers/plugins/dna/dna.c
file modified
+12 -58
ldap/servers/plugins/linkedattrs/fixup_task.c
file modified
+11 -14
ldap/servers/plugins/linkedattrs/linked_attrs.c
file modified
+11 -59
ldap/servers/plugins/linkedattrs/linked_attrs.h
file modified
+3 -0
ldap/servers/plugins/memberof/memberof.c
file modified
+15 -25
ldap/servers/plugins/memberof/memberof.h
file modified
+3 -1
ldap/servers/plugins/memberof/memberof_config.c
file modified
+36 -11
ldap/servers/plugins/mep/mep.c
file modified
+11 -52
ldap/servers/plugins/pam_passthru/pam_passthru.h
file modified
+2 -1
ldap/servers/plugins/pam_passthru/pam_ptconfig.c
file modified
+9 -0
ldap/servers/plugins/pam_passthru/pam_ptimpl.c
file modified
+9 -0
ldap/servers/plugins/pam_passthru/pam_ptpreop.c
file modified
+7 -34
ldap/servers/plugins/passthru/passthru.h
file modified
+5 -0
ldap/servers/plugins/passthru/ptconfig.c
file modified
+253 -230
ldap/servers/plugins/passthru/ptpreop.c
file modified
+8 -7
ldap/servers/plugins/posix-winsync/posix-group-func.c
file modified
+7 -0
ldap/servers/plugins/posix-winsync/posix-group-func.h
file modified
+1 -0
ldap/servers/plugins/posix-winsync/posix-winsync-config.c
file modified
+23 -0
ldap/servers/plugins/posix-winsync/posix-winsync.c
file modified
+124 -4
ldap/servers/plugins/posix-winsync/posix-wsp-ident.h
file modified
+5 -0
ldap/servers/plugins/referint/referint.c
file modified
+13 -10
ldap/servers/plugins/retrocl/retrocl.c
file modified
+14 -18
ldap/servers/plugins/retrocl/retrocl_po.c
file modified
+6 -7
ldap/servers/plugins/roles/roles_cache.c
file modified
+10 -2
ldap/servers/plugins/roles/roles_plugin.c
file modified
+17 -3
ldap/servers/plugins/rootdn_access/rootdn_access.c
file modified
+17 -10
ldap/servers/plugins/schema_reload/schema_reload.c
file modified
+25 -10
ldap/servers/plugins/statechange/statechange.c
file modified
+41 -7
ldap/servers/plugins/sync/sync.h
file modified
+1 -0
ldap/servers/plugins/sync/sync_init.c
file modified
+4 -1
ldap/servers/plugins/sync/sync_persist.c
file modified
+32 -11
ldap/servers/plugins/sync/sync_refresh.c
file modified
+11 -0
ldap/servers/plugins/usn/usn.c
file modified
+13 -14
ldap/servers/plugins/usn/usn.h
file modified
+0 -1
ldap/servers/plugins/usn/usn_cleanup.c
file modified
+3 -10
ldap/servers/plugins/views/views.c
file modified
+86 -25
ldap/servers/plugins/whoami/whoami.c
file modified
+4 -1
ldap/servers/slapd/apibroker.c
file modified
+2 -0
ldap/servers/slapd/config.c
file modified
+7 -4
ldap/servers/slapd/configdse.c
file modified
+1 -1
ldap/servers/slapd/dse.c
file modified
+270 -19
ldap/servers/slapd/factory.c
file modified
+110 -100
ldap/servers/slapd/fedse.c
file modified
+24 -24
ldap/servers/slapd/libglobs.c
file modified
+31 -0
ldap/servers/slapd/main.c
file modified
+7 -1
ldap/servers/slapd/plugin.c
file modified
+1280 -156
ldap/servers/slapd/proto-slap.h
file modified
+12 -2
ldap/servers/slapd/result.c
file modified
+0 -1
ldap/servers/slapd/schema.c
file modified
+5 -5
ldap/servers/slapd/slap.h
file modified
+11 -0
ldap/servers/slapd/slapi-plugin.h
file modified
+55 -0
ldap/servers/slapd/task.c
file modified
+34 -18
ldap/servers/slapd/thread_data.c
file modified
+53 -3
ldap/servers/slapd/tools/pwenc.c
file modified
+4 -3
    Ticket 47451 - add/enable/disable/remove plugins without server restart
    
    Previous Design:  All plugins were only loaded at startup.  A global plugin list,
                      a shutdown list, and plugin DN hash are created.
    
    New Design:       The lists/hash are now all protected by a r/w lock.  The read lock
                      is only used when calling plugin_call_func(), the write lock is used
                      for adding and removing plugins.  Since plugins can call plugins,
                      etc, the locking in the plugin_call_* functions is determined by
                      the use of local thread storage: is locked, or is not locked.
                      This mechanism prevents deadlocks.
    
                      Plugin updates(add, mod, delete) happen in the pre op stage of a
                      dse update, so that we can reject the update before the config is
                      updated, otherwise at the next server restart the server might
                      unexpectedly fail to start.
    
                      Plugins can now be added/enabled and deleted/disabled dynamically.
                      All plugin configuration (libpath, type, precedence, etc) is now
                      updated dynamically, unless that change breaks something.  Then it
                      is not dynamically applied, but it is still written to the dse.ldif.
    
                      A new internal reference counter has been added to plugin_call_func().
                      These are used to keep track of the active number of concurrent
                      operations being performed by the plugin.  This is used when disabling
                      a plugin or server shutdown - so that we do not free global locks and
                      config while there are still operations using them.  Since tasks do not
                      have access to the slapd plugin structure(for the plugin operation count),
                      they have their own ref counter where needed.  This task counter is
                      implemented when the task is created using slapi_plugin_task_new(),
                      instead of slapi_task_new(). Also, slapi_task_register_handler, needs
                      to be replaced with slapi_plugin_task_register_handler().
    
                      Plugins that register callbacks shouldi not use slapi_config_register_callback(),
                      and now use slapi_config_register_callback_plugin() - which takes
                      the pblock so the reference counters can be updated.
    
                      Plugins that create object extensions must also unregister those
                      extensions in the CLOSE function, as same goes for config callbacks.
    
                      This feature can also be turned on/off via "nsslapd-dynamic-pluings: on|off"
    
    https://fedorahosted.org/389/ticket/47451
    
    Jenkins: Passed.
    Coverity: Passed.
    Valgrind: Passed.
    
    Reviewed by: rmeggins(Thanks!!)
    
        
file modified
+1 -0
file modified
+12 -58
file modified
+11 -52
file modified
+13 -14
file modified
+7 -4
file modified
+270 -19
file modified
+110 -100
file modified
+24 -24
file modified
+31 -0
file modified
+7 -1
file modified
+1280 -156
file modified
+0 -1
file modified
+5 -5
file modified
+11 -0
file modified
+34 -18