summaryrefslogtreecommitdiff
path: root/src/mongo/s/stale_exception.h
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-14 14:26:38 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-14 14:26:38 -0300
commit294bc6ecabf14c09c9bc8644704921dcf97cb44e (patch)
tree279b1e0bab53901a1647ac63c1c724f0f789a663 /src/mongo/s/stale_exception.h
parent70be7c27a251621187a1de533462ae2bb1e3bd39 (diff)
parent1e917fd798aa25b7066d4b414b51184f13d5a092 (diff)
Update upstream source from tag 'upstream/6.0.10'debian/6.0.10-1
Update to upstream version '6.0.10' with Debian dir 2d176fa254eee97b139f712fec5709641335a8c3
Diffstat (limited to 'src/mongo/s/stale_exception.h')
-rw-r--r--src/mongo/s/stale_exception.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mongo/s/stale_exception.h b/src/mongo/s/stale_exception.h
index d82b18bab52..1778fe689a4 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);
-protected:
+private:
NamespaceString _nss;
ChunkVersion _received;
boost::optional<ChunkVersion> _wanted;
@@ -85,24 +85,41 @@ protected:
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;
-};
-using StaleConfigException = ExceptionFor<ErrorCodes::StaleConfig>;
+ // 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;
+};
class StaleDbRoutingVersion final : public ErrorExtraInfo {
public: