Skip to content
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

Fix count when deleting compression chunk size entry #7297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erimatnor
Copy link
Contributor

@erimatnor erimatnor commented Sep 24, 2024

In the function ts_compression_chunk_size_delete() a counter is used to indicate the number of catalog entries deleted. But this counter is never incremented so the returned count is not accurate.

Fix this issue by incrementing the counter when entries are deleted. Also, increment the command counter (to make changes visible) only at the end if the count is non-zero.

Disable-check: force-changelog-file

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.24%. Comparing base (59f50f2) to head (e69c974).
Report is 359 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7297       +/-   ##
===========================================
+ Coverage   80.06%   92.24%   +12.18%     
===========================================
  Files         190      205       +15     
  Lines       37181    38565     +1384     
  Branches     9450     9999      +549     
===========================================
+ Hits        29770    35576     +5806     
+ Misses       2997     2989        -8     
+ Partials     4414        0     -4414     

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

@fabriziomello
Copy link
Contributor

Is possible to add some tests either regression or unit for this change?

@erimatnor
Copy link
Contributor Author

erimatnor commented Sep 24, 2024

Is possible to add some tests either regression or unit for this change?

Note sure what kind of tests you'd like to see. This is just fixing an issue with a count that wasn't correct. Nothing is currently looking at the returned count. The code functionally is the same as before.

In the function `ts_compression_chunk_size_delete()` a counter is used
to indicate the number of catalog entries deleted. But this counter is
never incremented so the returned count is not accurate.

Fix this issue by incrementing the counter when entries are
deleted. Also, increment the command counter (to make changes visible)
only at the end if the count is non-zero.
@erimatnor erimatnor force-pushed the fix-compression-chunk-size-delete-count branch from afc049c to e69c974 Compare September 25, 2024 09:25
@akuzm
Copy link
Member

akuzm commented Sep 25, 2024

Note sure what kind of tests you'd like to see. This is just fixing an issue with a count that wasn't correct. Nothing is currently looking at the returned count. The code functionally is the same as before.

I can think of two things:

  1. You added CommandCounterIncrement, this means that something is now visible that was not visible before, probably there can be an isolation test to detect this?
  2. If nothing is looking at the returned count, why are we returning it? I'd remove it as dead code then.

@fabriziomello
Copy link
Contributor

Is possible to add some tests either regression or unit for this change?

Note sure what kind of tests you'd like to see. This is just fixing an issue with a count that wasn't correct. Nothing is currently looking at the returned count. The code functionally is the same as before.

I don't know if it is possible or no because I'm not too familiar of this part of the code. So every time that a pick to review something that I'm not familiar I start looking to the tests to try to understand the change.

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