Skip to content

Commit

Permalink
pageserver: refuse to run without remote storage (#7722)
Browse files Browse the repository at this point in the history
## Problem

Since #6769, the pageserver is
intentionally not usable without remote storage: it's purpose is to act
as a cache to an object store, rather than as a source of truth in its
own right.

## Summary of changes

- Make remote storage configuration mandatory: the pageserver will
refuse to start if it is not provided.

This is a precursor that will make it safe to subsequently remove all
the internal Option<>s
  • Loading branch information
jcsp committed May 13, 2024
1 parent b58a615 commit f50ff14
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pageserver/src/bin/pageserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ fn start_pageserver(
let shutdown_pageserver = tokio_util::sync::CancellationToken::new();

// Set up remote storage client
let remote_storage = create_remote_storage_client(conf)?;
let remote_storage = Some(create_remote_storage_client(conf)?);

// Set up deletion queue
let (deletion_queue, deletion_workers) = DeletionQueue::new(
Expand Down Expand Up @@ -708,12 +708,11 @@ fn start_pageserver(

fn create_remote_storage_client(
conf: &'static PageServerConf,
) -> anyhow::Result<Option<GenericRemoteStorage>> {
) -> anyhow::Result<GenericRemoteStorage> {
let config = if let Some(config) = &conf.remote_storage_config {
config
} else {
tracing::warn!("no remote storage configured, this is a deprecated configuration");
return Ok(None);
anyhow::bail!("no remote storage configured, this is a deprecated configuration");
};

// Create the client
Expand All @@ -733,7 +732,7 @@ fn create_remote_storage_client(
GenericRemoteStorage::unreliable_wrapper(remote_storage, conf.test_remote_failures);
}

Ok(Some(remote_storage))
Ok(remote_storage)
}

fn cli() -> Command {
Expand Down

1 comment on commit f50ff14

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3141 tests run: 2995 passed, 0 failed, 146 skipped (full report)


Flaky tests (2)

Postgres 15

  • test_gc_aggressive: debug
  • test_download_remote_layers_api: release

Code coverage* (full report)

  • functions: 31.4% (6330 of 20161 functions)
  • lines: 47.3% (47753 of 100969 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
f50ff14 at 2024-05-13T13:35:54.180Z :recycle:

Please sign in to comment.