Skip to content

Commit

Permalink
gomod: remove my patch dependency (#57571)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Nov 21, 2024
1 parent 1c059a1 commit c091dba
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 57 deletions.
13 changes: 0 additions & 13 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4576,19 +4576,6 @@ def go_deps():
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/labstack/gommon/com_github_labstack_gommon-v0.4.0.zip",
],
)
go_repository(
name = "com_github_lance6716_pebble",
build_file_proto_mode = "disable_global",
importpath = "github.com/lance6716/pebble",
sha256 = "8fe7ce7009c4d2b0ae28f4c3d62f38b6256ee20e47944490b58cb1d33a155725",
strip_prefix = "github.com/lance6716/pebble@v0.0.0-20241108073934-da961314c63f",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip",
"http://ats.apps.svc/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip",
"https://cache.hawkingrei.com/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/lance6716/pebble/com_github_lance6716_pebble-v0.0.0-20241108073934-da961314c63f.zip",
],
)
go_repository(
name = "com_github_lasiar_canonicalheader",
build_file_proto_mode = "disable_global",
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ require (
github.com/kisielk/errcheck v1.8.0
github.com/klauspost/compress v1.17.9
github.com/ks3sdklib/aws-sdk-go v1.2.9
github.com/lance6716/pebble v0.0.0-20241108073934-da961314c63f
github.com/lestrrat-go/jwx/v2 v2.0.21
github.com/mgechev/revive v1.5.0
github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,6 @@ github.com/ks3sdklib/aws-sdk-go v1.2.9 h1:Eg0fM56r4Gjp9PiK1Bg9agJUxCAWCk236qq9DI
github.com/ks3sdklib/aws-sdk-go v1.2.9/go.mod h1:xBNbOrxSnd36AQpZ8o99mGGu+blblUd9rI0MKGmeufo=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lance6716/pebble v0.0.0-20241108073934-da961314c63f h1:KyBFXtlZDJTrwuD3wBHGk+TtdOpCB17AEm0X4eqhRdg=
github.com/lance6716/pebble v0.0.0-20241108073934-da961314c63f/go.mod h1:ZxnWA3Ab0ufDIyppyzL16j6HFNpdXeiU/1cE4Wlv/lQ=
github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=
github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
Expand Down
16 changes: 8 additions & 8 deletions pkg/lightning/tikv/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ go_library(
"//pkg/meta/model",
"//pkg/util/codec",
"//pkg/util/intest",
"@com_github_cockroachdb_pebble//:pebble",
"@com_github_cockroachdb_pebble//bloom",
"@com_github_cockroachdb_pebble//objstorage/objstorageprovider",
"@com_github_cockroachdb_pebble//sstable",
"@com_github_cockroachdb_pebble//vfs",
"@com_github_coreos_go_semver//semver",
"@com_github_lance6716_pebble//:pebble",
"@com_github_lance6716_pebble//bloom",
"@com_github_lance6716_pebble//objstorage/objstorageprovider",
"@com_github_lance6716_pebble//sstable",
"@com_github_lance6716_pebble//vfs",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/debugpb",
"@com_github_pingcap_kvproto//pkg/import_sstpb",
Expand Down Expand Up @@ -52,11 +52,11 @@ go_test(
flaky = True,
shard_count = 7,
deps = [
"@com_github_cockroachdb_pebble//:pebble",
"@com_github_cockroachdb_pebble//sstable",
"@com_github_cockroachdb_pebble//vfs",
"@com_github_coreos_go_semver//semver",
"@com_github_google_uuid//:uuid",
"@com_github_lance6716_pebble//:pebble",
"@com_github_lance6716_pebble//sstable",
"@com_github_lance6716_pebble//vfs",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/import_sstpb",
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
Expand Down
10 changes: 5 additions & 5 deletions pkg/lightning/tikv/local_sst_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package tikv
import (
"encoding/binary"

rocks "github.com/lance6716/pebble"
rocksbloom "github.com/lance6716/pebble/bloom"
"github.com/lance6716/pebble/objstorage/objstorageprovider"
rockssst "github.com/lance6716/pebble/sstable"
"github.com/lance6716/pebble/vfs"
rocks "github.com/cockroachdb/pebble"
rocksbloom "github.com/cockroachdb/pebble/bloom"
"github.com/cockroachdb/pebble/objstorage/objstorageprovider"
rockssst "github.com/cockroachdb/pebble/sstable"
"github.com/cockroachdb/pebble/vfs"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/pkg/util/codec"
"github.com/pingcap/tidb/pkg/util/intest"
Expand Down
55 changes: 28 additions & 27 deletions pkg/lightning/tikv/local_sst_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"testing"
"time"

rocks "github.com/cockroachdb/pebble"
rockssst "github.com/cockroachdb/pebble/sstable"
"github.com/cockroachdb/pebble/vfs"
"github.com/google/uuid"
rocks "github.com/lance6716/pebble"
rockssst "github.com/lance6716/pebble/sstable"
"github.com/lance6716/pebble/vfs"
"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/import_sstpb"
"github.com/pingcap/kvproto/pkg/kvrpcpb"
Expand Down Expand Up @@ -222,6 +222,7 @@ func pebbleWriteSST(
}

func TestPebbleWriteSST(t *testing.T) {
t.Skip("skip because need patched pebble")
for i, c := range testCases {
t.Logf("start test case %d", i)
testPebbleWriteSST(t, c)
Expand Down Expand Up @@ -296,30 +297,30 @@ func getData2Compare(
realKVs = append(realKVs, [2][]byte{getKey(k), getValue(v)})
}

p := reader.Properties.Clone()

// delete the identity properties
delete(p.UserProperties, "rocksdb.creating.db.identity")
delete(p.UserProperties, "rocksdb.creating.host.identity")
delete(p.UserProperties, "rocksdb.creating.session.identity")
delete(p.UserProperties, "rocksdb.original.file.number")

// delete some mismatch properties because compress layer has different behaviour
p.DataSize = 0
p.NumDataBlocks = 0
p.IndexSize = 0

// TODO(lance6716): check why it's different, can we tune bloomfilter to get the
// same behaviour?
p.FilterSize = 0
delete(p.UserProperties, "rocksdb.num.filter_entries")

// TODO(lance6716): in integration tests we need to check
// rocksdb.tail.start.offset equals to rocksdb.data.size
delete(p.UserProperties, "rocksdb.tail.start.offset")
p.Loaded = nil

return realKVs, p
//p := reader.Properties.Clone()
//
//// delete the identity properties
//delete(p.UserProperties, "rocksdb.creating.db.identity")
//delete(p.UserProperties, "rocksdb.creating.host.identity")
//delete(p.UserProperties, "rocksdb.creating.session.identity")
//delete(p.UserProperties, "rocksdb.original.file.number")
//
//// delete some mismatch properties because compress layer has different behaviour
//p.DataSize = 0
//p.NumDataBlocks = 0
//p.IndexSize = 0
//
//// TODO(lance6716): check why it's different, can we tune bloomfilter to get the
//// same behaviour?
//p.FilterSize = 0
//delete(p.UserProperties, "rocksdb.num.filter_entries")
//
//// TODO(lance6716): in integration tests we need to check
//// rocksdb.tail.start.offset equals to rocksdb.data.size
//delete(p.UserProperties, "rocksdb.tail.start.offset")
//p.Loaded = nil

return realKVs, nil
}

func TestDebugReadSST(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lightning/tikv/prop_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"encoding/binary"
"slices"

rockssst "github.com/lance6716/pebble/sstable"
rockssst "github.com/cockroachdb/pebble/sstable"
)

type mockCollector struct {
Expand Down

0 comments on commit c091dba

Please sign in to comment.