41708e1 SYSDB: Introduce _search_{users,groups}_by_timestamp()

2 files Authored by fidencio 6 years ago, Committed by jhrozek 6 years ago,
    SYSDB: Introduce _search_{users,groups}_by_timestamp()
    
    These new two sysdb methods are going to be used, at least for now,
    uniquely and exclusively in the cleanup task.
    
    The reason for adding those is that during the cleanup task a timestamp
    search is done in the persistent cache, which doesn't have the updated
    timestamps, returning then a wrong result that ends up in having all the
    users being removed from the cache.
    
    The persistent cache doesn't have its entries' timestamps updated
    because those are kept updated in the timestamp cache, therefore these
    new two methods end up doing:
    - if the timestamp cache is present:
      - search for the entries solely in the timestamp cache;
      - get the needed attributes from these entries from the persistent
        cache;
    - otherwise:
      - search for the entries in the persistent cache;
      - merge its results with timestamp cache's results;
    
    Related:
    https://pagure.io/SSSD/sssd/issue/3369
    
    Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com>
    
    Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
    
        
file modified
+14 -0
file modified
+178 -0