Note: this issue is similar to
SERVER-18829, but the fix there was verified on the repro on that ticket and the particulars are different in this case, so I believe this is a different issue.
During an _id index build of a collection with about 5G documents in an initial sync of a secondary cache usage grew to exceed the specified maximum. Some stats:
- The index build starts at A. At this point (and for the duration of the timeline) we are only reading the collection data; no index entries are being inserted yet.
- Since the cache is full pages are being evicted as fast as they are being read, and cache usage remains bounded.
- But at B the statistics shift. Data is still being read at the same rate, but evictions are not being done in the same way, and don't keep up with the rate at which data is being read into the cache, so cache usage grows unbounded.