diff options
Diffstat (limited to 'src/mongo/s/write_ops/batch_downconvert.h')
-rw-r--r-- | src/mongo/s/write_ops/batch_downconvert.h | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/src/mongo/s/write_ops/batch_downconvert.h b/src/mongo/s/write_ops/batch_downconvert.h index e3c6cc56f6a..659e59d3a9a 100644 --- a/src/mongo/s/write_ops/batch_downconvert.h +++ b/src/mongo/s/write_ops/batch_downconvert.h @@ -41,50 +41,48 @@ namespace mongo { - class MultiCommandDispatch; +class MultiCommandDispatch; - // Used for reporting legacy write concern responses - struct LegacyWCResponse { - std::string shardHost; - BSONObj gleResponse; - std::string errToReport; - }; +// Used for reporting legacy write concern responses +struct LegacyWCResponse { + std::string shardHost; + BSONObj gleResponse; + std::string errToReport; +}; - /** - * Uses GLE and the shard hosts and opTimes last written by write commands to enforce a - * write concern across the previously used shards. - * - * Returns OK with the LegacyWCResponses containing only write concern error information - * Returns !OK if there was an error getting a GLE response - */ - Status enforceLegacyWriteConcern( MultiCommandDispatch* dispatcher, - StringData dbName, - const BSONObj& options, - const HostOpTimeMap& hostOpTimes, - std::vector<LegacyWCResponse>* wcResponses ); - - // - // Below exposed for testing only - // - - // Helper that acts as an auto-ptr for write and wc errors - struct GLEErrors { - std::unique_ptr<WriteErrorDetail> writeError; - std::unique_ptr<WCErrorDetail> wcError; - }; +/** + * Uses GLE and the shard hosts and opTimes last written by write commands to enforce a + * write concern across the previously used shards. + * + * Returns OK with the LegacyWCResponses containing only write concern error information + * Returns !OK if there was an error getting a GLE response + */ +Status enforceLegacyWriteConcern(MultiCommandDispatch* dispatcher, + StringData dbName, + const BSONObj& options, + const HostOpTimeMap& hostOpTimes, + std::vector<LegacyWCResponse>* wcResponses); - /** - * Given a GLE response, extracts a write error and a write concern error for the previous - * operation. - * - * Returns !OK if the GLE itself failed in an unknown way. - */ - Status extractGLEErrors( const BSONObj& gleResponse, GLEErrors* errors ); +// +// Below exposed for testing only +// - /** - * Given a GLE response, strips out all non-write-concern related information - */ - BSONObj stripNonWCInfo( const BSONObj& gleResponse ); +// Helper that acts as an auto-ptr for write and wc errors +struct GLEErrors { + std::unique_ptr<WriteErrorDetail> writeError; + std::unique_ptr<WCErrorDetail> wcError; +}; +/** + * Given a GLE response, extracts a write error and a write concern error for the previous + * operation. + * + * Returns !OK if the GLE itself failed in an unknown way. + */ +Status extractGLEErrors(const BSONObj& gleResponse, GLEErrors* errors); +/** + * Given a GLE response, strips out all non-write-concern related information + */ +BSONObj stripNonWCInfo(const BSONObj& gleResponse); } |