mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
The `Status` class was introduced in #2853, but we kept old properties in the `Cluster` object in order to have fewer changes in the rest of the code. This PR is finishing the refactoring. The following adjustments were made: - Introduced `Status.is_empty()` method, which is used in the `Cluster.is_empty()` instead of checking actual values to simplify introduction of further fields to the Status object. - Removed `Cluster.last_lsn` property - Changed `Cluster.slots` property to always return dict and perform sanity checks on values. Besides that, this PR addressing a couple of problems: - the `AbstractDCS.get_cluster()` method some properties without holding a lock on `_cluster_thread_lock`. - `Cluster.__permanent_slots` property was setting 'lsn' from all cluster members, while it should be doing that only for members with `replicatefrom` tag.