Skip to content

Hold GCRA out of the release#15191

Merged
minchopaskal merged 18 commits into
redis:unstablefrom
minchopaskal:disable-gcra
May 14, 2026
Merged

Hold GCRA out of the release#15191
minchopaskal merged 18 commits into
redis:unstablefrom
minchopaskal:disable-gcra

Conversation

@minchopaskal

@minchopaskal minchopaskal commented May 12, 2026

Copy link
Copy Markdown
Collaborator

After introducing GCRA algorithm into redis #14826 and subsequent introduction of new RATE_LIMIT object type - #14905. It was internally decided not to introduce GCRA into the new release.

As still no decision is made on whether it will be kept or not in the future, this PR only makes the code related to GCRA dead - commands are inaccessible and AOF/RDB load+save is disabled.


Note

Medium Risk
Changes persistence/type IDs and command metadata to compile out GCRA by default, which can break loading/AOF rewrite for existing datasets that contain GCRA keys unless Redis is rebuilt with -DENABLE_GCRA. The scope touches core object-type plumbing (RDB/AOF, notifications, module API constants), increasing regression risk around type numbering and compatibility.

Overview
Disables the GCRA rate-limiting feature by default by wrapping its object type, commands/command docs, ACL category/group, keyspace notification flag (r), and related code paths in #ifdef ENABLE_GCRA.

Persistence and type plumbing are adjusted accordingly: GCRA is removed from default command tables, AOF rewrite, RDB save/load/type IDs, object duplication/free/defrag/digest, module key-type mapping, and several constants/enums are renumbered/conditioned to keep builds consistent when GCRA is omitted. Tests and fuzz traffic generation referencing GCRA are effectively disabled, and config/redis.conf messaging is updated to only mention the r notification class when GCRA is enabled.

Reviewed by Cursor Bugbot for commit 1b24e9b. Bugbot is set up for automated code reviews on this repo. Configure here.

@minchopaskal minchopaskal requested a review from sundb May 12, 2026 13:11
@minchopaskal

Copy link
Copy Markdown
Collaborator Author

GCRA was against redis' philosophy so I personally endorse the decision, even though all the work put into the previous two PRs.

Comment thread src/rdb.c
Comment thread src/acl.c Outdated
Comment thread tests/integration/corrupt-dump-fuzzer.tcl Outdated
@sundb

sundb commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Should remove the related content about new keyspace notification(r)? like the config in the redis.conf file?

@minchopaskal

minchopaskal commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Should remove the related content about new keyspace notification(r)? like the config in the redis.conf file?

I think maybe only the docs in redis.conf. I dont want to remove any comments in the code in case we need to revert it and more KSN types were added as it may create conflics.

Comment thread src/server.h Outdated
@sundb

sundb commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Should remove the related content about new keyspace notification(r)? like the config in the redis.conf file?

I think maybe only the docs in redis.conf. I dont want to remove any comments in the docs in case we need to revert it and more KSN types were added as it may create conflics.

Sure, IIUC we should hide all interfaces that are potentially exposed to users.

@sundb

sundb commented May 13, 2026

Copy link
Copy Markdown
Collaborator
  1. it replies OK, should reply error.
CONFIG SET notify-keyspace-events r
  1. should hide #define REDISMODULE_KEYTYPE_GCRA 8 in the module?

Comment thread src/acl.c Outdated
@minchopaskal

Copy link
Copy Markdown
Collaborator Author
  1. it replies OK, should reply error.
CONFIG SET notify-keyspace-events r
  1. should hide #define REDISMODULE_KEYTYPE_GCRA 8 in the module?

Not sure about 2. @YaacovHazan any comment ?

Comment thread src/server.h Outdated
Comment thread src/notify.c
Comment thread src/redismodule.h
@minchopaskal minchopaskal changed the title Make GCRA dead code Hold GCRA out of release May 13, 2026
@minchopaskal minchopaskal changed the title Hold GCRA out of release Hold GCRA out of the release May 13, 2026
Comment thread src/server.h Outdated
Comment thread src/server.h Outdated
@YaacovHazan

YaacovHazan commented May 13, 2026

Copy link
Copy Markdown
Collaborator

should hide #define REDISMODULE_KEYTYPE_GCRA 8 in the module?

@minchopaskal yes, let's remove/hide... theoretically we might want to use 8 in the future for a different DT

@minchopaskal

Copy link
Copy Markdown
Collaborator Author

should hide #define REDISMODULE_KEYTYPE_GCRA 8 in the module?

@minchopaskal yes, let's remove/hide... theoretically we might want to use 8 in the future for a different DT

Just removed it and used 8 for the REDISMODULE_KEYTYPE_ARRAY

@sundb

sundb commented May 14, 2026

Copy link
Copy Markdown
Collaborator
#define OBJ_GCRA 7    /* GCRA object. */
#define OBJ_ARRAY 8     /* Array object. */

Should we set ARRAY to 7? If GCRA is never enabled, 7 might not be used at all.

Comment thread src/module.c
@minchopaskal

Copy link
Copy Markdown
Collaborator Author
#define OBJ_GCRA 7    /* GCRA object. */
#define OBJ_ARRAY 8     /* Array object. */

Should we set ARRAY to 7? If GCRA is never enabled, 7 might not be used at all.

makes sense.

Comment thread src/server.h Outdated
Comment thread src/server.h Outdated
Comment thread redis.conf Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 1bbc939. Configure here.

Comment thread src/config.c Outdated
minchopaskal and others added 5 commits May 14, 2026 12:29
Because this file was generated using the old array rdb type(29), but
now we change it to 29, so we need to update the rdb type in this rdb
file
@sundb

sundb commented May 14, 2026

Copy link
Copy Markdown
Collaborator

@sundb sundb closed this May 14, 2026
@sundb sundb reopened this May 14, 2026
@minchopaskal minchopaskal merged commit 2e46d2e into redis:unstable May 14, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants