There are multiple places in the code where there are problems related to handling WT_CACHE_FULL error returns. Three examples of code paths that need to be changed to handle WT_CACHE_FULL properly are:
- If an index build would use more space than is available in memory. The particular error is encountered while cleaning up after such a problem, the solution is to retry the cleanup until it succeeds.
- In WiredTigerSessionCache::releaseSession the call to haveDropsQueued results in a call to syncSizeInfo, which results in an update to the size storer table that can fail.
- When an index build fails due to cache full, the path to rolling back the index build involves first updating the MongoDB metadata table via KVCollectionCatalogEntry::removeIndex. Since the cache is full, doing the update into the metadata also fails with WT_CACHE_FULL.