Fix misc typos in comments and variable names.

This commit is contained in:
Heikki Linnakangas
2022-08-30 22:18:01 +03:00
parent 46c8a93976
commit 15c5f3e6cf
6 changed files with 17 additions and 17 deletions

View File

@@ -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::<HttpErrorBody>() {

View File

@@ -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::<HttpErrorBody>() {

View File

@@ -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?

View File

@@ -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::<FuturesUnordered<_>>();

View File

@@ -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")

View File

@@ -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"]),