Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 36 additions & 34 deletions src/groups/mqb/mqbblp/mqbblp_recoverymanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace {

const char k_LOG_CATEGORY[] = "MQBBLP.RECOVERYMANAGER";

const unsigned int k_STARTUP_WAIT_RETRIES = 10;
const unsigned int k_STARTUP_WAIT_RETRIES = 20;
const unsigned int k_STARTUP_WAIT_RETRY_MS = 1000;

/// This class provides a custom comparator to compare two (sync-point,
Expand Down Expand Up @@ -470,8 +470,40 @@ void RecoveryManager::recoveryStartupWaitPartitionDispatched(
return; // RETURN
}

// No sync point has been received for this partition in the startup wait
// duration.
BALL_LOG_WARN << d_clusterData_p->identity().description()
<< ": Partition [" << partitionId
<< "], no sync point has been received during "
<< "recovery wait-time.";

if (d_clusterData_p->electorInfo().isSelfLeader()) {
BALL_LOG_WARN
<< d_clusterData_p->identity().description() << ": Partition ["
<< partitionId
<< "], not extending the wait for sync points on the leader.";
}
else if (recoveryCtx.onStartupWaitRetry() > k_STARTUP_WAIT_RETRIES) {
BALL_LOG_WARN
<< d_clusterData_p->identity().description() << ": Partition ["
<< partitionId
<< "], not extending the wait for sync points after retrying "
<< k_STARTUP_WAIT_RETRIES << " times.";
}
else {
BALL_LOG_WARN << d_clusterData_p->identity().description()
<< ": Partition [" << partitionId
<< "], extending the wait for sync points.";

bsls::TimeInterval after(bmqsys::Time::nowMonotonicClock());
after.addMilliseconds(k_STARTUP_WAIT_RETRY_MS);
d_clusterData_p->scheduler().scheduleEvent(
&recoveryCtx.recoveryStartupWaitHandle(),
after,
bdlf::BindUtil::bind(&RecoveryManager::recoveryStartupWaitCb,
this,
partitionId));

return; // RETURN
}

if (availableNodes.empty()) {
// No peers are AVAILABLE. Node will recover from local files only.
Expand All @@ -487,38 +519,8 @@ void RecoveryManager::recoveryStartupWaitPartitionDispatched(

BALL_LOG_WARN << d_clusterData_p->identity().description()
<< ": Partition [" << partitionId
<< "], no sync point has been received during "
<< "recovery wait-time and no peers are available. ";
<< "], no peers are available.";

if (d_clusterData_p->electorInfo().isSelfLeader()) {
BALL_LOG_WARN
<< d_clusterData_p->identity().description() << ": Partition ["
<< partitionId
<< "], not extending the wait for sync points on the leader.";
}
else if (recoveryCtx.onStartupWaitRetry() > k_STARTUP_WAIT_RETRIES) {
BALL_LOG_WARN
<< d_clusterData_p->identity().description() << ": Partition ["
<< partitionId
<< "], not extending the wait for sync points after retrying "
<< k_STARTUP_WAIT_RETRIES << " times.";
}
else {
BALL_LOG_WARN << d_clusterData_p->identity().description()
<< ": Partition [" << partitionId
<< "], extending the wait for sync points.";

bsls::TimeInterval after(bmqsys::Time::nowMonotonicClock());
after.addMilliseconds(k_STARTUP_WAIT_RETRY_MS);
d_clusterData_p->scheduler().scheduleEvent(
&recoveryCtx.recoveryStartupWaitHandle(),
after,
bdlf::BindUtil::bind(&RecoveryManager::recoveryStartupWaitCb,
this,
partitionId));

return; // RETURN
}
if (0 != recoveryCtx.oldSyncPointOffset()) {
BALL_LOG_WARN << d_clusterData_p->identity().description()
<< ": Partition [" << partitionId
Expand Down
Loading