You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2024/06/05 09:28:08 UTC
[I] Result level cache key collisions from utf8 encoding (druid)
gianm opened a new issue, #16552:
URL: https://github.com/apache/druid/issues/16552
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 strings 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [I] Result level cache key collisions from utf8 encoding (druid)
Posted by "clintropolis (via GitHub)" <gi...@apache.org>.
clintropolis closed issue #16552: Result level cache key collisions from utf8 encoding
URL: https://github.com/apache/druid/issues/16552
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org