File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
fluvio-controlplane-metadata/src/partition
fluvio-sc/src/controllers/partitions Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -111,19 +111,18 @@ impl PartitionStatus {
111
111
}
112
112
113
113
pub fn is_online ( & self ) -> bool {
114
+ matches ! ( self . resolution, PartitionResolution :: Online )
115
+ }
116
+
117
+ pub fn is_readable ( & self ) -> bool {
114
118
matches ! (
115
119
self . resolution,
116
120
PartitionResolution :: Online | PartitionResolution :: OutOfStorage
117
121
)
118
122
}
119
123
120
124
pub fn is_offline ( & self ) -> bool {
121
- matches ! (
122
- self . resolution,
123
- PartitionResolution :: Offline
124
- | PartitionResolution :: LeaderOffline
125
- | PartitionResolution :: ElectionLeaderFound
126
- )
125
+ self . resolution == PartitionResolution :: Offline
127
126
}
128
127
129
128
#[ deprecated = "Replaced by lrs()" ]
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ impl<C: MetadataItem> PartitionReducer<C> {
215
215
216
216
for partition_kv_epoch in self . partition_store . read ( ) . await . values ( ) {
217
217
let partition_kv = partition_kv_epoch. inner ( ) ;
218
- if partition_kv. status . is_offline ( ) {
218
+ if ! partition_kv. status . is_readable ( ) {
219
219
if partition_kv. spec . leader != online_leader_spu_id {
220
220
// switch leader if online leader is different
221
221
for replica_status in partition_kv. status . replica_iter ( ) {
You can’t perform that action at this time.
0 commit comments