From a7863d44d31812ff24d5db4e1af650ad5411bea8 Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Thu, 8 Oct 2015 13:47:43 -0400 Subject: SERVER-20582: _id time reflects end of chunk instead of beginning --- src/mongo/db/ftdc/file_manager.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/mongo/db/ftdc/file_manager.h') 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> recoverInterimFile(); + std::vector> 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>& docs); + Status openArchiveFile( + Client* client, + const boost::filesystem::path& path, + const std::vector>& docs); private: // config to use -- cgit v1.2.1