diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-06-27 09:50:36 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-06-27 09:53:04 -0400 |
commit | dc849ad01396b513e61ae389b3bce4b28f3404be (patch) | |
tree | c2b565c60228b591f10143fd1bc07ff37f6b8dc1 /src/mongo/db/catalog/catalog_control.h | |
parent | bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd (diff) | |
download | mongo-dc849ad01396b513e61ae389b3bce4b28f3404be.tar.gz |
SERVER-35317: Preserve minVisible values when refreshing the catalog.
Restarting the catalog throws away the "minVisibleSnapshot" info on all
collections. This is typically safe for rollback, the value is reinstantiated
when replication recovery rolls forward from the stable timestamp. However, it's
possible to read behind the stable timestamp. Currently only test commands can
do so, but the future may formally expose this case particularly for sharded
cluster snapshot reads.
Diffstat (limited to 'src/mongo/db/catalog/catalog_control.h')
-rw-r--r-- | src/mongo/db/catalog/catalog_control.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/catalog_control.h b/src/mongo/db/catalog/catalog_control.h index 85eff55ec25..97053b07d55 100644 --- a/src/mongo/db/catalog/catalog_control.h +++ b/src/mongo/db/catalog/catalog_control.h @@ -26,23 +26,29 @@ * then also delete it in the license file. */ +#include <map> + #include "mongo/db/operation_context.h" namespace mongo { namespace catalog { + +using MinVisibleTimestamp = Timestamp; +using MinVisibleTimestampMap = std::map<UUID, MinVisibleTimestamp>; + /** * Closes the catalog, destroying all associated in-memory data structures for all databases. After * a call to this function, it is illegal to access the catalog before calling openCatalog(). * * Must be called with the global lock acquired in exclusive mode. */ -void closeCatalog(OperationContext* opCtx); +MinVisibleTimestampMap closeCatalog(OperationContext* opCtx); /** * Restores the catalog and all in-memory state after a call to closeCatalog(). * * Must be called with the global lock acquired in exclusive mode. */ -void openCatalog(OperationContext* opCtx); +void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& catalogState); } // namespace catalog } // namespace mongo |