Skip to content

Commit

Permalink
chore: increase ps_retries and silence log once logged
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
  • Loading branch information
Abhinandan-Purkait committed Dec 18, 2024
1 parent d6fcd63 commit 47b5bce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions io-engine/src/bdev/nexus/nexus_persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ impl<'n> Nexus<'n> {
};
nexus_info.children.push(child_info);
});
// We started with this child because it was healthy in etcd, or isn't there at all.
// Being unhealthy here means it is undergoing a fault/retire before nexus is open.
if nexus_info.children.len() == 1 && !nexus_info.children[0].healthy {
// We started with this child because it was healthy in etcd, or
// isn't there at all. Being unhealthy here
// means it is undergoing a fault/retire before nexus is open.
if nexus_info.children.len() == 1
&& !nexus_info.children[0].healthy
{
warn!("{self:?} Not persisting: the only child went unhealthy during nexus creation");
return Err(Error::NexusCreate {
name: self.name.clone(),
Expand Down Expand Up @@ -224,6 +227,7 @@ impl<'n> Nexus<'n> {
};

let mut retry = PersistentStore::retries();
let mut logged = false;
loop {
let Err(err) = PersistentStore::put(&key, &info.inner).await else {
trace!(?key, "{self:?}: the state was saved successfully");
Expand All @@ -238,10 +242,13 @@ impl<'n> Nexus<'n> {
});
}

error!(
"{self:?}: failed to persist nexus information, \
will retry ({retry} left): {err}"
);
if !logged {
error!(
"{self:?}: failed to persist nexus information, \
will retry ({retry} left): {err}"
);
logged = true;
}

// Allow some time for the connection to the persistent
// store to be re-established before retrying the operation.
Expand Down
2 changes: 1 addition & 1 deletion io-engine/src/core/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub struct MayastorCliArgs {
)]
/// Persistent store timeout.
pub ps_timeout: Duration,
#[clap(long = "ps-retries", default_value = "30")]
#[clap(long = "ps-retries", default_value = "255")]
/// Persistent store operation retries.
pub ps_retries: u8,
#[clap(long = "bdev-pool-size", default_value = "65535")]
Expand Down

0 comments on commit 47b5bce

Please sign in to comment.