'Args:
origin (str): Origin of the pdu. Will be called to get the missing events
pdu: received pdu
prevs (set(str)): List of event ids which we are missing
min_depth (int): Minimum depth of events to return.'

@defer.inlineCallbacks
def _get_missing_events_for_pdu(self, origin, pdu, prevs, min_depth):

    have_seen = (yield self.store.have_events(prevs))
    seen = set(have_seen.keys())
    if (not (prevs - seen)):
        return
    latest = (yield self.store.get_latest_event_ids_in_room(pdu.room_id))
    latest = set(latest)
    latest |= seen
    logger.info('Missing    %d    events    for    room    %r    pdu    %s:    %r...', len((prevs - seen)), pdu.room_id, pdu.event_id, list((prevs - seen))[:5])
    missing_events = (yield self.replication_layer.get_missing_events(origin, pdu.room_id, earliest_events_ids=list(latest), latest_events=[pdu], limit=10, min_depth=min_depth, timeout=10000))
    logger.info('Got    %d    events:    %r...', len(missing_events), [e.event_id for e in missing_events[:5]])
    missing_events.sort(key=(lambda x: x.depth))
    for e in missing_events:
        logger.info('Handling    found    event    %s', e.event_id)
        (yield self.on_receive_pdu(origin, e, get_missing=False))
