Skip to content

Fix/object counters with new GC#3615

Merged
roman-khimov merged 2 commits intomasterfrom
fix/object-counters-with-new-GC
Oct 3, 2025
Merged

Fix/object counters with new GC#3615
roman-khimov merged 2 commits intomasterfrom
fix/object-counters-with-new-GC

Conversation

@carpawell
Copy link
Member

No description provided.

// object was available before the removal (for calculating the logical object
// counter). The third return value is removed object payload size.
func (db *DB) delete(tx *bbolt.Tx, addr oid.Address, currEpoch uint64) (bool, bool, uint64, error) {
func (db *DB) delete(tx *bbolt.Tx, addr oid.Address) (bool, bool, uint64, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do not call for epoch if not needed

it is never needed

Copy link
Member Author

Choose a reason for hiding this comment

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

in some other places, we still call it, and actual epoch is important but not there

if removeAvailableObject {
err = changeContainerInfo(tx, cID, -int(payloadSize), -1)
if err != nil {
return true, removeAvailableObject, payloadSize, fmt.Errorf("can't update container info: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

no point in non-zero results with error

Copy link
Member Author

Choose a reason for hiding this comment

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

for some reason, this time i decided to highlight that this is not critical and returned values are ok, but container info changing routine failed. dont mind dropping non-zeor values

@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.59%. Comparing base (2a76d31) to head (1b91ec5).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
pkg/local_object_storage/metabase/delete.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3615   +/-   ##
=======================================
  Coverage   26.58%   26.59%           
=======================================
  Files         653      653           
  Lines       50006    50009    +3     
=======================================
+ Hits        13296    13298    +2     
- Misses      35661    35663    +2     
+ Partials     1049     1048    -1     

☔ 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.

After #3582, GC does not work with `Inhume` calls and drops objects directly as
it sees them expired. This breaks object counters since `Delete` call did not
update them.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@carpawell carpawell force-pushed the fix/object-counters-with-new-GC branch from 6048440 to 1b91ec5 Compare October 3, 2025 12:30
@roman-khimov roman-khimov merged commit 4f76ba1 into master Oct 3, 2025
20 of 25 checks passed
@roman-khimov roman-khimov deleted the fix/object-counters-with-new-GC branch October 3, 2025 12:58
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.

3 participants