diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-10-08 13:47:43 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-10-22 14:45:38 -0400 |
commit | a7863d44d31812ff24d5db4e1af650ad5411bea8 (patch) | |
tree | ce2679a93977fea2dc677c0c2aebf395e08bf872 /src/mongo/db/ftdc/file_reader.cpp | |
parent | 58a313d94332eff0164d99092d5692e965501961 (diff) | |
download | mongo-a7863d44d31812ff24d5db4e1af650ad5411bea8.tar.gz |
SERVER-20582: _id time reflects end of chunk instead of beginning
Diffstat (limited to 'src/mongo/db/ftdc/file_reader.cpp')
-rw-r--r-- | src/mongo/db/ftdc/file_reader.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mongo/db/ftdc/file_reader.cpp b/src/mongo/db/ftdc/file_reader.cpp index ca850c374fa..e649a029305 100644 --- a/src/mongo/db/ftdc/file_reader.cpp +++ b/src/mongo/db/ftdc/file_reader.cpp @@ -71,6 +71,13 @@ StatusWith<bool> FTDCFileReader::hasNext() { return swType.getStatus(); } + auto swId = FTDCBSONUtil::getBSONDocumentId(_parent); + if (!swId.isOK()) { + return swId.getStatus(); + } + + _dateId = swId.getValue(); + FTDCBSONUtil::FTDCType type = swType.getValue(); if (type == FTDCBSONUtil::FTDCType::kMetadata) { @@ -120,17 +127,17 @@ StatusWith<bool> FTDCFileReader::hasNext() { } } -std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&> FTDCFileReader::next() { +std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&, Date_t> FTDCFileReader::next() { dassert(_state == State::kMetricChunk || _state == State::kMetadataDoc); if (_state == State::kMetadataDoc) { - return std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&>(FTDCBSONUtil::FTDCType::kMetadata, - _metadata); + return std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&, Date_t>( + FTDCBSONUtil::FTDCType::kMetadata, _metadata, _dateId); } if (_state == State::kMetricChunk) { - return std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&>( - FTDCBSONUtil::FTDCType::kMetricChunk, _docs[_pos]); + return std::tuple<FTDCBSONUtil::FTDCType, const BSONObj&, Date_t>( + FTDCBSONUtil::FTDCType::kMetricChunk, _docs[_pos], _dateId); } MONGO_UNREACHABLE; |