~ubuntu-branches/ubuntu/saucy/389-ds-base/saucy

« back to all changes in this revision

Viewing changes to ldap/servers/plugins/replication/cl5_api.c

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2013-02-06 18:06:31 UTC
  • mfrom: (11.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130206180631-h6ldv3k506hmm46e
Tags: 1.3.0.2-0ubuntu2
debian/*: Fix time stamps due to clock skew (FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1474
1474
}
1475
1475
 
1476
1476
/* Name:                cl5CreateReplayIterator
1477
 
   Description: creates an iterator that allows to retireve changes that should
1478
 
                                to be sent to the consumer identified by ruv. The iteration is peformed by 
 
1477
   Description: creates an iterator that allows to retrieve changes that should
 
1478
                                to be sent to the consumer identified by ruv. The iteration is performed by
1479
1479
                repeated calls to cl5GetNextOperationToReplay.
1480
1480
   Parameters:  replica - replica whose data we wish to iterate;
1481
1481
                                ruv - consumer ruv;
1482
1482
                                iterator - iterator to be passed to cl5GetNextOperationToReplay call
1483
 
   Return:              CL5_SUCCESS, if function is successfull;
 
1483
   Return:              CL5_SUCCESS, if function is successful;
1484
1484
                CL5_MISSING_DATA, if data that should be in the changelog is missing
1485
1485
                CL5_PURGED_DATA, if some data that consumer needs has been purged.
1486
1486
                Note that the iterator can be non null if the supplier contains
1488
1488
                CL5_NOTFOUND if the consumer is up to data with respect to the supplier
1489
1489
                                CL5_BAD_DATA if invalid parameter is passed;
1490
1490
                                CL5_BAD_STATE  if db has not been open;
1491
 
                                CL5_DB_ERROR if any other db error occured;
 
1491
                                CL5_DB_ERROR if any other db error occurred;
1492
1492
                                CL5_MEMORY_ERROR if memory allocation fails.
1493
1493
   Algorithm:   Build a list of csns from consumer's and supplier's ruv. For each element
1494
1494
                of the consumer's ruv put max csn into the csn list. For each element
1495
1495
                of the supplier's ruv not in the consumer's ruv put min csn from the
1496
1496
                supplier's ruv into the list. The list contains, for each known replica,
1497
1497
                the starting point for changes to be sent to the consumer.
1498
 
                Sort the list in accending order.
 
1498
                Sort the list in ascending order.
1499
1499
                Build a hash which contains, for each known replica, whether the
1500
1500
                supplier can bring the consumer up to data with respect to that replica.
1501
1501
                The hash is used to decide whether a change can be sent to the consumer 
1503
1503
                we can bring the consumer up to date.
1504
1504
                Position the db cursor on the change entry that corresponds to this csn.
1505
1505
                Hash entries are created for each replica traversed so far. sendChanges
1506
 
                flag is set to FALSE for all repolicas except the last traversed.
 
1506
                flag is set to FALSE for all replicas except the last traversed.
1507
1507
                
1508
1508
 */
1509
1509
int cl5CreateReplayIteratorEx (Private_Repl_Protocol *prp, const RUV *consumerRuv, 
6543
6543
void
6544
6544
cl5CleanRUV(ReplicaId rid){
6545
6545
    CL5DBFile *file;
6546
 
    Object *obj;
 
6546
    Object *obj = NULL;
 
6547
 
 
6548
    slapi_rwlock_wrlock (s_cl5Desc.stLock);
6547
6549
 
6548
6550
    obj = objset_first_obj(s_cl5Desc.dbFiles);
6549
6551
    while (obj){
6552
6554
        ruv_delete_replica(file->maxRUV, rid);
6553
6555
        obj = objset_next_obj(s_cl5Desc.dbFiles, obj);
6554
6556
    }
 
6557
 
 
6558
    slapi_rwlock_unlock (s_cl5Desc.stLock);
6555
6559
}
6556
6560
 
6557
6561
void trigger_cl_trimming(ReplicaId rid){