def is_obsoleted_by_pid(pid):
    """Return True if ``pid`` is referenced in the obsoletedBy field of any object.

    This will return True even if the PID is in the obsoletes field of an object that
    does not exist on the local MN, such as replica that is in an incomplete chain.

    """
    return d1_gmn.app.models.ScienceObject.objects.filter(
        obsoleted_by__did=pid
    ).exists()