Skip to content

Commit

Permalink
ForceSync = 1 as default
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed Feb 6, 2024
1 parent a6c2b52 commit 7664d28
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import (

// ForceSync
/*
This is set at compile time. Could be 0 or 1, defaults is 0.
It will force using Sync for NoSync functions (Set, Delete, Write)
This is set at compile time. Could be 0 or 1, defaults is 1.
It forces using Sync for NoSync functions (Set, Delete, Write)
Used as a workaround for chain-upgrade issue: At the upgrade-block, the sdk will panic without flushing data to disk or
closing dbs properly.
Notice if ForceSync=0: performance will be better. However, there is an issue when upgrading.
And the workaround (if using ForceSync=0):
At the upgrade-block, the sdk will panic without flushing data to disk or closing dbs properly.
Upgrade guide:
1. After seeing `UPGRADE "xxxx" NEED at height....`, restart current version with `-X github.com/tendermint/tm-db.ForceSync=1`
Expand Down Expand Up @@ -48,7 +49,7 @@ go install -tags pebbledb -ldflags "-w -s -X github.com/cosmos/cosmos-sdk/types.
$HOME/go/bin/sifnoded start --db_backend=pebbledb
*/
var ForceSync = "0"
var ForceSync = "1"
var isForceSync = false

func init() {
Expand Down

0 comments on commit 7664d28

Please sign in to comment.