Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using double-colon as keyspace name through @RedisHash(value = …) #2096

Open
gpizarro-gfm opened this issue Jun 23, 2021 · 3 comments
Labels
type: enhancement A general enhancement

Comments

@gpizarro-gfm
Copy link

gpizarro-gfm commented Jun 23, 2021

This may be related to/a duplicate of #1326, but that issue was closed back in 2018.

For this Kotlin example, say I have:

@RedishHash(value = "keysubname", timeToLive = 10L)
data class KeySubname(
    @Id
    val id: Long
    @Indexed
    val ext_id: Long
)

And that keyspace events are enabled in the Spring application:

@EnableRedisRepositories(enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP)

After saving the hash, it and its index, secondary index, and lookup hashmap are deleted after 10 seconds. This is expected behavior.

However, if I add a colon to the hash's name (and make no other changes):

@RedishHash(value = "key:subname", timeToLive = 10L)
data class KeySubname(
    @Id
    val id: Long
    @Indexed
    val ext_id: Long
)

Then the secondary index and lookup hashmap are not deleted after 10 seconds, leaving a permanent record in the redis db of a hash that no longer exists.

Hopefully this issue can be fixed soon. Please let me know how else I can help.

@mp911de
Copy link
Member

mp911de commented Jul 16, 2021

Double-colon is considered to be a separator character and as per #2100 (comment), allowing double-colon usage in the keyspace name requires a wider revision of the repository support.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 16, 2021
@mp911de mp911de changed the title Secondary indexes not removed upon keyspace removal event if colon in name Allow using double-colon as keyspace name through @RedisHash(value = …) Jul 16, 2021
@mp911de mp911de added this to the 3.x milestone Jul 16, 2021
@GFriedrich
Copy link

@mp911de: Could this ticket be updated to a more up-to-date milestone? Having this feature would be nice, because some Redis UIs also use the colon to group keys. So using colons allow for organizing keys in a more structured way.

@petenattress
Copy link

Can I ask if this behaviour is documented anywhere beyond this GH issue? We recently experienced a memory leak in our Redis instance due to the cleanup behaviour failing because of this. Given that colons are canonically used as separator characters in Redis key names it feels quite easy to run afoul of this, and the impact is not obvious beyond the Redis instance slowly running out of space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants