From 15c5f3e6cfe86774c55ced328bd507266d464f0f Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 30 Aug 2022 22:18:01 +0300 Subject: [PATCH] Fix misc typos in comments and variable names. --- control_plane/src/safekeeper.rs | 2 +- control_plane/src/storage.rs | 2 +- pageserver/src/layered_repository/timeline.rs | 2 +- pageserver/src/storage_sync/download.rs | 24 +++++++++---------- safekeeper/src/bin/safekeeper.rs | 2 +- test_runner/regress/test_tenant_relocation.py | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/control_plane/src/safekeeper.rs b/control_plane/src/safekeeper.rs index 652736058a..2cc1ae7853 100644 --- a/control_plane/src/safekeeper.rs +++ b/control_plane/src/safekeeper.rs @@ -46,7 +46,7 @@ impl ResponseErrorMessageExt for Response { return Ok(self); } - // reqwest do not export it's error construction utility functions, so lets craft the message ourselves + // reqwest does not export its error construction utility functions, so let's craft the message ourselves let url = self.url().to_owned(); Err(SafekeeperHttpError::Response( match self.json::() { diff --git a/control_plane/src/storage.rs b/control_plane/src/storage.rs index aab29628e3..9fdab5f88c 100644 --- a/control_plane/src/storage.rs +++ b/control_plane/src/storage.rs @@ -57,7 +57,7 @@ impl ResponseErrorMessageExt for Response { return Ok(self); } - // reqwest do not export it's error construction utility functions, so lets craft the message ourselves + // reqwest does not export its error construction utility functions, so let's craft the message ourselves let url = self.url().to_owned(); Err(PageserverHttpError::Response( match self.json::() { diff --git a/pageserver/src/layered_repository/timeline.rs b/pageserver/src/layered_repository/timeline.rs index 1a941affe5..81bc975272 100644 --- a/pageserver/src/layered_repository/timeline.rs +++ b/pageserver/src/layered_repository/timeline.rs @@ -379,7 +379,7 @@ pub struct Timeline { // It is needed in checks when we want to error on some operations // when they are requested for pre-initdb lsn. // It can be unified with latest_gc_cutoff_lsn under some "first_valid_lsn", - // though lets keep them both for better error visibility. + // though let's keep them both for better error visibility. pub initdb_lsn: Lsn, /// When did we last calculate the partitioning? diff --git a/pageserver/src/storage_sync/download.rs b/pageserver/src/storage_sync/download.rs index 8e6aa47c88..ded4c042c4 100644 --- a/pageserver/src/storage_sync/download.rs +++ b/pageserver/src/storage_sync/download.rs @@ -234,11 +234,11 @@ pub(super) async fn download_timeline_layers<'a>( let mut download_tasks = layers_to_download .into_iter() - .map(|layer_desination_path| async move { - if layer_desination_path.exists() { + .map(|layer_destination_path| async move { + if layer_destination_path.exists() { debug!( "Layer already exists locally, skipping download: {}", - layer_desination_path.display() + layer_destination_path.display() ); } else { // Perform a rename inspired by durable_rename from file_utils.c. @@ -252,7 +252,7 @@ pub(super) async fn download_timeline_layers<'a>( // https://www.postgresql.org/message-id/56583BDD.9060302@2ndquadrant.com // If pageserver crashes the temp file will be deleted on startup and re-downloaded. let temp_file_path = - path_with_suffix_extension(&layer_desination_path, TEMP_DOWNLOAD_EXTENSION); + path_with_suffix_extension(&layer_destination_path, TEMP_DOWNLOAD_EXTENSION); let mut destination_file = fs::File::create(&temp_file_path).await.with_context(|| { @@ -262,7 +262,7 @@ pub(super) async fn download_timeline_layers<'a>( ) })?; - let mut layer_download = download_storage_object(storage, &layer_desination_path) + let mut layer_download = download_storage_object(storage, &layer_destination_path) .await .with_context(|| { format!( @@ -284,9 +284,9 @@ pub(super) async fn download_timeline_layers<'a>( // that have not yet completed. To ensure that a file is closed immediately when it is dropped, // you should call flush before dropping it. // - // From the tokio code I see that it waits for pending operations to complete. There shouldt be any because - // we assume that `destination_file` file is fully written. I e there is no pending .write(...).await operations. - // But for additional safety lets check/wait for any pending operations. + // From the tokio code I see that it waits for pending operations to complete. There shouldn't be any because + // we assume that `destination_file` file is fully written. I.e there is no pending .write(...).await operations. + // But for additional safety let's check/wait for any pending operations. destination_file.flush().await.with_context(|| { format!( "failed to flush source file at {}", @@ -307,16 +307,16 @@ pub(super) async fn download_timeline_layers<'a>( anyhow::bail!("remote-storage-download-pre-rename failpoint triggered") }); - fs::rename(&temp_file_path, &layer_desination_path).await?; + fs::rename(&temp_file_path, &layer_destination_path).await?; - fsync_path(&layer_desination_path).await.with_context(|| { + fsync_path(&layer_destination_path).await.with_context(|| { format!( "Cannot fsync layer destination path {}", - layer_desination_path.display(), + layer_destination_path.display(), ) })?; } - Ok::<_, anyhow::Error>(layer_desination_path) + Ok::<_, anyhow::Error>(layer_destination_path) }) .collect::>(); diff --git a/safekeeper/src/bin/safekeeper.rs b/safekeeper/src/bin/safekeeper.rs index 6c9c59c76b..244c793250 100644 --- a/safekeeper/src/bin/safekeeper.rs +++ b/safekeeper/src/bin/safekeeper.rs @@ -70,7 +70,7 @@ fn main() -> anyhow::Result<()> { .help(formatcp!("http endpoint address for metrics on ip:port (default: {DEFAULT_HTTP_LISTEN_ADDR})")), ) // FIXME this argument is no longer needed since pageserver address is forwarded from compute. - // However because this argument is in use by console's e2e tests lets keep it for now and remove separately. + // However because this argument is in use by console's e2e tests let's keep it for now and remove separately. // So currently it is a noop. .arg( Arg::new("pageserver") diff --git a/test_runner/regress/test_tenant_relocation.py b/test_runner/regress/test_tenant_relocation.py index 4d949e0c13..19b0ec05a7 100644 --- a/test_runner/regress/test_tenant_relocation.py +++ b/test_runner/regress/test_tenant_relocation.py @@ -170,7 +170,7 @@ def check_timeline_attached( new_timeline_detail = assert_timeline_local(new_pageserver_http_client, tenant_id, timeline_id) # when load is active these checks can break because lsns are not static - # so lets check with some margin + # so let's check with some margin assert_abs_margin_ratio( lsn_from_hex(new_timeline_detail["local"]["disk_consistent_lsn"]), lsn_from_hex(old_timeline_detail["local"]["disk_consistent_lsn"]),