Skip to content

Commit 34a5d87

Browse files
leftwoAlan Hanson
andauthored
Print version on startup for pantry and agent (#1723)
Added the same version printing on startup that the upstairs and downstairs have to pantry and the agent. Fixed a clippy lint in the upstairs. Agent log looks like this now: ``` root@oxz_crucible_a22da429:~# cat /var/svc/log/oxide-crucible-agent:default.log | looker [ May 28 16:53:10 Enabled. ] [ May 28 16:53:10 Executing start method ("/opt/oxide/crucible/bin/crucible-agent run -D /opt/oxide/crucible/bin/crucible-downstairs --dataset oxp_243db6c1-e3d4-47cc-bd99-86c24b733e6e/crucible -l [fd00:1 122:3344:101::12]:32345 -P 19000 -p downstairs -s snapshot"). ] note: configured to log to "/dev/stdout" 16:53:10.274Z INFO crucible-agent: Crucible Version: Crucible Version: 0.0.1 Commit SHA: dd892d4 Commit timestamp: 2025-05-27T20:18:55.000000000Z branch: alan/agent-needs-workers rustc: 1.86.0 stable x86_64-unknown-illumos Cargo: x86_64-unknown-illumos Debug: false Opt level: 3 16:53:10.282Z INFO crucible-agent: dataset: "oxp_243db6c1-e3d4-47cc-bd99-86c24b733e6e/crucible" 16:53:10.282Z INFO crucible-agent: listen IP: [fd00:1122:3344:101::12]:32345 16:53:10.282Z INFO crucible-agent: SMF instance name downstairs_prefix: "downstairs" 16:53:10.304Z INFO crucible-agent (datafile): Using conf_path:"/data/crucible.json" 16:53:10.346Z INFO crucible-agent (dropshot): listening ... ``` Co-authored-by: Alan Hanson <alan@oxide.computer>
1 parent ad7f539 commit 34a5d87

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

agent/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ async fn main() -> Result<()> {
261261
}
262262
.to_logger(PROG)?;
263263

264+
let info = crucible_common::BuildInfo::default();
265+
info!(log, "Crucible Version: {}", info);
264266
info!(log, "dataset: {:?}", dataset);
265267
info!(log, "listen IP: {:?}", listen);
266268
info!(

pantry/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::Arc;
44

55
use anyhow::Result;
66
use dropshot::{ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel};
7-
use slog::{o, Logger};
7+
use slog::{info, o, Logger};
88

99
pub const PROG: &str = "crucible-pantry";
1010

@@ -19,6 +19,8 @@ pub fn initialize_pantry() -> Result<(Logger, Arc<pantry::Pantry>)> {
1919
}
2020
.to_logger(PROG)?;
2121

22+
let info = crucible_common::BuildInfo::default();
23+
info!(log, "Crucible Version: {}", info);
2224
let pantry =
2325
Arc::new(pantry::Pantry::new(log.new(o!("component" => "datafile")))?);
2426

upstairs/src/volume.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ impl Volume {
13901390
log: &Logger,
13911391
) -> Result<Option<(SocketAddr, SocketAddr)>, CrucibleError> {
13921392
let compare_result =
1393-
Self::compare_vcr_for_replacement(log, &original, &replacement)?;
1393+
Self::compare_vcr_for_replacement(&original, &replacement)?;
13941394

13951395
info!(log, "compare result is {:?}", compare_result);
13961396

@@ -1522,7 +1522,6 @@ impl Volume {
15221522
// parsing the CompareResult and deciding what to do if there are
15231523
// multiple changes.
15241524
fn compare_vcr_for_replacement(
1525-
log: &Logger,
15261525
o_vol: &VolumeConstructionRequest,
15271526
n_vol: &VolumeConstructionRequest,
15281527
) -> Result<CompareResult, CrucibleError> {
@@ -1578,7 +1577,7 @@ impl Volume {
15781577
o_sub_volumes.iter().zip(n_sub_volumes.iter())
15791578
{
15801579
let sv_res =
1581-
Self::compare_vcr_for_replacement(log, o_sv, new_sv)?;
1580+
Self::compare_vcr_for_replacement(o_sv, new_sv)?;
15821581
sv_results.push(sv_res);
15831582
}
15841583
let read_only_parent_compare =
@@ -1601,9 +1600,7 @@ impl Volume {
16011600
}
16021601

16031602
(Some(o_vol), Some(n_vol)) => {
1604-
Self::compare_vcr_for_replacement(
1605-
log, o_vol, n_vol,
1606-
)?
1603+
Self::compare_vcr_for_replacement(o_vol, n_vol)?
16071604
}
16081605
});
16091606

0 commit comments

Comments
 (0)