summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_session_id.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-09-12 16:22:19 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-09-13 14:12:21 -0400
commit0c8ffece21a601fe3861aba6cc191b2ce1be0f54 (patch)
tree5b8a6f156a6f4b7ee4425e3b6511bd84c6b4f934 /src/mongo/db/s/migration_session_id.h
parent729169964eeb34460608ab1f494059d094e31caa (diff)
downloadmongo-0c8ffece21a601fe3861aba6cc191b2ce1be0f54.tar.gz
SERVER-26077 Tighten checks around migration session id
Transmits the migration session id together with the abort command and ensures that the migration session id reported in the status matches that of the cloner.
Diffstat (limited to 'src/mongo/db/s/migration_session_id.h')
-rw-r--r--src/mongo/db/s/migration_session_id.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mongo/db/s/migration_session_id.h b/src/mongo/db/s/migration_session_id.h
index a16733e1dbe..0437fb5246a 100644
--- a/src/mongo/db/s/migration_session_id.h
+++ b/src/mongo/db/s/migration_session_id.h
@@ -56,13 +56,12 @@ public:
/**
* Extracts the session id from BSON. If the session id is missing from the BSON contents,
- * returns an empty MigrationSessionId.
+ * returns a NoSuchKey error.
*/
static StatusWith<MigrationSessionId> extractFromBSON(const BSONObj& obj);
/**
- * Compares two session identifiers. Two idendifiers match if either both are empty (_sessionId
- * is not set) or if the session ids match.
+ * Compares two session identifiers. Two idendifiers match only if they are the same.
*/
bool matches(const MigrationSessionId& other) const;
@@ -73,13 +72,10 @@ public:
std::string toString() const;
- bool isEmpty() const;
-
private:
- MigrationSessionId();
explicit MigrationSessionId(std::string sessionId);
- boost::optional<std::string> _sessionId{boost::none};
+ std::string _sessionId;
};
} // namespace mongo