diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index 9d1ad8a022..cf3252a9ae 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -201,8 +201,6 @@ pub struct TimelineInfo { pub last_received_msg_ts: Option, pub pg_version: u32, - pub awaits_download: bool, - pub state: TimelineState, // Some of the above fields are duplicated in 'local' and 'remote', for backwards- diff --git a/pageserver/src/http/openapi_spec.yml b/pageserver/src/http/openapi_spec.yml index 932cda50b7..b372410c0d 100644 --- a/pageserver/src/http/openapi_spec.yml +++ b/pageserver/src/http/openapi_spec.yml @@ -748,7 +748,6 @@ components: - tenant_id - last_record_lsn - disk_consistent_lsn - - awaits_download - state - latest_gc_cutoff_lsn properties: @@ -791,8 +790,6 @@ components: format: hex last_received_msg_ts: type: integer - awaits_download: - type: boolean state: type: string latest_gc_cutoff_lsn: diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index d1fdf26a5a..0ef555c4aa 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use anyhow::{anyhow, Context, Result}; use hyper::StatusCode; use hyper::{Body, Request, Response, Uri}; -use pageserver_api::models::TenantState; use remote_storage::GenericRemoteStorage; use tracing::*; @@ -81,12 +80,11 @@ fn check_permission(request: &Request, tenant_id: Option) -> Res // Helper function to construct a TimelineInfo struct for a timeline fn build_timeline_info( - tenant_state: TenantState, timeline: &Arc, include_non_incremental_logical_size: bool, include_non_incremental_physical_size: bool, ) -> anyhow::Result { - let mut info = build_timeline_info_common(tenant_state, timeline)?; + let mut info = build_timeline_info_common(timeline)?; if include_non_incremental_logical_size { info.current_logical_size_non_incremental = Some(timeline.get_current_logical_size_non_incremental(info.last_record_lsn)?); @@ -98,10 +96,7 @@ fn build_timeline_info( Ok(info) } -fn build_timeline_info_common( - tenant_state: TenantState, - timeline: &Arc, -) -> anyhow::Result { +fn build_timeline_info_common(timeline: &Arc) -> anyhow::Result { let last_record_lsn = timeline.get_last_record_lsn(); let (wal_source_connstr, last_received_msg_lsn, last_received_msg_ts) = { let guard = timeline.last_received_wal.lock().unwrap(); @@ -153,10 +148,6 @@ fn build_timeline_info_common( state, - // XXX bring back tracking of downloads per timeline, or, introduce - // an 'Attaching' state for the timeline and get rid of this field. - awaits_download: tenant_state == TenantState::Attaching, - // Duplicate some fields in 'local' and 'remote' fields, for backwards-compatility // with the control plane. local: LocalTimelineInfo { @@ -201,7 +192,7 @@ async fn timeline_create_handler(mut request: Request) -> Result { // Created. Construct a TimelineInfo for it. - let timeline_info = build_timeline_info_common(tenant.current_state(), &new_timeline) + let timeline_info = build_timeline_info_common(&new_timeline) .map_err(ApiError::InternalServerError)?; json_response(StatusCode::CREATED, timeline_info) } @@ -227,7 +218,6 @@ async fn timeline_list_handler(request: Request) -> Result, let mut response_data = Vec::with_capacity(timelines.len()); for timeline in timelines { let timeline_info = build_timeline_info( - tenant.current_state(), &timeline, include_non_incremental_logical_size, include_non_incremental_physical_size, @@ -295,7 +285,6 @@ async fn timeline_detail_handler(request: Request) -> Result= current_lsn ), "current db Lsn should should not be less than the one stored on remote storage" - assert not detail["awaits_download"] pg = env.postgres.create_start("main") with pg.cursor() as cur: