Skip to content

Commit

Permalink
Merge pull request #4 from coufalja/mod/pebble
Browse files Browse the repository at this point in the history
Mod/pebble
  • Loading branch information
tylerwilliams committed Feb 12, 2024
2 parents 0782f47 + fa84413 commit 21c8b8e
Show file tree
Hide file tree
Showing 24 changed files with 447 additions and 438 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Test
env:
TARGET: ${{ matrix.target }}
Expand Down
27 changes: 8 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
Expand All @@ -33,29 +33,18 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: MEMFS_TEST=1 make test
go1-18-unit-test:
runs-on: ubuntu-22.04
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
run: make test
macos-unit-test:
runs-on: macos-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Test
Expand All @@ -66,7 +55,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Build
Expand All @@ -77,7 +66,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Build
run: |
git clone https://github.com/lni/dragonboat-example
Expand All @@ -86,11 +75,11 @@ jobs:
make
static-check:
runs-on: ubuntu-22.04
steps:
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v3
- name: Static check
Expand Down
11 changes: 6 additions & 5 deletions benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
package dragonboat

import (
"math/rand"
"crypto/rand"
mrand "math/rand"
"os"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -69,7 +70,7 @@ func benchmarkEncodedPayload(b *testing.B, ct dio.CompressionType, sz uint64) {
b.ReportAllocs()
b.SetBytes(int64(sz))
input := make([]byte, sz)
rand.Read(input)
_, _ = rand.Read(input)
b.ResetTimer()
for i := 0; i < b.N; i++ {
rsm.GetEncoded(ct, input, nil)
Expand Down Expand Up @@ -177,7 +178,7 @@ func BenchmarkPendingProposalNextKey(b *testing.B) {
cfg := config.Config{ShardID: 1, ReplicaID: 1}
pp := newPendingProposal(cfg, false, p, q)
b.RunParallel(func(pb *testing.PB) {
clientID := rand.Uint64()
clientID := mrand.Uint64()
for pb.Next() {
pp.nextKey(clientID)
}
Expand Down Expand Up @@ -641,7 +642,7 @@ func BenchmarkChunkWriter(b *testing.B) {
cw := rsm.NewChunkWriter(sink, meta)
sz := int64(1024 * 256)
data := make([]byte, sz)
rand.Read(data)
_, _ = rand.Read(data)
b.ReportAllocs()
b.SetBytes(sz)
b.ResetTimer()
Expand All @@ -659,7 +660,7 @@ func BenchmarkSnappyCompressedChunkWriter(b *testing.B) {
w := snappy.NewBufferedWriter(cw)
sz := int64(1024 * 256)
data := make([]byte, sz)
rand.Read(data)
_, _ = rand.Read(data)
b.ReportAllocs()
b.SetBytes(sz)
b.ResetTimer()
Expand Down
34 changes: 21 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,57 @@ module github.com/lni/dragonboat/v4

require (
github.com/VictoriaMetrics/metrics v1.18.1
github.com/cespare/xxhash/v2 v2.1.2
github.com/cockroachdb/errors v1.9.0
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac
github.com/cespare/xxhash/v2 v2.2.0
github.com/cockroachdb/errors v1.11.1
github.com/cockroachdb/pebble v1.0.0
github.com/golang/snappy v0.0.4
github.com/google/uuid v1.3.0
github.com/hashicorp/memberlist v0.3.1
github.com/kr/pretty v0.3.0
github.com/kr/pretty v0.3.1
github.com/lni/goutils v1.4.0
github.com/lni/vfs v0.2.1-0.20220616104132-8852fd867376
github.com/lni/vfs v0.2.1-0.20231221160030-d43d3c60804c
github.com/pierrec/lz4/v4 v4.1.14
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.1
golang.org/x/exp v0.0.0-20200513190911-00229845015e
golang.org/x/sys v0.12.0
golang.org/x/sys v0.13.0
)

require (
github.com/DataDog/zstd v1.4.5 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/getsentry/sentry-go v0.12.0 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-msgpack v0.5.3 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/go-sockaddr v1.0.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/klauspost/compress v1.11.13 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/miekg/dns v1.1.26 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/valyala/fastrand v1.1.0 // indirect
github.com/valyala/histogram v1.2.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
Loading

0 comments on commit 21c8b8e

Please sign in to comment.