void ReplicationCoordinatorImpl::_updateOpTimeFromHeartbeat_inlock(int targetIndex,
                                                                       Timestamp optime) {
        invariant(_selfIndex >= 0);
        invariant(targetIndex >= 0);

        SlaveInfo& slaveInfo = _slaveInfo[targetIndex];
        if (optime > slaveInfo.opTime) {
            _updateSlaveInfoOptime_inlock(&slaveInfo, optime);
        }
    }
Exemplo n.º 2
0
    void ReplicationCoordinatorImpl::_updateOpTimeFromHeartbeat_inlock(int targetIndex,
                                                                       OpTime optime) {
        invariant(_thisMembersConfigIndex >= 0);
        invariant(targetIndex >= 0);

        SlaveInfo& slaveInfo = _slaveInfo[targetIndex];
        if (optime > slaveInfo.opTime && slaveInfo.rid.isSet()) {
            // TODO(spencer): The second part of the above if-statement can be removed after 2.8
            // but for now, to maintain compatibility with 2.6, we can't record optimes for any
            // nodes we haven't heard from via replSetUpdatePosition yet to associate an RID.
            _updateSlaveInfoOptime_inlock(&slaveInfo, optime);
        }
    }