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

feat(shwap/store): Add q4 trimming support in store #3680

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

walldiss
Copy link
Member

@walldiss walldiss commented Aug 23, 2024

No description provided.

@walldiss walldiss added kind:feat Attached to feature PRs shwap labels Aug 23, 2024
@walldiss walldiss self-assigned this Aug 23, 2024
@walldiss walldiss changed the title feat(store): Add archival pruning support feat(shwap/store): Add q4 trimming support in store Sep 9, 2024
@walldiss walldiss marked this pull request as ready for review September 9, 2024 14:47
return
}
if ctx.Err() != nil {
ctx = context.Background()
Copy link
Contributor

Choose a reason for hiding this comment

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

So, always blocking? Maybe context.WithTimeout(context.Background(), time.Second) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good that you pointed out. We use common function to reset context in metrics everywhere else. I'll change how we do it in another PR.

Copy link
Member

Choose a reason for hiding this comment

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

Agree. It may cause random hickups somewhere in the future that would be a nightmare to debug

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2024

Codecov Report

Attention: Patch coverage is 46.03175% with 34 lines in your changes missing coverage. Please review.

Please upload report for BASE (shwap@5928c6a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
store/metrics.go 19.04% 17 Missing ⚠️
store/store.go 60.97% 10 Missing and 6 partials ⚠️
pruner/full/pruner.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             shwap    #3680   +/-   ##
========================================
  Coverage         ?   46.63%           
========================================
  Files            ?      314           
  Lines            ?    17792           
  Branches         ?        0           
========================================
  Hits             ?     8298           
  Misses           ?     8490           
  Partials         ?     1004           

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

store/store.go Outdated
@@ -305,51 +304,76 @@ func (s *Store) hasByHeight(height uint64) (bool, error) {
return exists(pathODS)
}

func (s *Store) Remove(ctx context.Context, height uint64, datahash share.DataHash) error {
func (s *Store) RemoveAll(ctx context.Context, height uint64, datahash share.DataHash) error {
Copy link
Member

Choose a reason for hiding this comment

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

Let's name to RemoveODSQ4. Its not clear what All stands for.

Same for helpers methods and metrics.

store/store.go Outdated
@@ -33,7 +33,7 @@ const (
var ErrNotFound = errors.New("eds not found in store")

// Store is a storage for EDS files. It persists EDS files on disk in form of Q1Q4 files or ODS
// files. It provides methods to put, get and remove EDS files. It has two caches: recent eds cache
// files. It provides methods to put, get and removeAll EDS files. It has two caches: recent eds cache
Copy link
Member

Choose a reason for hiding this comment

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

rename relic

return
}
if ctx.Err() != nil {
ctx = context.Background()
Copy link
Member

Choose a reason for hiding this comment

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

Agree. It may cause random hickups somewhere in the future that would be a nightmare to debug

@walldiss walldiss merged commit efa7365 into celestiaorg:shwap Sep 11, 2024
7 checks passed
@walldiss walldiss deleted the shwap-archival-pruning branch September 11, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feat Attached to feature PRs shwap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants