dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.96k stars 954 forks source link

Too many `MOVED` error in `# Errorstats` section of `INFO ALL` #4118

Closed chakaz closed 1 week ago

chakaz commented 1 week ago

Dragonfly saves count per error here:

https://github.com/dragonflydb/dragonfly/blob/7815c8d3d7e41aaf84491a7177c48fab8156e284/src/facade/reply_builder.cc#L321-L336

The issue is that, we type is empty (which it is for MOVED replies), then we save an entry per str, which could be 16k in a regular situation, or more if we do slot migrations.

Then, all INFO replies fetch this information (from all threads), even if the ERRORSTATS section is not requested.

This is a general problem in the way we do error handling, but hopefully most errors contain constant strings instead of slot id + host.

To fix this only for MOVED (like I propose) we could simply add some special handling in the above code (if starts with MOVED then...)

romange commented 1 week ago

@chakaz type was designed exactly for this.