Skip to content

Commit

Permalink
Support migrations using non-disk storage #1094
Browse files Browse the repository at this point in the history
* Use kvx with explicit namespace type.
* Do not depend on a data dir for storage.
* Fix upgrade code.
  • Loading branch information
Tim Bruijnzeels authored Sep 21, 2023
1 parent dfc23de commit 2b17a1c
Show file tree
Hide file tree
Showing 30 changed files with 545 additions and 591 deletions.
15 changes: 6 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ hyper = { version = "^0.14", features = ["server"] }
intervaltree = "0.2.6"
jmespatch = { version = "^0.3", features = ["sync"], optional = true }
kmip = { version = "0.4.2", package = "kmip-protocol", features = ["tls-with-openssl"], optional = true }
kvx = { version = "0.6.0", features = ["macros"] }
# kvx = { version = "0.6.0", git = "https://github.com/nlnetlabs/kvx", features = ["macros"] }
# kvx = { version = "0.6.0", features = ["macros"] }
kvx = { version = "0.7.0", git = "https://github.com/nlnetlabs/kvx", branch = "support-namespace-migrations", features = ["macros"] }
libflate = "^1"
log = "^0.4"
once_cell = { version = "^1.7.2", optional = true }
Expand Down
10 changes: 2 additions & 8 deletions src/bin/krillup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ async fn main() {

match Config::create(config_file, true) {
Ok(config) => {
let properties_manager = match PropertiesManager::create(&config.storage_uri, config.use_history_cache)
{
let properties_manager = match PropertiesManager::create(&config.storage_uri, config.use_history_cache) {
Ok(mgr) => mgr,
Err(e) => {
eprintln!("*** Error Preparing Data Migration ***");
Expand Down Expand Up @@ -61,12 +60,7 @@ async fn main() {
let from = report.versions().from();
let to = report.versions().to();
if report.data_migration() {
info!(
"Prepared and verified upgrade from {} to {}. Prepared data was saved to: {}",
from,
to,
config.upgrade_storage_uri()
);
info!("Prepared and verified upgrade from {} to {}.", from, to,);
} else {
info!("No preparation is needed for the upgrade from {} to {}.", from, to)
}
Expand Down
5 changes: 3 additions & 2 deletions src/cli/ta_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::{

use bytes::Bytes;
use clap::{App, Arg, ArgMatches, SubCommand};

use log::LevelFilter;
use rpki::{
ca::idexchange::{self, ChildHandle, RepoInfo, ServiceUri},
Expand All @@ -28,7 +29,7 @@ use crate::{
api::{AddChildRequest, ApiRepositoryContact, CertAuthInfo, IdCertInfo, RepositoryContact, Token},
crypto::{KrillSigner, KrillSignerBuilder, OpenSslSignerConfig},
error::Error as KrillError,
eventsourcing::{segment, AggregateStore, AggregateStoreError, Segment},
eventsourcing::{namespace, AggregateStore, AggregateStoreError, Namespace},
util::{file, httpclient},
},
constants::{
Expand Down Expand Up @@ -1002,7 +1003,7 @@ struct TrustAnchorSignerManager {

impl TrustAnchorSignerManager {
fn create(config: Config) -> Result<Self, Error> {
let store = AggregateStore::create(&config.storage_uri, segment!("signer"), config.use_history_cache)
let store = AggregateStore::create(&config.storage_uri, namespace!("signer"), config.use_history_cache)
.map_err(KrillError::AggregateStoreError)?;
let ta_handle = TrustAnchorHandle::new("ta".into());
let signer = config.signer()?;
Expand Down
Loading

0 comments on commit 2b17a1c

Please sign in to comment.