You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ResultLevelCachingQueryRunner does this when it computes the cache key for a query:
final String cacheKeyStr = StringUtils.fromUtf8(strategy.computeResultLevelCacheKey(query));
This is bad because not all byte arrays can be represented as Java Strings. For example, the byte arrays [63, -48, 0, 0, 0, 0, 0, 0] and [63, -24, 0, 0, 0, 0, 0, 0] have the same representation when converted to Strings. Both have an invalid second character, which both get mapped to the replacement character. These byte arrays are the representations of doubles 0.25 and 0.75 respectively, which is how this was originally noticed (two queries had a cache key collision when they differed only in that one used 0.25 and one used 0.75 as a quantile parameter).
To fix this we need to always use byte[], never String, when dealing with cache keys.
The text was updated successfully, but these errors were encountered:
The
ResultLevelCachingQueryRunner
does this when it computes the cache key for a query:This is bad because not all byte arrays can be represented as Java Strings. For example, the byte arrays
[63, -48, 0, 0, 0, 0, 0, 0]
and[63, -24, 0, 0, 0, 0, 0, 0]
have the same representation when converted to Strings. Both have an invalid second character, which both get mapped to the replacement character. These byte arrays are the representations of doubles0.25
and0.75
respectively, which is how this was originally noticed (two queries had a cache key collision when they differed only in that one used0.25
and one used0.75
as a quantile parameter).To fix this we need to always use
byte[]
, neverString
, when dealing with cache keys.The text was updated successfully, but these errors were encountered: