ERR
redis
module_error
ai_generated
true
BF.EXISTS:布隆过滤器 'myfilter' 不存在。请先使用 BF.RESERVE。
ERR BF.EXISTS: Bloom filter 'myfilter' does not exist. Use BF.RESERVE first.
ID: redis/redisbloom-filter-exists-error
95%修复率
84%置信度
1证据数
2024-03-22首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 7.2.0 | active | — | — | — |
| 7.4.0 | active | — | — | — |
| 8.0.0 | active | — | — | — |
根因分析
尝试查询尚未通过 BF.RESERVE 或 BF.ADD 创建的布隆过滤器。
English
Attempting to query a Bloom filter that has not been created with BF.RESERVE or BF.ADD.
官方文档
https://redis.io/docs/stack/bloom/解决方案
-
先使用所需参数创建布隆过滤器:BF.RESERVE myfilter 0.01 10000(错误率 1%,容量 1 万)。然后重试 BF.EXISTS。
-
如果希望在首次 BF.ADD 时自动创建,请使用 BF.ADD myfilter item1(这将使用默认参数创建过滤器)。然后使用 BF.EXISTS。
无效尝试
常见但无效的做法:
-
60% 失败
Using BF.EXISTS on a non-existent key returns 0 in some older versions, but in strict mode (RedisBloom v2.4+) it raises an error; relying on silent fallback is version-dependent.
-
80% 失败
Using EXISTS myfilter only checks if the key exists as a generic key, not if it's a valid Bloom filter; it doesn't solve the type mismatch.