From 961e1d360fe8ef4efb573f15fa7da0e907809fc0 Mon Sep 17 00:00:00 2001 From: Shivani Joshi <46731446+Shivani912@users.noreply.github.com> Date: Tue, 10 Sep 2019 15:19:33 -0400 Subject: [PATCH] docs/guides: specify a fix for badger err on Windows (#3974) * Added badger error for Windows * Update go-built-in.md * Update docs/guides/go-built-in.md Co-Authored-By: Anton Kaliaev * Update docs/guides/go.md Co-Authored-By: Anton Kaliaev When restarting the app, it throws an error saying that it requires truncation of badger value log because it is corrupted. This seems to be an issue with badger DB and it is reported here. It solves the problem when you set the truncate value to true, but this obviously results in loss of data. I am not sure if this is a concern or not. However, it'd great if this could be documented for Windows users! Fixes #3954 --- docs/guides/go-built-in.md | 6 ++++++ docs/guides/go.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/guides/go-built-in.md b/docs/guides/go-built-in.md index 705022c9..96adaf88 100644 --- a/docs/guides/go-built-in.md +++ b/docs/guides/go-built-in.md @@ -448,6 +448,12 @@ defer db.Close() app := NewKVStoreApplication(db) ``` +For **Windows** users, restarting this app will make badger throw an error as it requires value log to be truncated. For more information on this, visit [here](https://github.com/dgraph-io/badger/issues/744). +This can be avoided by setting the truncate option to true, like this: +```go +db, err := badger.Open(badger.DefaultOptions("/tmp/badger").WithTruncate(true)) +``` + Then we use it to create a Tendermint Core `Node` instance: ```go diff --git a/docs/guides/go.md b/docs/guides/go.md index ada84adf..3798c9f5 100644 --- a/docs/guides/go.md +++ b/docs/guides/go.md @@ -388,6 +388,12 @@ defer db.Close() app := NewKVStoreApplication(db) ``` +For **Windows** users, restarting this app will make badger throw an error as it requires value log to be truncated. For more information on this, visit [here](https://github.com/dgraph-io/badger/issues/744). +This can be avoided by setting the truncate option to true, like this: +```go +db, err := badger.Open(badger.DefaultOptions("/tmp/badger").WithTruncate(true)) +``` + Then we start the ABCI server and add some signal handling to gracefully stop it upon receiving SIGTERM or Ctrl-C. Tendermint Core will act as a client, which connects to our server and send us transactions and other messages.