Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
- Rename error variant for clarity
- Comment on deletion batch size
  • Loading branch information
bnaecker committed Jul 11, 2024
1 parent accb313 commit c9bd27c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion oximeter/db/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,9 @@ impl Client {
})
.await?;

// This size is arbitrary, and just something to avoid enormous requests
// to ClickHouse. It's unlikely that we'll hit this in practice anyway,
// given that we have far fewer than 1000 timeseries today.
const DELETE_BATCH_SIZE: usize = 1000;
let maybe_on_cluster = if replicated {
format!("ON CLUSTER {}", crate::CLUSTER_NAME)
Expand Down Expand Up @@ -1056,7 +1059,7 @@ impl Client {
.map(|line| line.trim().parse().map_err(Error::from))
.collect(),
Err(e) if e.kind() == ErrorKind::NotFound => Ok(vec![]),
Err(err) => Err(Error::ReadTimeseriesToDelete { err }),
Err(err) => Err(Error::ReadTimeseriesToDeleteFile { err }),
}
}

Expand Down
2 changes: 1 addition & 1 deletion oximeter/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub enum Error {
NonSequentialSchemaVersions,

#[error("Could not read timeseries_to_delete file")]
ReadTimeseriesToDelete {
ReadTimeseriesToDeleteFile {
#[source]
err: io::Error,
},
Expand Down

0 comments on commit c9bd27c

Please sign in to comment.