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

[Storage Refactor] Init pebble DB in scaffold. #6949

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zhangchiqing
Copy link
Member

@zhangchiqing zhangchiqing commented Jan 28, 2025

This PR adds a flag pebble-dir with default value /data/pebble-dir for storing pebble database data. It will be used for the transition from badger to pebbleDB.

@@ -1925,14 +1930,6 @@ func WithLogLevel(level string) Option {
}
}

// WithDB takes precedence over WithDataDir and datadir will be set to empty if DB is set using this option
func WithDB(db *badger.DB) Option {
Copy link
Member Author

Choose a reason for hiding this comment

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

not being used anywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was added to support the consensus follower

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 41.11%. Comparing base (64c8b79) to head (07039d5).

Files with missing lines Patch % Lines
cmd/scaffold.go 0.00% 15 Missing ⚠️
cmd/scaffold/pebble_db.go 45.45% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6949      +/-   ##
==========================================
- Coverage   41.13%   41.11%   -0.02%     
==========================================
  Files        2119     2120       +1     
  Lines      185938   185945       +7     
==========================================
- Hits        76479    76457      -22     
- Misses     103054   103077      +23     
- Partials     6405     6411       +6     
Flag Coverage Δ
unittests 41.11% <25.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@zhangchiqing zhangchiqing marked this pull request as ready for review January 28, 2025 21:19
@zhangchiqing zhangchiqing requested a review from a team as a code owner January 28, 2025 21:19
@@ -1889,9 +1896,7 @@ func WithBindAddress(bindAddress string) Option {

func WithDataDir(dataDir string) Option {
return func(config *BaseConfig) {
if config.db == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was used for the consensus follower

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand why we need both WithDB and WithDataDir. I think we should keep only one, no?

@@ -1925,14 +1930,6 @@ func WithLogLevel(level string) Option {
}
}

// WithDB takes precedence over WithDataDir and datadir will be set to empty if DB is set using this option
func WithDB(db *badger.DB) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was added to support the consensus follower

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