Skip to content

Secondary indexes not removed if id contains colon [DATAREDIS-744] #1326

Closed
@spring-projects-issues

Description

@spring-projects-issues

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)

Metadata

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions