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

use create with retries in persister factory #5797

Merged

Conversation

ssd04
Copy link
Contributor

@ssd04 ssd04 commented Jan 3, 2024

Reasoning behind the pull request

  • Integrate latest storageunit refactorings from mx-chain-storage-go

Testing procedure

  • Standard system test

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@ssd04 ssd04 self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (6e6bad9) 80.34% compared to head (3e19e99) 80.37%.

Files Patch % Lines
storage/storageunit/storageunit.go 66.66% 2 Missing and 2 partials ⚠️
storage/factory/storageServiceFactory.go 90.32% 2 Missing and 1 partial ⚠️
genesis/process/genesisBlockCreator.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           feat/refactor-persister-factory    #5797      +/-   ##
===================================================================
+ Coverage                            80.34%   80.37%   +0.03%     
===================================================================
  Files                                  709      709              
  Lines                                94112    94013      -99     
===================================================================
- Hits                                 75615    75566      -49     
+ Misses                               13203    13161      -42     
+ Partials                              5294     5286       -8     

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

@ssd04 ssd04 changed the base branch from rc/v1.7.0 to feat/refactor-persister-factory January 12, 2024 10:34
@ssd04 ssd04 marked this pull request as ready for review January 31, 2024 15:08
iulianpascalau
iulianpascalau previously approved these changes Feb 22, 2024
go.mod Outdated
@@ -19,7 +19,7 @@ require (
github.com/multiversx/mx-chain-es-indexer-go v1.4.18-0.20231228064619-e3b0caf29058
github.com/multiversx/mx-chain-logger-go v1.0.14-0.20231215125130-a3bed6e76040
github.com/multiversx/mx-chain-scenario-go v1.2.2-0.20231129113427-ad3056f45296
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20231213110622-e222ba96a9f4
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240131142608-5c126467749c
Copy link
Collaborator

Choose a reason for hiding this comment

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

should update to latest commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to latest version

}

// NewStorageUnitFromConf creates a new storage unit from a storage unit config
func NewStorageUnitFromConf(cacheConf CacheConfig, dbConf DBConfig, persisterFactory storage.PersisterFactoryHandler) (*Unit, error) {
return storageUnit.NewStorageUnitFromConf(cacheConf, dbConf, persisterFactory)
if dbConf.MaxBatchSize > int(cacheConf.Capacity) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not move the CreateWithRetries logic on storage-go, which gets as parameter the number of retries?

this way we remove this code which seems to be duplicated in storageUnit.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i wanted to keep NewStorageUnitFromConf as before; also since CreatWithRetries is specific to our persister implementation in mx-chain-go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but indeed, it is to be discussed

@ssd04 ssd04 merged commit c4a1a60 into feat/refactor-persister-factory Feb 26, 2024
7 checks passed
@ssd04 ssd04 deleted the common-storage-persister-factory branch February 26, 2024 07:25
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