Hi Andrew,

There is currently no configuration parameter to disable sorting when applying a policy in robinhood. I agree this is something that would be useful, so I keep it in mind for next releases.

Take care that your local modification is not enough and may result in incomplete purges in particular if the number of entries to be purged exceeds "db_result_size_max" (default 100.000).

In attachment is a more complete patch to prevent this.

Regards,
Thomas

On 04/07/15 07:05, Andrew Elwell wrote:
Given that we don't care about starting with the oldest, is there a
command line option or some config to stop the sorting?

or, do I have to remove it from the source in
./src/policy_modules/purge/resmon_purge.c
For info, I've just done a trivial hack on this and recompiled.
Staggering difference in performance

aelwell@magnus-2:~/GIT_Sources/robinhood/src/policy_modules/purge
(nosort)$ git diff ./resmon_purge.c
diff --git a/src/policy_modules/purge/resmon_purge.c
b/src/policy_modules/purge/resmon_purge.c
index 7cda375..49c9bd9 100644
--- a/src/policy_modules/purge/resmon_purge.c
+++ b/src/policy_modules/purge/resmon_purge.c
@@ -474,7 +474,7 @@ int perform_purge(lmgr_t *lmgr, purge_param_t
*p_purge_param,

      /* sort by last access */
      sort_type.attr_index = ATTR_INDEX_last_access;
-    sort_type.order = SORT_ASC;
+    sort_type.order = SORT_NONE;

      rc = lmgr_simple_filter_init( &filter );
      if ( rc )

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
robinhood-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/robinhood-support

diff --git a/src/policy_modules/purge/resmon_purge.c b/src/policy_modules/purge/resmon_purge.c
index 7cda375..e9bdb89 100644
--- a/src/policy_modules/purge/resmon_purge.c
+++ b/src/policy_modules/purge/resmon_purge.c
@@ -156,7 +156,7 @@ static void FreePurgeItem( purge_item_t * item )
     MemFree( item );
 }
 
-
+#if 0
 static int heuristic_end_of_list( time_t last_access_time )
 {
     entry_id_t     void_id;
@@ -202,6 +202,7 @@ static int heuristic_end_of_list( time_t last_access_time )
     else
         return FALSE;
 }
+#endif
 
 
 /**
@@ -396,7 +397,7 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
 
     enum { TGT_BLOCK, TGT_COUNT, TGT_ALL } target_type;
 
-    int            last_entry_access = 0;
+//    int            last_entry_access = 0;
     time_t         last_request_time = 0;
     int            attr_mask_sav;
     int            end_of_list = FALSE;
@@ -474,7 +475,7 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
 
     /* sort by last access */
     sort_type.attr_index = ATTR_INDEX_last_access;
-    sort_type.order = SORT_ASC;
+    sort_type.order = SORT_NONE;
 
     rc = lmgr_simple_filter_init( &filter );
     if ( rc )
@@ -732,12 +733,14 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
                     break;
                 }
 
+#if 0
                 /* no new useless request */
                 if ( heuristic_end_of_list( last_entry_access ) )
                 {
                     end_of_list = TRUE;
                     break;
                 }
+#endif
 
                 /* Free previous iterator */
                 ListMgr_CloseIterator( it );
@@ -764,6 +767,7 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
                 if ( rc )
                     return rc;
 
+#if 0
                 /* filter on access time */
                 fval.value.val_int = last_entry_access;
                 rc = lmgr_simple_filter_add_or_replace( &filter,
@@ -772,12 +776,12 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
                                                         FILTER_FLAG_ALLOW_NULL);
                 if ( rc )
                     return rc;
+#endif
 
                 DisplayLog( LVL_DEBUG, PURGE_TAG,
                             "Performing new request with a limit of %u entries"
-                            " and access >= %d and md_update < %ld ",
-                            opt.list_count_max, last_entry_access,
-                            last_request_time );
+                            " and md_update < %ld ",
+                            opt.list_count_max, last_request_time );
 
                 nb_returned = 0;
                 it = ListMgr_Iterator( lmgr, &filter, &sort_type, &opt );
@@ -802,8 +806,10 @@ int perform_purge(lmgr_t *lmgr, purge_param_t *p_purge_param,
 
             nb_returned++;
 
+#if 0
             if ( ATTR_MASK_TEST( &attr_set, last_access ) )
                 last_entry_access = ATTR( &attr_set, last_access );
+#endif
 
             if ( target_type == TGT_BLOCK )
             {
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
robinhood-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/robinhood-support

Reply via email to