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

tweak the default options #52

Merged
merged 2 commits into from
Apr 4, 2019
Merged

tweak the default options #52

merged 2 commits into from
Apr 4, 2019

Conversation

Stebalien
Copy link
Member

  1. Disable CompactL0OnClose. That's only useful for users who open badger read-only and expect high-performance queries. We never do that.
  2. Default Truncate to true. The user can still override this but, 99% of the time, this is what the user wants. We already set this in go-ipfs but setting it here gives libp2p users sane defaults.

fixes #42

1. Disable CompactL0OnClose. That's only useful for users who open badger
read-only and expect high-performance queries. We never do that.
2. Default Truncate to true. The user can still override this but, 99% of the
time, this is what the user wants. We already set this in go-ipfs but setting it
here gives libp2p users sane defaults.

fixes #42
@ghost ghost assigned Stebalien Mar 8, 2019
@ghost ghost added the status/in-progress In progress label Mar 8, 2019
@Stebalien Stebalien requested a review from magik6k March 8, 2019 00:35
@Kubuxu
Copy link
Member

Kubuxu commented Mar 8, 2019

The Trucate, IIRC, was a bug in badger. We would have to verify on Windows.

@Stebalien
Copy link
Member Author

The Trucate, IIRC, was a bug in badger. We would have to verify on Windows.

So, truncate just means "throw away any data we may have been writing when we crashed". Given that we write everything synchronously and wait for writes to complete, we decided to enable truncate by default everywhere.

@Kubuxu
Copy link
Member

Kubuxu commented Mar 8, 2019

I think it was fix for: dgraph-io/badger#476

@Stebalien
Copy link
Member Author

That windows check was, yes. However, we still had a problem on Linux (when killing the daemon). That's why we've enabled truncate by default.

Copy link
Member

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

LGTM (and we could remove windows truncate logic)

datastore.go Outdated
@@ -63,6 +69,8 @@ func NewDatastore(path string, options *Options) (*Datastore, error) {
gcDiscardRatio = options.gcDiscardRatio
}

// TODO: remove this? We should let the user choose what they want to
// do.
Copy link
Member

Choose a reason for hiding this comment

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

👍

We now default to true everywhere.
@Stebalien Stebalien merged commit d61340f into master Apr 4, 2019
@ghost ghost removed the status/in-progress In progress label Apr 4, 2019
@Stebalien Stebalien deleted the fix/tweak-options branch April 18, 2019 19:19
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.

Set CompactL0OnClose to false
3 participants