unsigned int i, id;
char *keystr;
- /* smallest value is always at index 0 */
- if (count <= ctdb_db->hot_keys[0].count) {
+ /*
+ * If all slots are being used then only need to compare
+ * against the count in the 0th slot, since it contains the
+ * smallest count.
+ */
+ if (ctdb_db->statistics.num_hot_keys == MAX_HOT_KEYS &&
+ count <= ctdb_db->hot_keys[0].count) {
return;
}