Skip to content

Commit

Permalink
pageserver: refuse to run without remote storage
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed May 13, 2024
1 parent 873b222 commit c6cf7db
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

0 comments on commit c6cf7db

Please sign in to comment.