-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
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
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. |
I think it was fix for: dgraph-io/badger#476 |
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. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
9be9ce3
to
3310270
Compare
fixes #42