When a topN is sorting by a postaggregator, the postaggregator name is part of the query cache key but the definition is not. But, the postaggregator should be part of the cache key too, since it's used to determine which result rows to keep for a particular segment in the cache. If the postaggregator is redefined but keeps the same name, the query improperly uses previously cached results.
I think fixing this for real will require adding a getCacheKey method to PostAggregators.
If we want to hold off on that until 0.10.0 then we could work around it in the meantime by disabling caching for any topN query that sorts on a postaggregator. But this has a performance cost that could hit more people than the bug does.
When a topN is sorting by a postaggregator, the postaggregator name is part of the query cache key but the definition is not. But, the postaggregator should be part of the cache key too, since it's used to determine which result rows to keep for a particular segment in the cache. If the postaggregator is redefined but keeps the same name, the query improperly uses previously cached results.
I think fixing this for real will require adding a getCacheKey method to PostAggregators.
If we want to hold off on that until 0.10.0 then we could work around it in the meantime by disabling caching for any topN query that sorts on a postaggregator. But this has a performance cost that could hit more people than the bug does.