Преглед на файлове

Ticket #47874 - Performance degradation with scope ONE after some load

Bug Description: Backend has a bit to indicate "should not bypass
the filter test".  It's set if one of the search results is ALLID
in idl_intersection.  Once the flag is set, it's never been unset.
It makes the following one level searches slow down.

Fix Description: Introduced slapi_be_unset_flag and unset the bit
at the end of every search.

https://fedorahosted.org/389/ticket/47874

Reviewed by [email protected] (Thank you, Rich!!)
Noriko Hosoi преди 11 години
родител
ревизия
8e1345ab92
променени са 3 файла, в които са добавени 14 реда и са изтрити 3 реда
  1. 5 0
      ldap/servers/slapd/back-ldbm/ldbm_search.c
  2. 8 3
      ldap/servers/slapd/backend.c
  3. 1 0
      ldap/servers/slapd/slapi-plugin.h

+ 5 - 0
ldap/servers/slapd/back-ldbm/ldbm_search.c

@@ -183,6 +183,11 @@ ldbm_back_search_cleanup(Slapi_PBlock *pb,
 
     slapi_pblock_get( pb, SLAPI_BACKEND, &be );
     inst = (ldbm_instance *) be->be_instance_info;
+    /* 
+     * In case SLAPI_BE_FLAG_DONT_BYPASS_FILTERTEST is set, 
+     * clean it up for the following sessions.
+     */
+    slapi_be_unset_flag(be, SLAPI_BE_FLAG_DONT_BYPASS_FILTERTEST);
     CACHE_RETURN(&inst->inst_cache, &e); /* NULL e is handled correctly */
     if (inst->inst_ref_count) {
         slapi_counter_decrement(inst->inst_ref_count);

+ 8 - 3
ldap/servers/slapd/backend.c

@@ -580,13 +580,18 @@ slapi_be_setentrypoint(Slapi_Backend *be, int entrypoint, void *ret_fnptr, Slapi
 }
 
 int slapi_be_is_flag_set(Slapi_Backend * be, int flag)
-{ 
+{
     return be->be_flags & flag;
 }
 
 void slapi_be_set_flag(Slapi_Backend * be, int flag)
-{ 
-    be->be_flags|= flag;
+{
+    be->be_flags |= flag;
+}
+
+void slapi_be_unset_flag(Slapi_Backend * be, int flag)
+{
+    be->be_flags &= ~flag;
 }
 
 char * slapi_be_get_name(Slapi_Backend * be)

+ 1 - 0
ldap/servers/slapd/slapi-plugin.h

@@ -6429,6 +6429,7 @@ int slapi_is_ldapi_conn(Slapi_PBlock *pb);
 
 int slapi_be_is_flag_set(Slapi_Backend * be, int flag);
 void slapi_be_set_flag(Slapi_Backend * be, int flag);
+void slapi_be_unset_flag(Slapi_Backend * be, int flag);
 #define SLAPI_BE_FLAG_REMOTE_DATA   0x1  /* entries held by backend are remote */
 #define SLAPI_BE_FLAG_DONT_BYPASS_FILTERTEST   0x10  /* force to call filter_test (search only) */