diff options
Diffstat (limited to 'src/mongo/s/stale_exception.h')
| -rw-r--r-- | src/mongo/s/stale_exception.h | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/mongo/s/stale_exception.h b/src/mongo/s/stale_exception.h index 1778fe689a4..d82b18bab52 100644 --- a/src/mongo/s/stale_exception.h +++ b/src/mongo/s/stale_exception.h @@ -75,7 +75,7 @@ public: void serialize(BSONObjBuilder* bob) const; static std::shared_ptr<const ErrorExtraInfo> parse(const BSONObj& obj); -private: +protected: NamespaceString _nss; ChunkVersion _received; boost::optional<ChunkVersion> _wanted; @@ -85,42 +85,25 @@ private: boost::optional<SharedSemiFuture<void>> _criticalSectionSignal; }; -// TODO (SERVER-74380): Rename the StaleEpoch code to StaleDownstreamRouter and the info to -// StaleDownstreamRouterInfo class StaleEpochInfo final : public ErrorExtraInfo { public: static constexpr auto code = ErrorCodes::StaleEpoch; - StaleEpochInfo(NamespaceString nss, ChunkVersion received, ChunkVersion wanted) - : _nss(std::move(nss)), _received(received), _wanted(wanted) {} - - // TODO (SERVER-74380): Remove this constructor StaleEpochInfo(NamespaceString nss) : _nss(std::move(nss)) {} const auto& getNss() const { return _nss; } - const auto& getVersionReceived() const { - return _received; - } - - const auto& getVersionWanted() const { - return _wanted; - } - void serialize(BSONObjBuilder* bob) const; static std::shared_ptr<const ErrorExtraInfo> parse(const BSONObj& obj); private: NamespaceString _nss; - - // TODO (SERVER-74380): These two fields are boost::optional for backwards compatibility. Either - // both of them are boost::none or both are set. - boost::optional<ChunkVersion> _received; - boost::optional<ChunkVersion> _wanted; }; +using StaleConfigException = ExceptionFor<ErrorCodes::StaleConfig>; + class StaleDbRoutingVersion final : public ErrorExtraInfo { public: static constexpr auto code = ErrorCodes::StaleDbVersion; |
