dsdb-schema: do not reload more often than schema_reload_interval
authorMatthieu Patou <mat@matws.net>
Thu, 10 May 2012 05:08:55 +0000 (22:08 -0700)
committerMatthieu Patou <mat@matws.net>
Sat, 23 Jun 2012 06:16:04 +0000 (23:16 -0700)
commit1521bb95a7bb3df5cb3a128085a088cb09555f8b
treea2a28b508601ccf25078b215c519950a72319287
parentf8fd615c5950bab9a38cd31872ae447ffdc974f3
dsdb-schema: do not reload more often than schema_reload_interval

Samba 4 use to try to reload the schema every time dsdb_get_schema was
called (which could be 20+ time per ldb request). Now we only reload at
most every xx seconds (xx being the value of dsdb:"schema_reload_interval"
 or 120). The timestamp of the last reloaded schema is kept in the
 dsdb_schema object. There is also a timestamp in the ldb_context, that
 is used by the LDAP server to know if it has to reload the schema after
 handling the request. This is used to allow that the schema will be
 immediately reload after a schemaUpdateNow request has been issued, the
 reload can't occur in the handling of the LDAP request itself because
 we have a transaction autostarted.
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_load.c
source4/dsdb/samdb/samdb.h
source4/dsdb/schema/schema.h
source4/ldap_server/ldap_backend.c