private void throwIfInstanceIdIsFenced(ConsumerGroupMember member, String groupId, String receivedMemberId, String receivedInstanceId) {
        if (!member.memberId().equals(receivedMemberId)) {
            log.info("[GroupId {}] Static member {} with instance id {} is fenced by existing member {}.",
                groupId, receivedMemberId, receivedInstanceId, member.memberId());
            throw Errors.FENCED_INSTANCE_ID.exception("Static member " + receivedMemberId + " with instance id "
                + receivedInstanceId + " was fenced by member " + member.memberId() + ".");
        }
    }
Validates if the received instanceId has been released from the group

@param member                The consumer group member.
@param groupId               The consumer group id.
@param receivedMemberId      The member id received in the request.
@param receivedInstanceId    The instance id received in the request.

@throws FencedInstanceIdException if the instance id provided is fenced because of another static member.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java