Skip to content

Commit

Permalink
[oximeter] Add minimal versioning support (#4246)
Browse files Browse the repository at this point in the history
Provides a mechanism to explicitly version Oximeter schema used within
Clickhouse, and to wipe that data
if any schema-breaking changes are made.

This is retroactively intended to solve the problems discussed within
#4221 , where the
`timeseries_key` generation was altered.
  • Loading branch information
smklein authored Oct 12, 2023
1 parent 7d55382 commit 2af5ec9
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 15 deletions.
7 changes: 2 additions & 5 deletions oximeter/collector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use omicron_common::backoff;
use omicron_common::FileKv;
use oximeter::types::ProducerResults;
use oximeter::types::ProducerResultsItem;
use oximeter_db::model::OXIMETER_VERSION;
use oximeter_db::Client;
use oximeter_db::DbWrite;
use serde::Deserialize;
Expand Down Expand Up @@ -455,11 +456,7 @@ impl OximeterAgent {
};
let client = Client::new(db_address, &log);
let replicated = client.is_oximeter_cluster().await?;
if !replicated {
client.init_single_node_db().await?;
} else {
client.init_replicated_db().await?;
}
client.initialize_db_with_version(replicated, OXIMETER_VERSION).await?;

// Spawn the task for aggregating and inserting all metrics
tokio::spawn(async move {
Expand Down
Loading

0 comments on commit 2af5ec9

Please sign in to comment.