python's dbsize() returns keys count for one shard only

138 views
Skip to first unread message

Dmitry Sivachenko

unread,
Jun 1, 2022, 5:21:38 PM6/1/22
to Redis DB
Hello.

I am using python bindings (v 4.3.1) for redis cluster consisting of three shards.
If I execute cluster.flushdb(), it removes all records from the whole database (from all three shards).
If I execute cluster.dbsize(), it returns keys count only on one shard (probably random one?).

It does not look consistent.  I would expect cluster.dbsize() to return keys count for the whole cluster (sum for all three shards).

Why this is done this way?

Thanks!

Chayim Kirshen

unread,
Jun 8, 2022, 8:00:19 AM6/8/22
to Redis DB
Mind sharing how you connected to the cluster? Was it via redis.Redis, redis.cluster.RedisCluster. thje Async client, or ClusterNode?

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

Reply all
Reply to author
Forward
0 new messages