diff options
Diffstat (limited to 'src/mongo/s/catalog/sharding_catalog_client.h')
-rw-r--r-- | src/mongo/s/catalog/sharding_catalog_client.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client.h b/src/mongo/s/catalog/sharding_catalog_client.h index ef0337dbf1a..fbcb9f71ec6 100644 --- a/src/mongo/s/catalog/sharding_catalog_client.h +++ b/src/mongo/s/catalog/sharding_catalog_client.h @@ -277,11 +277,21 @@ public: /** * Writes a diagnostic event to the change log. */ - virtual Status logChange(OperationContext* opCtx, - const std::string& what, - const std::string& ns, - const BSONObj& detail, - const WriteConcernOptions& writeConcern) = 0; + virtual Status logChangeChecked(OperationContext* opCtx, + const std::string& what, + const std::string& ns, + const BSONObj& detail, + const WriteConcernOptions& writeConcern) = 0; + + void logChange(OperationContext* const opCtx, + const std::string& what, + const std::string& ns, + const BSONObj& detail, + const WriteConcernOptions& writeConcern) { + // It is safe to ignore the results of `logChangeChecked` in many cases, as the + // failure to log a change is often of no consequence. + logChangeChecked(opCtx, what, ns, detail, writeConcern).ignore(); + } /** * Reads global sharding settings from the confing.settings collection. The key parameter is |