diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index a0deba2eaf..155cfbba92 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -1,5 +1,4 @@ use std::{ - collections::BTreeSet, fmt, num::{NonZeroU64, NonZeroUsize}, ops::Range, @@ -232,14 +231,14 @@ pub struct TimelineInfo { pub state: TimelineState, } -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize)] pub struct LayerMapInfo { - pub in_memory_layers: BTreeSet, - pub historic_layers: BTreeSet, + pub in_memory_layers: Vec, + pub historic_layers: Vec, } +#[derive(Debug, Clone, Serialize)] #[serde_as] -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Serialize, Deserialize)] #[serde(tag = "kind")] pub enum InMemoryLayerInfo { Open { @@ -254,8 +253,8 @@ pub enum InMemoryLayerInfo { }, } +#[derive(Debug, Clone, Serialize)] #[serde_as] -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Serialize, Deserialize)] #[serde(tag = "kind")] pub enum HistoricLayerInfo { Delta { diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 0fd2808239..557b1ca749 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -17,7 +17,7 @@ use tokio_util::sync::CancellationToken; use tracing::*; use std::cmp::{max, min, Ordering}; -use std::collections::{BTreeSet, HashMap}; +use std::collections::HashMap; use std::fs; use std::ops::{Deref, Range}; use std::path::{Path, PathBuf}; @@ -821,18 +821,18 @@ impl Timeline { } pub fn layer_map_info(&self) -> LayerMapInfo { - let mut in_memory_layers = BTreeSet::new(); + let mut in_memory_layers = Vec::new(); let layer_map = self.layers.read().unwrap(); if let Some(open_layer) = &layer_map.open_layer { - in_memory_layers.insert(open_layer.info()); + in_memory_layers.push(open_layer.info()); } for frozen_layer in &layer_map.frozen_layers { - in_memory_layers.insert(frozen_layer.info()); + in_memory_layers.push(frozen_layer.info()); } - let mut historic_layers = BTreeSet::new(); + let mut historic_layers = Vec::new(); for historic_layer in layer_map.iter_historic_layers() { - historic_layers.insert(historic_layer.info()); + historic_layers.push(historic_layer.info()); } LayerMapInfo {