Skip to content

Commit

Permalink
Revert "Add missing commits to release/v2.0 branch (#1245)"
Browse files Browse the repository at this point in the history
This reverts commit 8fd5740.
  • Loading branch information
Ibrahim Jarif committed Mar 24, 2020
1 parent 8fd5740 commit 07f2496
Show file tree
Hide file tree
Showing 25 changed files with 383 additions and 1,143 deletions.
32 changes: 10 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
language: go

go:
- "1.11"
- "1.12"
- "1.13"
- tip
- "1.11"
- "1.12"
- "1.13"
- tip
os:
- osx
env:
jobs:
- GOARCH=386
- GOARCH=amd64
global:
- secure: CRkV2+/jlO0gXzzS50XGxfMS117FNwiVjxNY/LeWq06RKD+dDCPxTJl3JCNe3l0cYEPAglV2uMMYukDiTqJ7e+HI4nh4N4mv6lwx39N8dAvJe1x5ITS2T4qk4kTjuQb1Q1vw/ZOxoQqmvNKj2uRmBdJ/HHmysbRJ1OzCWML3OXdUwJf0AYlJzTjpMfkOKr7sTtE4rwyyQtd4tKH1fGdurgI9ZuFd9qvYxK2qcJhsQ6CNqMXt+7FkVkN1rIPmofjjBTNryzUr4COFXuWH95aDAif19DeBW4lbNgo1+FpDsrgmqtuhl6NAuptI8q/imow2KXBYJ8JPXsxW8DVFj0IIp0RCd3GjaEnwBEbxAyiIHLfW7AudyTS/dJOvZffPqXnuJ8xj3OPIdNe4xY0hWl8Ju2HhKfLOAHq7VadHZWd3IHLil70EiL4/JLD1rNbMImUZisFaA8pyrcIvYYebjOnk4TscwKFLedClRSX1XsMjWWd0oykQtrdkHM2IxknnBpaLu7mFnfE07f6dkG0nlpyu4SCLey7hr5FdcEmljA0nIxTSYDg6035fQkBEAbe7hlESOekkVNT9IZPwG+lmt3vU4ofi6NqNbJecOuSB+h36IiZ9s4YQtxYNnLgW14zjuFGGyT5smc3IjBT7qngDjKIgyrSVoRkY/8udy9qbUgvBeW8=


- osx

jobs:
allow_failures:
- go: tip
exclude:
# Exclude builds for 386 architecture on go 1.11, 1.12 and tip
# Since we don't want it to run for 32 bit
- go: "1.11"
env: GOARCH=386
- go: "1.12"
env: GOARCH=386
- go: tip
env: GOARCH=386

notifications:
email: false
slack:
secure: X7uBLWYbuUhf8QFE16CoS5z7WvFR8EN9j6cEectMW6mKZ3vwXGwVXRIPsgUq/606DsQdCCx34MR8MRWYGlu6TBolbSe9y0EP0i46yipPz22YtuT7umcVUbGEyx8MZKgG0v1u/zA0O4aCsOBpGAA3gxz8h3JlEHDt+hv6U8xRsSllVLzLSNb5lwxDtcfEDxVVqP47GMEgjLPM28Pyt5qwjk7o5a4YSVzkfdxBXxd3gWzFUWzJ5E3cTacli50dK4GVfiLcQY2aQYoYO7AAvDnvP+TPfjDkBlUEE4MUz5CDIN51Xb+WW33sX7g+r3Bj7V5IRcF973RiYkpEh+3eoiPnyWyxhDZBYilty3b+Hysp6d4Ov/3I3ll7Bcny5+cYjakjkMH3l9w3gs6Y82GlpSLSJshKWS8vPRsxFe0Pstj6QSJXTd9EBaFr+l1ScXjJv/Sya9j8N9FfTuOTESWuaL1auX4Y7zEEVHlA8SCNOO8K0eTfxGZnC/YcIHsR8rePEAcFxfOYQppkyLF/XvAtnb/LMUuu0g4y2qNdme6Oelvyar1tFEMRtbl4mRCdu/krXBFtkrsfUaVY6WTPdvXAGotsFJ0wuA53zGVhlcd3+xAlSlR3c1QX95HIMeivJKb5L4nTjP+xnrmQNtnVk+tG4LSH2ltuwcZSSczModtcBmRefrk=

env:
global:
- secure: CRkV2+/jlO0gXzzS50XGxfMS117FNwiVjxNY/LeWq06RKD+dDCPxTJl3JCNe3l0cYEPAglV2uMMYukDiTqJ7e+HI4nh4N4mv6lwx39N8dAvJe1x5ITS2T4qk4kTjuQb1Q1vw/ZOxoQqmvNKj2uRmBdJ/HHmysbRJ1OzCWML3OXdUwJf0AYlJzTjpMfkOKr7sTtE4rwyyQtd4tKH1fGdurgI9ZuFd9qvYxK2qcJhsQ6CNqMXt+7FkVkN1rIPmofjjBTNryzUr4COFXuWH95aDAif19DeBW4lbNgo1+FpDsrgmqtuhl6NAuptI8q/imow2KXBYJ8JPXsxW8DVFj0IIp0RCd3GjaEnwBEbxAyiIHLfW7AudyTS/dJOvZffPqXnuJ8xj3OPIdNe4xY0hWl8Ju2HhKfLOAHq7VadHZWd3IHLil70EiL4/JLD1rNbMImUZisFaA8pyrcIvYYebjOnk4TscwKFLedClRSX1XsMjWWd0oykQtrdkHM2IxknnBpaLu7mFnfE07f6dkG0nlpyu4SCLey7hr5FdcEmljA0nIxTSYDg6035fQkBEAbe7hlESOekkVNT9IZPwG+lmt3vU4ofi6NqNbJecOuSB+h36IiZ9s4YQtxYNnLgW14zjuFGGyT5smc3IjBT7qngDjKIgyrSVoRkY/8udy9qbUgvBeW8=

before_script:
- go get github.com/mattn/goveralls
script:
Expand Down
23 changes: 2 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Serialization Versioning](VERSIONING.md).

## [2.0.2] - 2020-02-26

### Fixed

- Cast sz to uint32 to fix compilation on 32 bit. (#1175)
- Fix checkOverlap in compaction. (#1166)
- Avoid sync in inmemory mode. (#1190)
- Support disabling the cache completely. (#1185)
- Add support for caching bloomfilters. (#1204)
- Fix int overflow for 32bit. (#1216)
- Remove the 'this entry should've caught' log from value.go. (#1170)
- Rework concurrency semantics of valueLog.maxFid. (#1187)

### Performance

- Use fastRand instead of locked-rand in skiplist. (#1173)
- Improve write stalling on level 0 and 1. (#1186)
- Disable compression and set ZSTD Compression Level to 1. (#1191)

## [2.0.1] - 2020-01-02

### New APIs

- badger.Options
- WithInMemory (f5b6321)
- WithInMemory (5b6321)
- WithZSTDCompressionLevel (3eb4e72)

- Badger.TableInfo
Expand Down Expand Up @@ -293,7 +274,7 @@ Bug fix:
## [1.0.1] - 2017-11-06
* Fix an uint16 overflow when resizing key slice

[2.0.2]: https://github.com/dgraph-io/badger/compare/v2.0.1...v2.0.2
[Unreleased]: https://github.com/dgraph-io/badger/compare/v2.0.1...HEAD
[2.0.1]: https://github.com/dgraph-io/badger/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/dgraph-io/badger/compare/v1.6.0...v2.0.0
[1.6.0]: https://github.com/dgraph-io/badger/compare/v1.5.5...v1.6.0
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ on it.

```go
err := db.Update(func(txn *badger.Txn) error {
e := badger.NewEntry([]byte("answer"), []byte("42"))
e := NewEntry([]byte("answer"), []byte("42"))
err := txn.SetEntry(e)
return err
})
Expand Down Expand Up @@ -401,7 +401,7 @@ and `Txn.SetEntry()` API methods.

```go
err := db.Update(func(txn *badger.Txn) error {
e := badger.NewEntry([]byte("answer"), []byte("42")).WithTTL(time.Hour)
e := NewEntry([]byte("answer"), []byte("42")).WithTTL(time.Hour)
err := txn.SetEntry(e)
return err
})
Expand All @@ -414,7 +414,7 @@ metadata can be set using `Entry.WithMeta()` and `Txn.SetEntry()` API methods.

```go
err := db.Update(func(txn *badger.Txn) error {
e := badger.NewEntry([]byte("answer"), []byte("42")).WithMeta(byte(1))
e := NewEntry([]byte("answer"), []byte("42")).WithMeta(byte(1))
err := txn.SetEntry(e)
return err
})
Expand All @@ -425,7 +425,7 @@ then can be set using `Txn.SetEntry()`.

```go
err := db.Update(func(txn *badger.Txn) error {
e := badger.NewEntry([]byte("answer"), []byte("42")).WithMeta(byte(1)).WithTTL(time.Hour)
e := NewEntry([]byte("answer"), []byte("42")).WithMeta(byte(1)).WithTTL(time.Hour)
err := txn.SetEntry(e)
return err
})
Expand Down Expand Up @@ -748,7 +748,6 @@ Below is a list of known projects that use Badger:

* [0-stor](https://github.com/zero-os/0-stor) - Single device object store.
* [Dgraph](https://github.com/dgraph-io/dgraph) - Distributed graph database.
* [Jaeger](https://github.com/jaegertracing/jaeger) - Distributed tracing platform.
* [TalariaDB](https://github.com/grab/talaria) - Distributed, low latency time-series database.
* [Dispatch Protocol](https://github.com/dispatchlabs/disgo) - Blockchain protocol for distributed application data analytics.
* [Sandglass](https://github.com/celrenheit/sandglass) - distributed, horizontally scalable, persistent, time sorted message queue.
Expand Down
106 changes: 61 additions & 45 deletions backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,19 @@ func TestBackupRestore1(t *testing.T) {

func TestBackupRestore2(t *testing.T) {
tmpdir, err := ioutil.TempDir("", "badger-test")
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
defer removeDir(tmpdir)

s1Path := filepath.Join(tmpdir, "test1")
s2Path := filepath.Join(tmpdir, "test2")
s3Path := filepath.Join(tmpdir, "test3")

db1, err := Open(getTestOptions(s1Path))
require.NoError(t, err)

defer db1.Close()
if err != nil {
t.Fatal(err)
}
key1 := []byte("key1")
key2 := []byte("key2")
rawValue := []byte("NotLongValue")
Expand All @@ -138,30 +139,35 @@ func TestBackupRestore2(t *testing.T) {
}
return tx.SetEntry(NewEntry(key2, rawValue))
})
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
for i := byte(1); i < N; i++ {
err = db1.Update(func(tx *Txn) error {
if err := tx.SetEntry(NewEntry(append(key1, i), rawValue)); err != nil {
return err
}
return tx.SetEntry(NewEntry(append(key2, i), rawValue))
})
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
}
var backup bytes.Buffer
_, err = db1.Backup(&backup, 0)
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
fmt.Println("backup1 length:", backup.Len())

db2, err := Open(getTestOptions(s2Path))
require.NoError(t, err)

defer db2.Close()
if err != nil {
t.Fatal(err)
}
err = db2.Load(&backup, 16)
require.NoError(t, err)
if err != nil {
t.Fatal(err)
}

for i := byte(1); i < N; i++ {
err = db2.View(func(tx *Txn) error {
Expand All @@ -182,8 +188,9 @@ func TestBackupRestore2(t *testing.T) {
}
return nil
})
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
}

for i := byte(1); i < N; i++ {
Expand All @@ -193,22 +200,26 @@ func TestBackupRestore2(t *testing.T) {
}
return tx.SetEntry(NewEntry(append(key2, i), rawValue))
})
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
}

backup.Reset()
_, err = db2.Backup(&backup, 0)
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
fmt.Println("backup2 length:", backup.Len())
db3, err := Open(getTestOptions(s3Path))
require.NoError(t, err)

defer db3.Close()
if err != nil {
t.Fatal(err)
}

err = db3.Load(&backup, 16)
require.NoError(t, err)
if err != nil {
t.Fatal(err)
}

for i := byte(1); i < N; i++ {
err = db3.View(func(tx *Txn) error {
Expand All @@ -229,8 +240,9 @@ func TestBackupRestore2(t *testing.T) {
}
return nil
})
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
}

}
Expand Down Expand Up @@ -298,8 +310,9 @@ func TestBackup(t *testing.T) {
}
t.Run("disk mode", func(t *testing.T) {
tmpdir, err := ioutil.TempDir("", "badger-test")
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
defer removeDir(tmpdir)
opt := DefaultOptions(filepath.Join(tmpdir, "backup0"))
runBadgerTest(t, &opt, func(t *testing.T, db *DB) {
Expand All @@ -317,9 +330,11 @@ func TestBackup(t *testing.T) {

func TestBackupRestore3(t *testing.T) {
var bb bytes.Buffer
tmpdir, err := ioutil.TempDir("", "badger-test")
require.NoError(t, err)

tmpdir, err := ioutil.TempDir("", "badger-test")
if err != nil {
t.Fatal(err)
}
defer removeDir(tmpdir)

N := 1000
Expand All @@ -328,9 +343,10 @@ func TestBackupRestore3(t *testing.T) {
// backup
{
db1, err := Open(DefaultOptions(filepath.Join(tmpdir, "backup1")))
require.NoError(t, err)
if err != nil {
t.Fatal(err)
}

defer db1.Close()
require.NoError(t, populateEntries(db1, entries))

_, err = db1.Backup(&bb, 0)
Expand All @@ -342,9 +358,9 @@ func TestBackupRestore3(t *testing.T) {

// restore
db2, err := Open(DefaultOptions(filepath.Join(tmpdir, "restore1")))
require.NoError(t, err)

defer db2.Close()
if err != nil {
t.Fatal(err)
}
require.NoError(t, db2.Load(&bb, 16))

// verify
Expand Down Expand Up @@ -374,8 +390,9 @@ func TestBackupRestore3(t *testing.T) {

func TestBackupLoadIncremental(t *testing.T) {
tmpdir, err := ioutil.TempDir("", "badger-test")
require.NoError(t, err)

if err != nil {
t.Fatal(err)
}
defer removeDir(tmpdir)

N := 100
Expand All @@ -386,9 +403,9 @@ func TestBackupLoadIncremental(t *testing.T) {
// backup
{
db1, err := Open(DefaultOptions(filepath.Join(tmpdir, "backup2")))
require.NoError(t, err)

defer db1.Close()
if err != nil {
t.Fatal(err)
}

require.NoError(t, populateEntries(db1, entries))
since, err := db1.Backup(&bb, 0)
Expand Down Expand Up @@ -446,10 +463,9 @@ func TestBackupLoadIncremental(t *testing.T) {

// restore
db2, err := Open(getTestOptions(filepath.Join(tmpdir, "restore2")))
require.NoError(t, err)

defer db2.Close()

if err != nil {
t.Fatal(err)
}
require.NoError(t, db2.Load(&bb, 16))

// verify
Expand Down
Loading

0 comments on commit 07f2496

Please sign in to comment.