Skip to content

[BUG] Incorrect handling of case sensitivity for HSETEX propagation #2996

Description

@madolson

If you execute:

127.0.0.1:6379> HSETEX key nx fields 1 foo bar
(integer) 1
127.0.0.1:6379> HSETEX key2 NX fields 1 foo bar
(integer) 1

The replica will see:

1767388557.168465 [0 127.0.0.1:6379] "SELECT" "0"
1767388557.168533 [0 127.0.0.1:6379] "HSETEX" "key" "nx" "fields" "1" "foo" "bar"
1767388572.586961 [0 127.0.0.1:6379] "HSETEX" "key2" "fields" "1" "foo" "bar"

Tokens should be case insensitive, so we shouldn't be replicating the NX field in the first case. (Although not sure these are really needed).

The root cause seems to be calling strcmp here:

if (strcmp(c->argv[i]->ptr, "NX") &&

We should be calling strcasecmp instead.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions