def check_logical_slots_readiness(self, cluster: Cluster, tags: Tags) -> bool:
        """Determine whether all known logical slots are synchronised from the leader.

        1) Retrieve the current ``catalog_xmin`` value for the physical slot from the cluster leader, and
        2) using previously stored list of "unready" logical slots, those which have yet to be checked hence have no
           stored slot attributes,
        3) store logical slot ``catalog_xmin`` when the physical slot ``catalog_xmin`` becomes valid.

        :param cluster: object containing stateful information for the cluster.
        :param tags: reference to an object implementing :class:`Tags` interface.

        :returns: ``False`` if any issue while checking logical slots readiness, ``True`` otherwise.
        """
        catalog_xmin = None
        if self._logical_slots_processing_queue and cluster.leader:
            slot_name = cluster.get_slot_name_on_primary(self._postgresql.name, tags)
            try:
                with self._get_leader_connection_cursor(cluster.leader) as cur:
                    cur.execute("SELECT slot_name, catalog_xmin FROM pg_catalog.pg_get_replication_slots()"
                                " WHERE NOT pg_catalog.pg_is_in_recovery() AND slot_name = ANY(%s)",
                                ([n for n, v in self._logical_slots_processing_queue.items()
                                  if v is None] + [slot_name],))
                    slots = {row[0]: row[1] for row in cur}
                    if slot_name not in slots:
                        logger.warning('Physical slot %s does not exist on the primary', slot_name)
                        return False
                    catalog_xmin = slots.pop(slot_name)
            except Exception as e:
                logger.error("Failed to check %s physical slot on the primary: %r", slot_name, e)
                return False

            if not self._update_pending_logical_slot_primary(slots, catalog_xmin):
                return False  # since `catalog_xmin` isn't valid further checks don't make any sense

        self._ready_logical_slots(catalog_xmin)
        return True
Determine whether all known logical slots are synchronised from the leader.

        1) Retrieve the current ``catalog_xmin`` value for the physical slot from the cluster leader, and
        2) using previously stored list of "unready" logical slots, those which have yet to be checked hence have no
           stored slot attributes,
        3) store logical slot ``catalog_xmin`` when the physical slot ``catalog_xmin`` becomes valid.

        :param cluster: object containing stateful information for the cluster.
        :param tags: reference to an object implementing :class:`Tags` interface.

        :returns: ``False`` if any issue while checking logical slots readiness, ``True`` otherwise.
        
patroni/postgresql/slots.py