LCOV - code coverage report
Current view: top level - control_plane/src - pageserver.rs (source / functions) Coverage Total Hit
Test: 8ff8efadb0253cf618c612650348666c0c564111.info Lines: 0.0 % 371 0
Test Date: 2024-11-20 17:53:50 Functions: 0.0 % 51 0

            Line data    Source code
       1              : //! Code to manage pageservers
       2              : //!
       3              : //! In the local test environment, the data for each pageserver is stored in
       4              : //!
       5              : //! ```text
       6              : //!   .neon/pageserver_<pageserver_id>
       7              : //! ```
       8              : //!
       9              : use std::collections::HashMap;
      10              : 
      11              : use std::io;
      12              : use std::io::Write;
      13              : use std::num::NonZeroU64;
      14              : use std::path::PathBuf;
      15              : use std::str::FromStr;
      16              : use std::time::Duration;
      17              : 
      18              : use anyhow::{bail, Context};
      19              : use camino::Utf8PathBuf;
      20              : use pageserver_api::models::{self, TenantInfo, TimelineInfo};
      21              : use pageserver_api::shard::TenantShardId;
      22              : use pageserver_client::mgmt_api;
      23              : use postgres_backend::AuthType;
      24              : use postgres_connection::{parse_host_port, PgConnectionConfig};
      25              : use utils::auth::{Claims, Scope};
      26              : use utils::id::NodeId;
      27              : use utils::{
      28              :     id::{TenantId, TimelineId},
      29              :     lsn::Lsn,
      30              : };
      31              : 
      32              : use crate::local_env::{NeonLocalInitPageserverConf, PageServerConf};
      33              : use crate::{background_process, local_env::LocalEnv};
      34              : 
      35              : /// Directory within .neon which will be used by default for LocalFs remote storage.
      36              : pub const PAGESERVER_REMOTE_STORAGE_DIR: &str = "local_fs_remote_storage/pageserver";
      37              : 
      38              : //
      39              : // Control routines for pageserver.
      40              : //
      41              : // Used in CLI and tests.
      42              : //
      43              : #[derive(Debug)]
      44              : pub struct PageServerNode {
      45              :     pub pg_connection_config: PgConnectionConfig,
      46              :     pub conf: PageServerConf,
      47              :     pub env: LocalEnv,
      48              :     pub http_client: mgmt_api::Client,
      49              : }
      50              : 
      51              : impl PageServerNode {
      52            0 :     pub fn from_env(env: &LocalEnv, conf: &PageServerConf) -> PageServerNode {
      53            0 :         let (host, port) =
      54            0 :             parse_host_port(&conf.listen_pg_addr).expect("Unable to parse listen_pg_addr");
      55            0 :         let port = port.unwrap_or(5432);
      56            0 :         Self {
      57            0 :             pg_connection_config: PgConnectionConfig::new_host_port(host, port),
      58            0 :             conf: conf.clone(),
      59            0 :             env: env.clone(),
      60            0 :             http_client: mgmt_api::Client::new(
      61            0 :                 format!("http://{}", conf.listen_http_addr),
      62            0 :                 {
      63            0 :                     match conf.http_auth_type {
      64            0 :                         AuthType::Trust => None,
      65            0 :                         AuthType::NeonJWT => Some(
      66            0 :                             env.generate_auth_token(&Claims::new(None, Scope::PageServerApi))
      67            0 :                                 .unwrap(),
      68            0 :                         ),
      69              :                     }
      70              :                 }
      71            0 :                 .as_deref(),
      72            0 :             ),
      73            0 :         }
      74            0 :     }
      75              : 
      76            0 :     fn pageserver_make_identity_toml(&self, node_id: NodeId) -> toml_edit::DocumentMut {
      77            0 :         toml_edit::DocumentMut::from_str(&format!("id={node_id}")).unwrap()
      78            0 :     }
      79              : 
      80            0 :     fn pageserver_init_make_toml(
      81            0 :         &self,
      82            0 :         conf: NeonLocalInitPageserverConf,
      83            0 :     ) -> anyhow::Result<toml_edit::DocumentMut> {
      84            0 :         assert_eq!(&PageServerConf::from(&conf), &self.conf, "during neon_local init, we derive the runtime state of ps conf (self.conf) from the --config flag fully");
      85              : 
      86              :         // TODO(christian): instead of what we do here, create a pageserver_api::config::ConfigToml (PR #7656)
      87              : 
      88              :         // FIXME: the paths should be shell-escaped to handle paths with spaces, quotas etc.
      89            0 :         let pg_distrib_dir_param = format!(
      90            0 :             "pg_distrib_dir='{}'",
      91            0 :             self.env.pg_distrib_dir_raw().display()
      92            0 :         );
      93            0 : 
      94            0 :         let broker_endpoint_param = format!("broker_endpoint='{}'", self.env.broker.client_url());
      95            0 : 
      96            0 :         let mut overrides = vec![pg_distrib_dir_param, broker_endpoint_param];
      97              : 
      98            0 :         if let Some(control_plane_api) = &self.env.control_plane_api {
      99            0 :             overrides.push(format!(
     100            0 :                 "control_plane_api='{}'",
     101            0 :                 control_plane_api.as_str()
     102            0 :             ));
     103              : 
     104              :             // Storage controller uses the same auth as pageserver: if JWT is enabled
     105              :             // for us, we will also need it to talk to them.
     106            0 :             if matches!(conf.http_auth_type, AuthType::NeonJWT) {
     107            0 :                 let jwt_token = self
     108            0 :                     .env
     109            0 :                     .generate_auth_token(&Claims::new(None, Scope::GenerationsApi))
     110            0 :                     .unwrap();
     111            0 :                 overrides.push(format!("control_plane_api_token='{}'", jwt_token));
     112            0 :             }
     113            0 :         }
     114              : 
     115            0 :         if !conf.other.contains_key("remote_storage") {
     116            0 :             overrides.push(format!(
     117            0 :                 "remote_storage={{local_path='../{PAGESERVER_REMOTE_STORAGE_DIR}'}}"
     118            0 :             ));
     119            0 :         }
     120              : 
     121            0 :         if conf.http_auth_type != AuthType::Trust || conf.pg_auth_type != AuthType::Trust {
     122            0 :             // Keys are generated in the toplevel repo dir, pageservers' workdirs
     123            0 :             // are one level below that, so refer to keys with ../
     124            0 :             overrides.push("auth_validation_public_key_path='../auth_public_key.pem'".to_owned());
     125            0 :         }
     126              : 
     127              :         // Apply the user-provided overrides
     128            0 :         overrides.push({
     129            0 :             let mut doc =
     130            0 :                 toml_edit::ser::to_document(&conf).expect("we deserialized this from toml earlier");
     131            0 :             // `id` is written out to `identity.toml` instead of `pageserver.toml`
     132            0 :             doc.remove("id").expect("it's part of the struct");
     133            0 :             doc.to_string()
     134            0 :         });
     135            0 : 
     136            0 :         // Turn `overrides` into a toml document.
     137            0 :         // TODO: above code is legacy code, it should be refactored to use toml_edit directly.
     138            0 :         let mut config_toml = toml_edit::DocumentMut::new();
     139            0 :         for fragment_str in overrides {
     140            0 :             let fragment = toml_edit::DocumentMut::from_str(&fragment_str)
     141            0 :                 .expect("all fragments in `overrides` are valid toml documents, this function controls that");
     142            0 :             for (key, item) in fragment.iter() {
     143            0 :                 config_toml.insert(key, item.clone());
     144            0 :             }
     145              :         }
     146            0 :         Ok(config_toml)
     147            0 :     }
     148              : 
     149              :     /// Initializes a pageserver node by creating its config with the overrides provided.
     150            0 :     pub fn initialize(&self, conf: NeonLocalInitPageserverConf) -> anyhow::Result<()> {
     151            0 :         self.pageserver_init(conf)
     152            0 :             .with_context(|| format!("Failed to run init for pageserver node {}", self.conf.id))
     153            0 :     }
     154              : 
     155            0 :     pub fn repo_path(&self) -> PathBuf {
     156            0 :         self.env.pageserver_data_dir(self.conf.id)
     157            0 :     }
     158              : 
     159              :     /// The pid file is created by the pageserver process, with its pid stored inside.
     160              :     /// Other pageservers cannot lock the same file and overwrite it for as long as the current
     161              :     /// pageserver runs. (Unless someone removes the file manually; never do that!)
     162            0 :     fn pid_file(&self) -> Utf8PathBuf {
     163            0 :         Utf8PathBuf::from_path_buf(self.repo_path().join("pageserver.pid"))
     164            0 :             .expect("non-Unicode path")
     165            0 :     }
     166              : 
     167            0 :     pub async fn start(&self, retry_timeout: &Duration) -> anyhow::Result<()> {
     168            0 :         self.start_node(retry_timeout).await
     169            0 :     }
     170              : 
     171            0 :     fn pageserver_init(&self, conf: NeonLocalInitPageserverConf) -> anyhow::Result<()> {
     172            0 :         let datadir = self.repo_path();
     173            0 :         let node_id = self.conf.id;
     174            0 :         println!(
     175            0 :             "Initializing pageserver node {} at '{}' in {:?}",
     176            0 :             node_id,
     177            0 :             self.pg_connection_config.raw_address(),
     178            0 :             datadir
     179            0 :         );
     180            0 :         io::stdout().flush()?;
     181              : 
     182              :         // If the config file we got as a CLI argument includes the `availability_zone`
     183              :         // config, then use that to populate the `metadata.json` file for the pageserver.
     184              :         // In production the deployment orchestrator does this for us.
     185            0 :         let az_id = conf
     186            0 :             .other
     187            0 :             .get("availability_zone")
     188            0 :             .map(|toml| {
     189            0 :                 let az_str = toml.to_string();
     190            0 :                 // Trim the (") chars from the toml representation
     191            0 :                 if az_str.starts_with('"') && az_str.ends_with('"') {
     192            0 :                     az_str[1..az_str.len() - 1].to_string()
     193              :                 } else {
     194            0 :                     az_str
     195              :                 }
     196            0 :             })
     197            0 :             .unwrap_or("local".to_string());
     198              : 
     199            0 :         let config = self
     200            0 :             .pageserver_init_make_toml(conf)
     201            0 :             .context("make pageserver toml")?;
     202            0 :         let config_file_path = datadir.join("pageserver.toml");
     203            0 :         let mut config_file = std::fs::OpenOptions::new()
     204            0 :             .create_new(true)
     205            0 :             .write(true)
     206            0 :             .open(&config_file_path)
     207            0 :             .with_context(|| format!("open pageserver toml for write: {config_file_path:?}"))?;
     208            0 :         config_file
     209            0 :             .write_all(config.to_string().as_bytes())
     210            0 :             .context("write pageserver toml")?;
     211            0 :         drop(config_file);
     212            0 : 
     213            0 :         let identity_file_path = datadir.join("identity.toml");
     214            0 :         let mut identity_file = std::fs::OpenOptions::new()
     215            0 :             .create_new(true)
     216            0 :             .write(true)
     217            0 :             .open(identity_file_path)
     218            0 :             .with_context(|| format!("open identity toml for write: {config_file_path:?}"))?;
     219            0 :         let identity_toml = self.pageserver_make_identity_toml(node_id);
     220            0 :         identity_file
     221            0 :             .write_all(identity_toml.to_string().as_bytes())
     222            0 :             .context("write identity toml")?;
     223            0 :         drop(identity_toml);
     224            0 : 
     225            0 :         // TODO: invoke a TBD config-check command to validate that pageserver will start with the written config
     226            0 : 
     227            0 :         // Write metadata file, used by pageserver on startup to register itself with
     228            0 :         // the storage controller
     229            0 :         let metadata_path = datadir.join("metadata.json");
     230            0 : 
     231            0 :         let (_http_host, http_port) =
     232            0 :             parse_host_port(&self.conf.listen_http_addr).expect("Unable to parse listen_http_addr");
     233            0 :         let http_port = http_port.unwrap_or(9898);
     234            0 : 
     235            0 :         // Intentionally hand-craft JSON: this acts as an implicit format compat test
     236            0 :         // in case the pageserver-side structure is edited, and reflects the real life
     237            0 :         // situation: the metadata is written by some other script.
     238            0 :         std::fs::write(
     239            0 :             metadata_path,
     240            0 :             serde_json::to_vec(&pageserver_api::config::NodeMetadata {
     241            0 :                 postgres_host: "localhost".to_string(),
     242            0 :                 postgres_port: self.pg_connection_config.port(),
     243            0 :                 http_host: "localhost".to_string(),
     244            0 :                 http_port,
     245            0 :                 other: HashMap::from([(
     246            0 :                     "availability_zone_id".to_string(),
     247            0 :                     serde_json::json!(az_id),
     248            0 :                 )]),
     249            0 :             })
     250            0 :             .unwrap(),
     251            0 :         )
     252            0 :         .expect("Failed to write metadata file");
     253            0 : 
     254            0 :         Ok(())
     255            0 :     }
     256              : 
     257            0 :     async fn start_node(&self, retry_timeout: &Duration) -> anyhow::Result<()> {
     258            0 :         // TODO: using a thread here because start_process() is not async but we need to call check_status()
     259            0 :         let datadir = self.repo_path();
     260            0 :         print!(
     261            0 :             "Starting pageserver node {} at '{}' in {:?}, retrying for {:?}",
     262            0 :             self.conf.id,
     263            0 :             self.pg_connection_config.raw_address(),
     264            0 :             datadir,
     265            0 :             retry_timeout
     266            0 :         );
     267            0 :         io::stdout().flush().context("flush stdout")?;
     268              : 
     269            0 :         let datadir_path_str = datadir.to_str().with_context(|| {
     270            0 :             format!(
     271            0 :                 "Cannot start pageserver node {} in path that has no string representation: {:?}",
     272            0 :                 self.conf.id, datadir,
     273            0 :             )
     274            0 :         })?;
     275            0 :         let args = vec!["-D", datadir_path_str];
     276            0 : 
     277            0 :         background_process::start_process(
     278            0 :             "pageserver",
     279            0 :             &datadir,
     280            0 :             &self.env.pageserver_bin(),
     281            0 :             args,
     282            0 :             self.pageserver_env_variables()?,
     283            0 :             background_process::InitialPidFile::Expect(self.pid_file()),
     284            0 :             retry_timeout,
     285            0 :             || async {
     286            0 :                 let st = self.check_status().await;
     287            0 :                 match st {
     288            0 :                     Ok(()) => Ok(true),
     289            0 :                     Err(mgmt_api::Error::ReceiveBody(_)) => Ok(false),
     290            0 :                     Err(e) => Err(anyhow::anyhow!("Failed to check node status: {e}")),
     291              :                 }
     292            0 :             },
     293            0 :         )
     294            0 :         .await?;
     295              : 
     296            0 :         Ok(())
     297            0 :     }
     298              : 
     299            0 :     fn pageserver_env_variables(&self) -> anyhow::Result<Vec<(String, String)>> {
     300            0 :         // FIXME: why is this tied to pageserver's auth type? Whether or not the safekeeper
     301            0 :         // needs a token, and how to generate that token, seems independent to whether
     302            0 :         // the pageserver requires a token in incoming requests.
     303            0 :         Ok(if self.conf.http_auth_type != AuthType::Trust {
     304              :             // Generate a token to connect from the pageserver to a safekeeper
     305            0 :             let token = self
     306            0 :                 .env
     307            0 :                 .generate_auth_token(&Claims::new(None, Scope::SafekeeperData))?;
     308            0 :             vec![("NEON_AUTH_TOKEN".to_owned(), token)]
     309              :         } else {
     310            0 :             Vec::new()
     311              :         })
     312            0 :     }
     313              : 
     314              :     ///
     315              :     /// Stop the server.
     316              :     ///
     317              :     /// If 'immediate' is true, we use SIGQUIT, killing the process immediately.
     318              :     /// Otherwise we use SIGTERM, triggering a clean shutdown
     319              :     ///
     320              :     /// If the server is not running, returns success
     321              :     ///
     322            0 :     pub fn stop(&self, immediate: bool) -> anyhow::Result<()> {
     323            0 :         background_process::stop_process(immediate, "pageserver", &self.pid_file())
     324            0 :     }
     325              : 
     326            0 :     pub async fn check_status(&self) -> mgmt_api::Result<()> {
     327            0 :         self.http_client.status().await
     328            0 :     }
     329              : 
     330            0 :     pub async fn tenant_list(&self) -> mgmt_api::Result<Vec<TenantInfo>> {
     331            0 :         self.http_client.list_tenants().await
     332            0 :     }
     333            0 :     pub fn parse_config(mut settings: HashMap<&str, &str>) -> anyhow::Result<models::TenantConfig> {
     334            0 :         let result = models::TenantConfig {
     335            0 :             checkpoint_distance: settings
     336            0 :                 .remove("checkpoint_distance")
     337            0 :                 .map(|x| x.parse::<u64>())
     338            0 :                 .transpose()
     339            0 :                 .context("Failed to parse 'checkpoint_distance' as an integer")?,
     340            0 :             checkpoint_timeout: settings.remove("checkpoint_timeout").map(|x| x.to_string()),
     341            0 :             compaction_target_size: settings
     342            0 :                 .remove("compaction_target_size")
     343            0 :                 .map(|x| x.parse::<u64>())
     344            0 :                 .transpose()
     345            0 :                 .context("Failed to parse 'compaction_target_size' as an integer")?,
     346            0 :             compaction_period: settings.remove("compaction_period").map(|x| x.to_string()),
     347            0 :             compaction_threshold: settings
     348            0 :                 .remove("compaction_threshold")
     349            0 :                 .map(|x| x.parse::<usize>())
     350            0 :                 .transpose()
     351            0 :                 .context("Failed to parse 'compaction_threshold' as an integer")?,
     352            0 :             compaction_algorithm: settings
     353            0 :                 .remove("compaction_algorithm")
     354            0 :                 .map(serde_json::from_str)
     355            0 :                 .transpose()
     356            0 :                 .context("Failed to parse 'compaction_algorithm' json")?,
     357            0 :             gc_horizon: settings
     358            0 :                 .remove("gc_horizon")
     359            0 :                 .map(|x| x.parse::<u64>())
     360            0 :                 .transpose()
     361            0 :                 .context("Failed to parse 'gc_horizon' as an integer")?,
     362            0 :             gc_period: settings.remove("gc_period").map(|x| x.to_string()),
     363            0 :             image_creation_threshold: settings
     364            0 :                 .remove("image_creation_threshold")
     365            0 :                 .map(|x| x.parse::<usize>())
     366            0 :                 .transpose()
     367            0 :                 .context("Failed to parse 'image_creation_threshold' as non zero integer")?,
     368            0 :             image_layer_creation_check_threshold: settings
     369            0 :                 .remove("image_layer_creation_check_threshold")
     370            0 :                 .map(|x| x.parse::<u8>())
     371            0 :                 .transpose()
     372            0 :                 .context("Failed to parse 'image_creation_check_threshold' as integer")?,
     373            0 :             pitr_interval: settings.remove("pitr_interval").map(|x| x.to_string()),
     374            0 :             walreceiver_connect_timeout: settings
     375            0 :                 .remove("walreceiver_connect_timeout")
     376            0 :                 .map(|x| x.to_string()),
     377            0 :             lagging_wal_timeout: settings
     378            0 :                 .remove("lagging_wal_timeout")
     379            0 :                 .map(|x| x.to_string()),
     380            0 :             max_lsn_wal_lag: settings
     381            0 :                 .remove("max_lsn_wal_lag")
     382            0 :                 .map(|x| x.parse::<NonZeroU64>())
     383            0 :                 .transpose()
     384            0 :                 .context("Failed to parse 'max_lsn_wal_lag' as non zero integer")?,
     385            0 :             eviction_policy: settings
     386            0 :                 .remove("eviction_policy")
     387            0 :                 .map(serde_json::from_str)
     388            0 :                 .transpose()
     389            0 :                 .context("Failed to parse 'eviction_policy' json")?,
     390            0 :             min_resident_size_override: settings
     391            0 :                 .remove("min_resident_size_override")
     392            0 :                 .map(|x| x.parse::<u64>())
     393            0 :                 .transpose()
     394            0 :                 .context("Failed to parse 'min_resident_size_override' as integer")?,
     395            0 :             evictions_low_residence_duration_metric_threshold: settings
     396            0 :                 .remove("evictions_low_residence_duration_metric_threshold")
     397            0 :                 .map(|x| x.to_string()),
     398            0 :             heatmap_period: settings.remove("heatmap_period").map(|x| x.to_string()),
     399            0 :             lazy_slru_download: settings
     400            0 :                 .remove("lazy_slru_download")
     401            0 :                 .map(|x| x.parse::<bool>())
     402            0 :                 .transpose()
     403            0 :                 .context("Failed to parse 'lazy_slru_download' as bool")?,
     404            0 :             timeline_get_throttle: settings
     405            0 :                 .remove("timeline_get_throttle")
     406            0 :                 .map(serde_json::from_str)
     407            0 :                 .transpose()
     408            0 :                 .context("parse `timeline_get_throttle` from json")?,
     409            0 :             lsn_lease_length: settings.remove("lsn_lease_length").map(|x| x.to_string()),
     410            0 :             lsn_lease_length_for_ts: settings
     411            0 :                 .remove("lsn_lease_length_for_ts")
     412            0 :                 .map(|x| x.to_string()),
     413            0 :             timeline_offloading: settings
     414            0 :                 .remove("timeline_offloading")
     415            0 :                 .map(|x| x.parse::<bool>())
     416            0 :                 .transpose()
     417            0 :                 .context("Failed to parse 'timeline_offloading' as bool")?,
     418              :         };
     419            0 :         if !settings.is_empty() {
     420            0 :             bail!("Unrecognized tenant settings: {settings:?}")
     421              :         } else {
     422            0 :             Ok(result)
     423              :         }
     424            0 :     }
     425              : 
     426            0 :     pub async fn tenant_config(
     427            0 :         &self,
     428            0 :         tenant_id: TenantId,
     429            0 :         settings: HashMap<&str, &str>,
     430            0 :     ) -> anyhow::Result<()> {
     431            0 :         let config = Self::parse_config(settings)?;
     432            0 :         self.http_client
     433            0 :             .tenant_config(&models::TenantConfigRequest { tenant_id, config })
     434            0 :             .await?;
     435              : 
     436            0 :         Ok(())
     437            0 :     }
     438              : 
     439            0 :     pub async fn timeline_list(
     440            0 :         &self,
     441            0 :         tenant_shard_id: &TenantShardId,
     442            0 :     ) -> anyhow::Result<Vec<TimelineInfo>> {
     443            0 :         Ok(self.http_client.list_timelines(*tenant_shard_id).await?)
     444            0 :     }
     445              : 
     446              :     /// Import a basebackup prepared using either:
     447              :     /// a) `pg_basebackup -F tar`, or
     448              :     /// b) The `fullbackup` pageserver endpoint
     449              :     ///
     450              :     /// # Arguments
     451              :     /// * `tenant_id` - tenant to import into. Created if not exists
     452              :     /// * `timeline_id` - id to assign to imported timeline
     453              :     /// * `base` - (start lsn of basebackup, path to `base.tar` file)
     454              :     /// * `pg_wal` - if there's any wal to import: (end lsn, path to `pg_wal.tar`)
     455            0 :     pub async fn timeline_import(
     456            0 :         &self,
     457            0 :         tenant_id: TenantId,
     458            0 :         timeline_id: TimelineId,
     459            0 :         base: (Lsn, PathBuf),
     460            0 :         pg_wal: Option<(Lsn, PathBuf)>,
     461            0 :         pg_version: u32,
     462            0 :     ) -> anyhow::Result<()> {
     463            0 :         // Init base reader
     464            0 :         let (start_lsn, base_tarfile_path) = base;
     465            0 :         let base_tarfile = tokio::fs::File::open(base_tarfile_path).await?;
     466            0 :         let base_tarfile =
     467            0 :             mgmt_api::ReqwestBody::wrap_stream(tokio_util::io::ReaderStream::new(base_tarfile));
     468              : 
     469              :         // Init wal reader if necessary
     470            0 :         let (end_lsn, wal_reader) = if let Some((end_lsn, wal_tarfile_path)) = pg_wal {
     471            0 :             let wal_tarfile = tokio::fs::File::open(wal_tarfile_path).await?;
     472            0 :             let wal_reader =
     473            0 :                 mgmt_api::ReqwestBody::wrap_stream(tokio_util::io::ReaderStream::new(wal_tarfile));
     474            0 :             (end_lsn, Some(wal_reader))
     475              :         } else {
     476            0 :             (start_lsn, None)
     477              :         };
     478              : 
     479              :         // Import base
     480            0 :         self.http_client
     481            0 :             .import_basebackup(
     482            0 :                 tenant_id,
     483            0 :                 timeline_id,
     484            0 :                 start_lsn,
     485            0 :                 end_lsn,
     486            0 :                 pg_version,
     487            0 :                 base_tarfile,
     488            0 :             )
     489            0 :             .await?;
     490              : 
     491              :         // Import wal if necessary
     492            0 :         if let Some(wal_reader) = wal_reader {
     493            0 :             self.http_client
     494            0 :                 .import_wal(tenant_id, timeline_id, start_lsn, end_lsn, wal_reader)
     495            0 :                 .await?;
     496            0 :         }
     497              : 
     498            0 :         Ok(())
     499            0 :     }
     500              : }
        

Generated by: LCOV version 2.1-beta