[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: slurpd private replication file trim question - Found out



Figured it out.  Sorry for the post...


/*
 * Check to see if the private slurpd replication log needs trimming.
 * The current criteria are:
 *  - The last trim was more than 5 minutes ago, *and*
 *  - We've finished with at least 50 replication log entries since the
 *    last time we re-wrote the replication log.
 *
 * Return 1 if replogfile should be trimmed, 0 if not.
 * Any different policy should be implemented by replacing this function.
 */
static int
Rq_needtrim(
    Rq  *rq
)
{
    int         rc = 0;
    Re          *re;
    int         nzrc = 0;       /* nzrc is count of entries with refcnt == 0
*/
    time_t      now;

    if ( rq == NULL ) {
        return 0;
    }

    rq->rq_lock( rq );

    time( &now );

    if ( now > ( rq->rq_lasttrim + TRIMCHECK_INTERVAL )) {
        rc = ( rq->rq_ndel >= 50 );
    } else {
        rc = 0;
    }
    rq->rq_unlock( rq );
    return rc;
}


Tomás V. Arredondo
Member of Technical Staff
Unisphere Networks
7800 Congress Ave., Suite 100, Boca Raton, Fl 33487
Tel.(561)981-7051, Fax.(561)981-7001
tarredondo@unispherenetworks.com