Skip to content

Commit 1a0a260

Browse files
leftwoAlan Hanson
and
Alan Hanson
authored
Log when pantry/volume layers activate things (#1670)
While debugging other problems, we found it difficult to determine when a pantry had activated which part of a multi level VCR. This adds some log messages showing when each piece of the VCR is activated. Co-authored-by: Alan Hanson <alan@oxide.computer>
1 parent 3571dae commit 1a0a260

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

pantry/src/pantry.rs

+7
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ impl PantryEntry {
410410
}
411411

412412
pub async fn detach(&self) -> Result<(), CrucibleError> {
413+
let uuid = self.volume.get_uuid().await;
413414
self.volume.deactivate().await?;
415+
info!(self.log, "Pantry detach and deactivated {:?}", uuid);
414416
Ok(())
415417
}
416418

@@ -436,6 +438,11 @@ impl PantryEntry {
436438
drop(inner);
437439

438440
self.volume.activate().await?;
441+
info!(
442+
self.log,
443+
"Pantry activated {:?}",
444+
self.volume.get_uuid().await
445+
);
439446
}
440447

441448
ActiveObservation::SawActive => {

upstairs/src/volume.rs

+20
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,11 @@ impl BlockIO for VolumeInner {
655655
async fn activate(&self) -> Result<(), CrucibleError> {
656656
for sub_volume in &self.sub_volumes {
657657
sub_volume.activate().await?;
658+
info!(
659+
self.log,
660+
"Activated sub_volume {}",
661+
sub_volume.get_uuid().await?
662+
);
658663

659664
let sub_volume_computed_size = self.block_size
660665
* (sub_volume.lba_range.end - sub_volume.lba_range.start);
@@ -666,13 +671,23 @@ impl BlockIO for VolumeInner {
666671

667672
if let Some(ref read_only_parent) = &self.read_only_parent {
668673
read_only_parent.activate().await?;
674+
info!(
675+
self.log,
676+
"Activated read_only_parent {}",
677+
read_only_parent.get_uuid().await?
678+
);
669679
}
670680

671681
Ok(())
672682
}
673683
async fn activate_with_gen(&self, gen: u64) -> Result<(), CrucibleError> {
674684
for sub_volume in &self.sub_volumes {
675685
sub_volume.activate_with_gen(gen).await?;
686+
info!(
687+
self.log,
688+
"Activated sub_volume {}",
689+
sub_volume.get_uuid().await?
690+
);
676691

677692
let sub_volume_computed_size = self.block_size
678693
* (sub_volume.lba_range.end - sub_volume.lba_range.start);
@@ -684,6 +699,11 @@ impl BlockIO for VolumeInner {
684699

685700
if let Some(ref read_only_parent) = &self.read_only_parent {
686701
read_only_parent.activate_with_gen(gen).await?;
702+
info!(
703+
self.log,
704+
"Activated read_only_parent {}",
705+
read_only_parent.get_uuid().await?
706+
);
687707
}
688708

689709
Ok(())

0 commit comments

Comments
 (0)