Skip to content

Commit

Permalink
fixup switch to heavier_once_cell: undo changes related to no need fo…
Browse files Browse the repository at this point in the history
…r async fns
  • Loading branch information
problame committed Apr 4, 2024
1 parent 806c957 commit 4e4f246
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pageserver/src/http/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ async fn tenant_status(
attachment_status: state.attachment_status(),
generation: tenant.generation().into(),
},
walredo: tenant.wal_redo_manager_status().await,
walredo: tenant.wal_redo_manager_status(),
timelines: tenant.list_timeline_ids(),
})
}
Expand Down
12 changes: 4 additions & 8 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ impl WalRedoManager {
}
}

pub(crate) async fn status(&self) -> Option<WalRedoManagerStatus> {
pub(crate) fn status(&self) -> Option<WalRedoManagerStatus> {
match self {
WalRedoManager::Prod(m) => m.status().await,
WalRedoManager::Prod(m) => m.status(),
#[cfg(test)]
WalRedoManager::Test(_) => None,
}
Expand Down Expand Up @@ -1683,12 +1683,8 @@ impl Tenant {
self.generation
}

pub(crate) async fn wal_redo_manager_status(&self) -> Option<WalRedoManagerStatus> {
if let Some(mgr) = self.walredo_mgr.as_ref() {
mgr.status().await
} else {
None
}
pub(crate) fn wal_redo_manager_status(&self) -> Option<WalRedoManagerStatus> {
self.walredo_mgr.as_ref().and_then(|mgr| mgr.status())
}

/// Changes tenant status to active, unless shutdown was already requested.
Expand Down
2 changes: 1 addition & 1 deletion pageserver/src/walredo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl PostgresRedoManager {
}
}

pub(crate) async fn status(&self) -> Option<WalRedoManagerStatus> {
pub(crate) fn status(&self) -> Option<WalRedoManagerStatus> {
Some(WalRedoManagerStatus {
last_redo_at: {
let at = *self.last_redo_at.lock().unwrap();
Expand Down

0 comments on commit 4e4f246

Please sign in to comment.