Skip to content

Conversation

@sundb
Copy link
Collaborator

@sundb sundb commented Sep 9, 2024

Found by @oranagra

Currently, when the size of dict becomes 1, we do not check whether delta is positive or negative.
As a result, non_empty_dicts is still incremented when the size of dict changes from 2 to 1.
We should only increment non_empty_dicts when delta is positive, as this indicates the first time an element is inserted into the dict.

…s positive

Co-authored-by: oranagra <oran@redislabs.com>
@sundb sundb requested review from guybe7 and oranagra September 9, 2024 11:42
@sundb sundb changed the title Increment kvstore's non_empty_dicts only on first insert when delta is positive Increment kvstore's non_empty_dicts only on first insert Sep 10, 2024
oranagra
oranagra previously approved these changes Sep 10, 2024
@sundb sundb merged commit 2dd4cca into redis:unstable Sep 11, 2024
@sundb sundb deleted the fix_kvstore_non_empty_counter branch September 11, 2024 01:40
YaacovHazan pushed a commit that referenced this pull request Nov 4, 2024
Found by @oranagra 

Currently, when the size of dict becomes 1, we do not check whether
`delta` is positive or negative.
As a result, `non_empty_dicts` is still incremented when the size of
dict changes from 2 to 1.
We should only increment `non_empty_dicts` when `delta` is positive, as
this indicates the first time an element is inserted into the dict.

---------

Co-authored-by: oranagra <oran@redislabs.com>
YaacovHazan pushed a commit that referenced this pull request Jan 6, 2025
Found by @oranagra 

Currently, when the size of dict becomes 1, we do not check whether
`delta` is positive or negative.
As a result, `non_empty_dicts` is still incremented when the size of
dict changes from 2 to 1.
We should only increment `non_empty_dicts` when `delta` is positive, as
this indicates the first time an element is inserted into the dict.

---------

Co-authored-by: oranagra <oran@redislabs.com>
@YaacovHazan YaacovHazan moved this from Todo to Done in Redis 7.4 Backport Apr 21, 2025
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
Found by @oranagra 

Currently, when the size of dict becomes 1, we do not check whether
`delta` is positive or negative.
As a result, `non_empty_dicts` is still incremented when the size of
dict changes from 2 to 1.
We should only increment `non_empty_dicts` when `delta` is positive, as
this indicates the first time an element is inserted into the dict.

---------

Co-authored-by: oranagra <oran@redislabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants