Skip to content

Conversation

@ShooterIT
Copy link
Member

Fixes #14218

Before, we replicate HINCRBYFLOAT as an HSET command with the final value in order to make sure that differences in float precision or formatting will not create differences in replicas or after an AOF restart.
However, on the replica side, if the field has an expiration time, HSET will remove it, even though the master retains it. This leads to inconsistencies between the master and the replica.

For Redis 8.0 and above, PR #14224 has fixed this issue. However, Redis 7.4 does not support the HSETEX command. To address this, HINCRBYFLOAT will be replicated as a simple HSET if no expiration is set. If an expiration is specified, it will be replicated as a MULTI/EXEC containing HSET and HPEXPIREAT commands.

@snyk-io
Copy link

snyk-io bot commented Jul 29, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link
Collaborator

@tezc tezc left a comment

Choose a reason for hiding this comment

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

LGTM

@ShooterIT ShooterIT added the release-notes indication that this issue needs to be mentioned in the release notes label Jul 30, 2025
@ShooterIT ShooterIT moved this from Todo to In Review in Redis 7.4 Backport Jul 30, 2025
@ShooterIT ShooterIT merged commit 1d96a95 into redis:7.4 Jul 30, 2025
42 of 49 checks passed
@ShooterIT ShooterIT deleted the 7.4_hincrbyfloat branch July 30, 2025 11:02
@YaacovHazan YaacovHazan moved this from In Review to Todo in Redis 7.4 Backport Sep 30, 2025
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

Projects

Development

Successfully merging this pull request may close these issues.

3 participants