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_manager.h | |
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_manager.h')
-rw-r--r-- | src/mongo/db/ftdc/file_manager.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/ftdc/file_manager.h b/src/mongo/db/ftdc/file_manager.h index acfd330d581..adc2528ee2a 100644 --- a/src/mongo/db/ftdc/file_manager.h +++ b/src/mongo/db/ftdc/file_manager.h @@ -82,7 +82,7 @@ public: * * Rotates files as needed. */ - Status writeSampleAndRotateIfNeeded(Client* client, const BSONObj& sample); + Status writeSampleAndRotateIfNeeded(Client* client, const BSONObj& sample, Date_t date); /** * Closes the current file manager down. @@ -110,9 +110,10 @@ private: /** * Recover the interim file. * - * Checks if the file is non-empty, and if so appends it the archive file. + * Checks if the file is non-empty, and if gets a list of documents with the original times they + * were written disk based on the _id fields. */ - std::vector<std::tuple<FTDCBSONUtil::FTDCType, BSONObj>> recoverInterimFile(); + std::vector<std::tuple<FTDCBSONUtil::FTDCType, BSONObj, Date_t>> recoverInterimFile(); /** * Removes the oldest files if the directory is over quota @@ -123,12 +124,15 @@ private: * Open a new file for writing. * * Steps: - * 1. Writes any recovered interim file samples into the file. + * 1. Writes any recovered interim file samples into the file. These entries are written to the + * archive file with the time they were written to the interim file instead of the time this + * recovery is written. * 2. Appends file rotation collectors upon opening the file. */ - Status openArchiveFile(Client* client, - const boost::filesystem::path& path, - const std::vector<std::tuple<FTDCBSONUtil::FTDCType, BSONObj>>& docs); + Status openArchiveFile( + Client* client, + const boost::filesystem::path& path, + const std::vector<std::tuple<FTDCBSONUtil::FTDCType, BSONObj, Date_t>>& docs); private: // config to use |