diff --git a/lib/build/build.go b/lib/build/build.go index 5c8d7c336..69a509b21 100644 --- a/lib/build/build.go +++ b/lib/build/build.go @@ -43,7 +43,6 @@ var ( "STHASHING", "STNORESTART", "STNOUPGRADE", - "USE_BADGER", } ) diff --git a/lib/db/backend/backend.go b/lib/db/backend/backend.go index 2cdeaf498..4a29a79cc 100644 --- a/lib/db/backend/backend.go +++ b/lib/db/backend/backend.go @@ -131,24 +131,14 @@ const ( ) func Open(path string, tuning Tuning) (Backend, error) { - if os.Getenv("USE_BADGER") != "" { - l.Warnln("Using experimental badger db") - if err := maybeCopyDatabase(path, strings.Replace(path, locations.BadgerDir, locations.LevelDBDir, 1), OpenBadger, OpenLevelDBRO); err != nil { - return nil, err - } - return OpenBadger(path) - } - if err := maybeCopyDatabase(path, strings.Replace(path, locations.LevelDBDir, locations.BadgerDir, 1), OpenLevelDBAuto, OpenBadger); err != nil { return nil, err } + return OpenLevelDB(path, tuning) } func OpenMemory() Backend { - if os.Getenv("USE_BADGER") != "" { - return OpenBadgerMemory() - } return OpenLevelDBMemory() } diff --git a/lib/db/db_test.go b/lib/db/db_test.go index 2c32d422b..07c2ae7bc 100644 --- a/lib/db/db_test.go +++ b/lib/db/db_test.go @@ -10,7 +10,6 @@ import ( "bytes" "context" "fmt" - "os" "testing" "github.com/syncthing/syncthing/lib/db/backend" @@ -801,11 +800,6 @@ func TestFlushRecursion(t *testing.T) { // Verify that a commit hook can write to the transaction without // causing another flush and thus recursion. - // Badger doesn't work like this. - if os.Getenv("USE_BADGER") != "" { - t.Skip("Not supported on Badger") - } - db := NewLowlevel(backend.OpenMemory()) defer db.Close() diff --git a/lib/locations/locations.go b/lib/locations/locations.go index 702683f26..8e0e69ec8 100644 --- a/lib/locations/locations.go +++ b/lib/locations/locations.go @@ -53,11 +53,6 @@ const ( var baseDirs = make(map[BaseDirEnum]string, 3) func init() { - if os.Getenv("USE_BADGER") != "" { - // XXX: Replace the leveldb name with the badger name. - locationTemplates[Database] = strings.Replace(locationTemplates[Database], LevelDBDir, BadgerDir, 1) - } - userHome := userHomeDir() config := defaultConfigDir(userHome) baseDirs[UserHomeBaseDir] = userHome