Closed
Description
Michał Bobowski opened DATAREDIS-744 and commented
Hello,
I've set ttl for my data using:
@RedisHash(value = "user_content", timeToLive = 60)
And enabled keyspace events by setting EnableKeyspaceEvents.ON_STARTUP.
During tests I discovered that secondary indexes are not removed after expiration and I spent couple hours on debugging. What I found was quite shocking:
- I inserted key "user_content:ipla:some7:vod:0123456789abcdef0123456789abcdef"
- Phantom key was created as well
- Key expired after TTL
- Expiration Message was generated and received by MappingExpirationListener
- Function isKeyExpirationMessage returned false and event was rejected
The reason is below:
byte[][] args = ByteUtils.split(message.getBody(), ':');
if (args.length != 2) {
return false;
}
Message body is equal to my expiring key, therefore splitting it this way returns 6 rather than 2. Is there a hidden assumption that keys must not contain ":" sign? Or am I completely wrong about it?
Affects: 1.8.9 (Ingalls SR9)
Issue Links:
- DATAREDIS-572 A NullPointerException is thrown when listen the key expire event
("supersedes")
Referenced from: pull request #298
Backported to: 2.0.3 (Kay SR3), 1.8.10 (Ingalls SR10)