Skip to content

Decouple expired object collector from epoch ticker#3582

Merged
cthulhu-rider merged 4 commits intomasterfrom
3522-decouple-expired-object-collector-from-epoch-ticker
Sep 23, 2025
Merged

Decouple expired object collector from epoch ticker#3582
cthulhu-rider merged 4 commits intomasterfrom
3522-decouple-expired-object-collector-from-epoch-ticker

Conversation

@End-rey
Copy link
Contributor

@End-rey End-rey commented Sep 17, 2025

Closes #3522.

@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 72.00000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.60%. Comparing base (eb3ee42) to head (9753c88).
⚠️ Report is 37 commits behind head on master.

Files with missing lines Patch % Lines
pkg/local_object_storage/shard/gc.go 72.13% 13 Missing and 4 partials ⚠️
pkg/local_object_storage/engine/inhume.go 60.71% 8 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3582      +/-   ##
==========================================
- Coverage   26.66%   26.60%   -0.07%     
==========================================
  Files         654      655       +1     
  Lines       49374    49671     +297     
==========================================
+ Hits        13168    13216      +48     
- Misses      35161    35420     +259     
+ Partials     1045     1035      -10     

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

@End-rey End-rey force-pushed the 3522-decouple-expired-object-collector-from-epoch-ticker branch 2 times, most recently from e54bfcc to 930fa98 Compare September 17, 2025 13:18
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

@cthulhu-rider, there can be some intersections with #3549.

// currentEpoch stores the latest epoch announced via EventNewEpoch.
currentEpoch atomic.Uint64
// expiredDone indicates that all expired objects up to currentEpoch were processed.
expiredDone atomic.Bool
Copy link
Member

Choose a reason for hiding this comment

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

I think another atomic.Uint64 would be more convenient, once you get no expired objects per some epoch you set it to this epoch value.

In fact point №3 of #3522 was to avoid this as well, but then it can mean iterating over a number of locked objects with each GC cycle, so some flag like this can still be handy.

@cthulhu-rider
Copy link
Contributor

@cthulhu-rider, there can be some intersections with #3549.

well yeah, it added EC+GC tests. @End-rey u may try to rebase ur branch and see whether they still pass. They do most likely

This reverts commit aca5584.

The function was needed for immediate deletion of expired objects.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@End-rey End-rey force-pushed the 3522-decouple-expired-object-collector-from-epoch-ticker branch 3 times, most recently from 160754c to 9753c88 Compare September 22, 2025 12:25
Move the processing of expired objects from the epoch event handler to the
regular GC cycle. The epoch event just sets some known epoch and marks that
expired objects need to be processed. When the GC runs, a certain number of
expired objects are immediately deleted (the limit is the same as for the GC).
If no more expired objects are found, the GC no longer checks for their presence
for the current epoch in subsequent ticks. Add GC remover sleep interval to the
tests to track removal of expired objects.

Closes #3522.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
@End-rey End-rey force-pushed the 3522-decouple-expired-object-collector-from-epoch-ticker branch from 9753c88 to ca3742e Compare September 23, 2025 08:11
@cthulhu-rider cthulhu-rider merged commit 5649c3a into master Sep 23, 2025
16 of 20 checks passed
@cthulhu-rider cthulhu-rider deleted the 3522-decouple-expired-object-collector-from-epoch-ticker branch September 23, 2025 14:08
carpawell added a commit that referenced this pull request Oct 3, 2025
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>
carpawell added a commit that referenced this pull request Oct 3, 2025
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>
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.

Decouple expired object collector from epoch ticker

3 participants