summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/base_cloner.cpp2
-rw-r--r--src/mongo/db/repl/base_cloner.h2
-rw-r--r--src/mongo/db/repl/initial_syncer.cpp18
-rw-r--r--src/mongo/db/repl/initial_syncer.h14
4 files changed, 18 insertions, 18 deletions
diff --git a/src/mongo/db/repl/base_cloner.cpp b/src/mongo/db/repl/base_cloner.cpp
index a9a51f891bf..40a17c02a0c 100644
--- a/src/mongo/db/repl/base_cloner.cpp
+++ b/src/mongo/db/repl/base_cloner.cpp
@@ -167,7 +167,7 @@ Status BaseCloner::checkRollBackIdIsUnchanged() {
try {
getClient()->simpleCommand("admin", &info, "replSetGetRBID");
} catch (DBException& e) {
- if (ErrorCodes::isNetworkError(e)) {
+ if (ErrorCodes::isRetriableError(e)) {
auto status = e.toStatus().withContext(
": failed while attempting to retrieve rollBackId after re-connect");
LOG(1) << status;
diff --git a/src/mongo/db/repl/base_cloner.h b/src/mongo/db/repl/base_cloner.h
index 1961c57bd6f..7efdd9e640b 100644
--- a/src/mongo/db/repl/base_cloner.h
+++ b/src/mongo/db/repl/base_cloner.h
@@ -103,7 +103,7 @@ protected:
* Returns true if the Status represents an error which should be retried.
*/
virtual bool isTransientError(const Status& status) {
- return ErrorCodes::isNetworkError(status);
+ return ErrorCodes::isRetriableError(status);
}
/**
diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp
index 08c54f5738f..0c9bda496d3 100644
--- a/src/mongo/db/repl/initial_syncer.cpp
+++ b/src/mongo/db/repl/initial_syncer.cpp
@@ -299,7 +299,7 @@ void InitialSyncer::_cancelRemainingWork_inlock() {
_shutdownComponent_inlock(_oplogFetcher);
if (_sharedData) {
// We actually hold the required lock, but the lock object itself is not passed through.
- _clearNetworkError(WithLock::withoutLock());
+ _clearRetriableError(WithLock::withoutLock());
stdx::lock_guard<InitialSyncSharedData> lock(*_sharedData);
_sharedData->setInitialSyncStatusIfOK(
lock, Status{ErrorCodes::CallbackCanceled, "Initial sync attempt canceled"});
@@ -1192,7 +1192,7 @@ void InitialSyncer::_lastOplogEntryFetcherCallbackForStopTimestamp(
stdx::lock_guard<Latch> lock(_mutex);
auto status = _checkForShutdownAndConvertStatus_inlock(
result.getStatus(), "error fetching last oplog entry for stop timestamp");
- if (_shouldRetryNetworkError(lock, status)) {
+ if (_shouldRetryError(lock, status)) {
auto scheduleStatus = _exec->scheduleWork(
[this, onCompletionGuard](executor::TaskExecutor::CallbackArgs args) {
// It is not valid to schedule the retry from within this callback,
@@ -1417,7 +1417,7 @@ void InitialSyncer::_rollbackCheckerCheckForRollbackCallback(
stdx::lock_guard<Latch> lock(_mutex);
auto status = _checkForShutdownAndConvertStatus_inlock(result.getStatus(),
"error while getting last rollback ID");
- if (_shouldRetryNetworkError(lock, status)) {
+ if (_shouldRetryError(lock, status)) {
LOG(1) << "Retrying rollback checker because of network error " << status;
_scheduleRollbackCheckerCheckForRollback_inlock(lock, onCompletionGuard);
return;
@@ -1712,18 +1712,18 @@ void InitialSyncer::_scheduleRollbackCheckerCheckForRollback_inlock(
return;
}
-bool InitialSyncer::_shouldRetryNetworkError(WithLock lk, Status status) {
- if (ErrorCodes::isNetworkError(status)) {
+bool InitialSyncer::_shouldRetryError(WithLock lk, Status status) {
+ if (ErrorCodes::isRetriableError(status)) {
stdx::lock_guard<InitialSyncSharedData> sharedDataLock(*_sharedData);
return _sharedData->shouldRetryOperation(sharedDataLock, &_retryingOperation);
}
- // The status was OK or some error other than a network error, so clear the network error
+ // The status was OK or some error other than a retriable error, so clear the retriable error
// state and indicate that we should not retry.
- _clearNetworkError(lk);
+ _clearRetriableError(lk);
return false;
}
-void InitialSyncer::_clearNetworkError(WithLock lk) {
+void InitialSyncer::_clearRetriableError(WithLock lk) {
_retryingOperation = boost::none;
}
@@ -1919,7 +1919,7 @@ void InitialSyncer::InitialSyncAttemptInfo::append(BSONObjBuilder* builder) cons
bool InitialSyncer::OplogFetcherRestartDecisionInitialSyncer::shouldContinue(
AbstractOplogFetcher* fetcher, Status status) {
- if (ErrorCodes::isNetworkError(status)) {
+ if (ErrorCodes::isRetriableError(status)) {
stdx::lock_guard<InitialSyncSharedData> lk(*_sharedData);
return _sharedData->shouldRetryOperation(lk, &_retryingOperation);
}
diff --git a/src/mongo/db/repl/initial_syncer.h b/src/mongo/db/repl/initial_syncer.h
index 399fdd57c54..54506e384fe 100644
--- a/src/mongo/db/repl/initial_syncer.h
+++ b/src/mongo/db/repl/initial_syncer.h
@@ -596,17 +596,17 @@ private:
const stdx::lock_guard<Latch>& lock, std::shared_ptr<OnCompletionGuard> onCompletionGuard);
/**
- * Check if a status is one which means there's a network error and we should retry the current
- * operation, and records whether an operation is currently being retried. Note this can only
- * handle one operation at a time (i.e. it should not be used in both parts of the "split"
- * section of Initial Sync)
+ * Check if a status is one which means there's a retriable error and we should retry the
+ * current operation, and records whether an operation is currently being retried. Note this
+ * can only handle one operation at a time (i.e. it should not be used in both parts of the
+ * "split" section of Initial Sync)
*/
- bool _shouldRetryNetworkError(WithLock lk, Status status);
+ bool _shouldRetryError(WithLock lk, Status status);
/**
- * Indicates we are no longer handling a network error.
+ * Indicates we are no longer handling a retriable error.
*/
- void _clearNetworkError(WithLock lk);
+ void _clearRetriableError(WithLock lk);
/**
* Checks the given status (or embedded status inside the callback args) and current data