Skip to content

Commit

Permalink
[backup] use the backup coordinator in cluster-test
Browse files Browse the repository at this point in the history
Closes: aptos-labs#5372
Approved by: lightmark
  • Loading branch information
msmouse authored and bors-libra committed Jul 30, 2020
1 parent f74b2c9 commit 5727a7e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use tokio_util::compat::FuturesAsyncReadCompatExt;
pub struct BackupServiceClientOpt {
#[structopt(
long = "backup-service-port",
default_value = "7777",
help = "Backup service port. The service must listen on localhost."
)]
pub port: u16,
Expand Down
6 changes: 5 additions & 1 deletion storage/backup/backup-cli/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ use tokio::fs::metadata;

#[derive(Clone, StructOpt)]
pub struct GlobalBackupOpt {
#[structopt(long = "max-chunk-size", help = "Maximum chunk file size in bytes.")]
#[structopt(
long = "max-chunk-size",
default_value = "1073741824",
help = "Maximum chunk file size in bytes."
)]
pub max_chunk_size: usize,
}

Expand Down
11 changes: 4 additions & 7 deletions testsuite/cluster-test/src/experiments/performance_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,10 @@ impl PerformanceBenchmark {
.ok_or_else(|| anyhow!("No up validator."))?
.clone();

const COMMAND: &str = "while true; do \
/opt/libra/bin/db-backup one-shot backup \
--max-chunk-size 1073741824 --backup-service-port 7777 \
state-snapshot \
--state-version $(/opt/libra/bin/db-backup one-shot query node-state --backup-service-port 7777 | sed -n 's/.* committed_version: \\([0-9]*\\).*/\\1/p') \
local-fs --dir $(mktemp -d -t libra_backup_XXXXXXXX); \
done";
const COMMAND: &str = "/opt/libra/bin/db-backup coordinator run \
--transaction-batch-size 20000 \
--state-snapshot-interval 1000 \
local-fs --dir $(mktemp -d -t libra_backup_XXXXXXXX);";

Ok(Some(tokio::spawn(async move {
validator.exec(COMMAND, true).await.unwrap_or_else(|e| {
Expand Down

0 comments on commit 5727a7e

Please sign in to comment.