From 0b92be077a7219bbda6bf737b9751df4dbf83559 Mon Sep 17 00:00:00 2001 From: Randolph Tan Date: Mon, 10 Sep 2018 17:23:46 -0400 Subject: SERVER-36987 ChunkVersion::minorVersion truncates to 16 bit (cherry picked from commit cf3e9512586e2538833b248895cd14844f5fbd65) --- src/mongo/s/chunk_version.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mongo/s/chunk_version.h') diff --git a/src/mongo/s/chunk_version.h b/src/mongo/s/chunk_version.h index 1c5a811b04d..600b5937d02 100644 --- a/src/mongo/s/chunk_version.h +++ b/src/mongo/s/chunk_version.h @@ -59,7 +59,7 @@ public: ChunkVersion() : _combined(0), _epoch(OID()) {} - ChunkVersion(int major, int minor, const OID& epoch) + ChunkVersion(uint32_t major, uint32_t minor, const OID& epoch) : _combined(static_cast(minor) | (static_cast(major) << 32)), _epoch(epoch) {} @@ -157,12 +157,12 @@ public: return _combined > 0; } - int majorVersion() const { + uint32_t majorVersion() const { return _combined >> 32; } - int minorVersion() const { - return _combined & 0xFFFF; + uint32_t minorVersion() const { + return _combined & 0xFFFFFFFF; } OID epoch() const { -- cgit v1.2.1