Skip to content

MOD-9169 Do not double count used capacity of containers in memory stats #1329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ephraimfeldblum
Copy link
Collaborator

@ephraimfeldblum ephraimfeldblum commented Mar 25, 2025

MOD-9169
re redis/docs#1305

Some memory of JSON values is double counted when stored in containers (arrays or objects). They are accounted for once in the capacity of the container, and then again when recursively counting the used memory of the values stored within the container.

Fix:
Separate the top-level call from recursive calls to get_memory(). The top-level object must account for its own size_of::<IValue>(). Any recursive call made have already accounted for that memory, so they do not need to add it in.

Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.11%. Comparing base (c94ee01) to head (8abcb50).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
redis_json/src/ivalue_manager.rs 88.46% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1329      +/-   ##
==========================================
- Coverage   78.37%   78.11%   -0.26%     
==========================================
  Files          15       15              
  Lines        4004     3871     -133     
==========================================
- Hits         3138     3024     -114     
+ Misses        866      847      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ephraimfeldblum ephraimfeldblum merged commit e75f9af into master Mar 25, 2025
16 checks passed
@ephraimfeldblum ephraimfeldblum deleted the ephraim_undo-double-counting-of-used-capcity-in-containers branch March 25, 2025 14:06
ephraimfeldblum added a commit that referenced this pull request Mar 25, 2025
…ats (#1329)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 25, 2025
…ats (#1329)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 25, 2025
…ats (#1329)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 25, 2025
…ats (#1329)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 26, 2025
…ats (#1329) (#1330)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 26, 2025
…ats (#1329) (#1331)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 26, 2025
…ats (#1329) (#1332)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
ephraimfeldblum added a commit that referenced this pull request Mar 26, 2025
…ats (#1329) (#1333)

* do not double count used capacity of containers in memory stats

* unit test

* flow tests

* separate root from recursive calls

* rustic

(cherry picked from commit e75f9af)
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.

2 participants