The primary read/write node of my ElastiCache Redis (cluster mode disabled) cluster has more keys than a secondary read-only replica node. This discrepancy can be observed with the Amazon CloudWatch CurrItems metric or the Redis DBSIZE command. What causes this discrepancy?

This discrepancy can occur after adding a read replica to an ElastiCache Redis (cluster mode disabled) cluster that contains a large number of keys with TTL (time-to-live) values that have expired. In this scenario, if you add a new read replica to an existing Redis (cluster mode disabled) cluster, the read replica issues a ‘sync’ command to obtain an RDB file snapshot of the primary node’s contents. When the read replica loads this RDB file into memory, it discards any keys that have expired.

This behavior is by design because Redis keys are expired both actively and passively as described at How Redis expires keys.

Amazon ElastiCache, Redis, TTL, expired, DBSIZE, CurrItems, synchronization, replica, keys, count


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-1-27