Пример #1
0
 BSONForEach(elem, updates) {
     BSONObj entry = elem.Obj();
     OID id = entry["_id"].OID();
     OpTime ot = entry["optime"]._opTime();
     Status status = setLastOptime(txn, id, ot);
     if (!status.isOK()) {
         return status;
     }
 }
Пример #2
0
    Status ReplicationCoordinatorImpl::processReplSetUpdatePosition(
            OperationContext* txn,
            const UpdatePositionArgs& updates) {

        for (UpdatePositionArgs::UpdateIterator update = updates.updatesBegin();
                update != updates.updatesEnd();
                ++update) {
            Status status = setLastOptime(txn, update->rid, update->ts);
            if (!status.isOK()) {
                return status;
            }
        }
        return Status::OK();
    }
Пример #3
0
    Status LegacyReplicationCoordinator::processReplSetUpdatePosition(const BSONArray& updates,
                                                                      BSONObjBuilder* resultObj) {
        Status status = _checkReplEnabledForCommand(resultObj);
        if (!status.isOK()) {
            return status;
        }

        BSONForEach(elem, updates) {
            BSONObj entry = elem.Obj();
            OID id = entry["_id"].OID();
            OpTime ot = entry["optime"]._opTime();
            BSONObj config = entry["config"].Obj();
            Status status = setLastOptime(id, ot, config);
            if (!status.isOK()) {
                return status;
            }
        }