Conversation
Signed-off-by: Kostas Kyrimis <kostas@dragonflydb.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vyavdoshenko
left a comment
There was a problem hiding this comment.
-
CMS.INCRBY- incorrect behavior when key does not exist
The docs claim that a new sketch is created with default dimensions if the key does not exist. This is incorrect - the command returns an error"CMS: key does not exist". Also missing:incrementmust be a strictly positive integer (> 0); passing 0 or a negative value returns an error. -
CMS.INITBYPROB- inverted semantics ofprobability
The docs describeprobabilityas the probability that an estimate will fall within the error bounds. This is the opposite of the actual behavior - it is the failure probability (probability of exceeding the error bound). The source code confirms:depth = ceil(ln(1 / probability)), meaning a small value like0.001gives a deeper, more accurate sketch. The example value0.999producesdepth = 1(a single hash function), making the sketch practically useless. -
CMS.MERGE-destinationmust be pre-initialized
The docs do not mention thatdestinationmust already exist before calling the command. If it does not, the command returns"CMS: key does not exist". Should explicitly state: "Thedestinationkey must be pre-initialized viaCMS.INITBYDIMorCMS.INITBYPROB." -
CMS.MERGE- weights must be integers
Weights are parsed asint64_tin the source code - fractional values are not supported. The docs describe them as "scaling factors" without specifying the type, which could mislead users into passing float values.
Done take a look :) |
add cms docs
resolves dragonflydb/dragonfly#5445