summaryrefslogtreecommitdiff
path: root/src/mongo/db/rebuild_indexes.h
Commit message (Collapse)AuthorAgeFilesLines
* SERVER-56002 SERVER-56023 Store Collection metadata in the Collection and ↵Henrik Edin2021-05-201-2/+1
| | | | | | | | | | | reply on the copy-on-write machinery to keep it in sync with the durable catalog. All updates to the metadata needs to happen through the Collection, moved interfaces from the DurableCatalog to the Collection. Removed back pointer to Collection in IndexCatalogEntryImpl, interfaces now correctly take a const or non-const Collection. This should make its iterface const-correct to avoid making bugs where the copy-on-write system for Collections are bypassed. Multikey handle is special as it needs to happen without exclusive access to the Collection. Implemented isolation for the Collection metadata when multikey is changed. It handles multi-doc transactions and is only commited to the Collection instance after the write to the durable catalog successfully commits. listCollections and listIndexes can now safetly read the metadata cache without needing to read from the durable catalog making them safe to do without Collection level locks.
* SERVER-50984 Add CollectionPtr to replace usage of const Collection*Henrik Edin2020-09-261-2/+3
| | | | | | | | | | | | It implements a yieldable interface that is used to re-load the Collection pointer from the catalog after a yield that released locks. With lock-free reads and copy-on-write on Collection instances releasing locks without notifying an AutoGetCollection at a higher level may cause its pointers to dangle if a MODE_X writer installs a new Collection instance in the catalog. CollectionPtr should be passed by const reference so a yield can notify all the way up.
* SERVER-50317 Const correct uses of CollectionHenrik Edin2020-09-021-2/+2
| | | | | | Most of the code should only need a const Collection now. AutoGetCollection returns a const Collection by default. There is a placeholder getWritableCollection() interface that will handle the necessary steps we need for lock free reads in the future. Added some operators to AutoGetCollection so it behaves more like a smart pointer.
* SERVER-41965 Change repair to only rebuild indexes on necessary collectionsDaniel Ernst2020-01-301-0/+76