summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/resume_token.h
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-06-18 17:27:43 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-06-27 09:38:59 -0400
commitbbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd (patch)
tree594dba7d8898c73ab488137e20112cc99a2d5dda /src/mongo/db/pipeline/resume_token.h
parent752069dbc79f22b6ae4691073d455d76c9bbf18d (diff)
downloadmongo-bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd.tar.gz
SERVER-34789: Using resume token from 'invalidate' notification for 'resumeAfter' should error
Diffstat (limited to 'src/mongo/db/pipeline/resume_token.h')
-rw-r--r--src/mongo/db/pipeline/resume_token.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/resume_token.h b/src/mongo/db/pipeline/resume_token.h
index 42b5b2b9f03..25318719e67 100644
--- a/src/mongo/db/pipeline/resume_token.h
+++ b/src/mongo/db/pipeline/resume_token.h
@@ -40,6 +40,14 @@
namespace mongo {
struct ResumeTokenData {
+ /**
+ * Flag to indicate if the resume token is from an invalidate notification.
+ */
+ enum FromInvalidate : bool {
+ kFromInvalidate = true,
+ kNotFromInvalidate = false,
+ };
+
ResumeTokenData(){};
ResumeTokenData(Timestamp clusterTimeIn,
int versionIn,
@@ -62,6 +70,10 @@ struct ResumeTokenData {
size_t applyOpsIndex = 0;
Value documentKey;
boost::optional<UUID> uuid;
+ // Flag to indicate that this resume token is from an "invalidate" entry. This will not be set
+ // on a token from a command that *would* invalidate a change stream, but rather the invalidate
+ // notification itself.
+ FromInvalidate fromInvalidate = FromInvalidate::kNotFromInvalidate;
};
std::ostream& operator<<(std::ostream& out, const ResumeTokenData& tokenData);