Skip to content

Keyspace event for new keys - #10512

Merged
oranagra merged 2 commits into
redis:unstablefrom
lukepalmer:unstable
Apr 13, 2022
Merged

oranagra merged 2 commits into
redis:unstablefrom
lukepalmer:unstable

Conversation

@lukepalmer

@lukepalmer lukepalmer commented Apr 3, 2022 •

Copy link
Copy Markdown
Contributor

Add an optional keyspace event when new keys are added to the db.

This is useful for applications where clients need to be aware of the redis keyspace. Such an application can SCAN once at startup and then listen for "new" events (plus others associated with DEL, RENAME, etc).

I was unsure if this should be included in the 'A' event class, so I left that out and documented.
It would be great if this could make it into the next 6.2.x release as well as 7.

to do:

  • redis-doc PR

@oranagra oranagra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't extend 6.2 with new capabilities now, and this almost missed the 7.0 train too.
I'm quite sure this was already discussed quite a lot in the past, but i don't recall the arguments / decision.
@itamarhaber are you aware of any?

Comment thread src/db.c Resolved
@itamarhaber

Copy link
Copy Markdown
Member

This definitely came up in the past (e.g. #7498, #10373). I can't remember why it wasn't done, although conceptually there's no single command/event that creates a key so perhaps that's the why.

IMO, this could be a nice addition if and when used responsibly.

@oranagra

oranagra commented Apr 5, 2022

Copy link
Copy Markdown
Member

@redis/core-team @guybe7 @gkorland please comment

@oranagra oranagra added state:major-decision Requires core team consensus release-notes indication that this issue needs to be mentioned in the release notes labels Apr 5, 2022
@oranagra

Copy link
Copy Markdown
Member

This was approved today in a core-team meeting, to be part of 7.0.0.
@lukepalmer can you please make a doc pr ?

@oranagra
oranagra merged commit bb7891f into redis:unstable Apr 13, 2022
oranagra pushed a commit to redis/redis-doc that referenced this pull request Apr 25, 2022
Document the changes in redis/redis#10512

Co-authored-by: Kyle Banker <[email protected]>
@oranagra oranagra mentioned this pull request Apr 27, 2022
oranagra pushed a commit that referenced this pull request May 8, 2022
this seems to have been an oversight. syncing the flags so that NOTIFY_NEW is available to modules.
missing in #10512
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
Add an optional keyspace event when new keys are added to the db.

This is useful for applications where clients need to be aware of the redis keyspace.
Such an application can SCAN once at startup and then listen for "new" events (plus
others associated with DEL, RENAME, etc).
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
)

this seems to have been an oversight. syncing the flags so that NOTIFY_NEW is available to modules.
missing in redis#10512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes state:major-decision Requires core team consensus

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[NEW] add keyspace notification for key-created Support for Keyspace Add New Key Notifications

5 participants