Sequence number obsession

Ken Cross kcross at nssolutions.com
Sun Apr 27 13:02:35 GMT 2003


Samba-folk:

We seem to be a bit obsessive-compulsive when it comes to getting a
domain's sequence number.  I have network traces where we obtain the
sequence number >20 times within a second.

The "force" argument to refresh_sequence_number in winbindd_cache.c
appears to be true quite often.  Do we really need sub-second updates of
the sequence number?

The patch below to SAMBA_3_0 changes it so that it doesn't update the
sequence number if it is valid and has been updated within the last
second.  Note that this overrides the "force" argument.

Whaddya think?

Ken
________________________________

Ken Cross

Network Storage Solutions
Phone 865.675.4070 ext 31
kcross at nssolutions.com 




Index: nsswitch/winbindd_cache.c
===================================================================
RCS file: /cvsroot/samba/source/nsswitch/winbindd_cache.c,v
retrieving revision 1.35.2.4
diff -p -u -r1.35.2.4 winbindd_cache.c
--- nsswitch/winbindd_cache.c   15 Oct 2002 21:34:42 -0000      1.35.2.4
+++ nsswitch/winbindd_cache.c   27 Apr 2003 12:39:11 -0000
@@ -218,7 +218,9 @@ static void refresh_sequence_number(stru
        time_diff = time(NULL) - domain->last_seq_check;
 
        /* see if we have to refetch the domain sequence number */
-       if (!force && (time_diff < cache_time)) {
+       if ((!force && (time_diff < cache_time)) ||
+           (time_diff == 0 && domain->sequence_number != 0 && 
+            domain->sequence_number != DOM_SEQUENCE_NONE)) {
                return;
        }




More information about the samba-technical mailing list