handle edge case for aggregation/upgrade scenario

See the lengthy comment I added in PopulateCacheIndex for the details.