Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
lidezhu committed Feb 27, 2025
1 parent 4e9b1ad commit 2febea6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ require (
github.com/imdario/mergo v0.3.16
github.com/jcmturner/gokrb5/v8 v8.4.4
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.17.9
github.com/linkedin/goavro/v2 v2.11.1
github.com/mailru/easyjson v0.7.7
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
Expand Down Expand Up @@ -215,6 +214,7 @@ require (
github.com/joomcode/errorx v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/asmfmt v1.3.2 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand Down
18 changes: 16 additions & 2 deletions logservice/eventstore/pebble.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2025 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package eventstore

import (
Expand Down Expand Up @@ -47,7 +60,7 @@ func newPebbleOptions(dbNum int) *pebble.Options {
l.IndexBlockSize = 256 << 10 // 256KB index block
l.FilterPolicy = bloom.FilterPolicy(10)
l.FilterType = pebble.TableFilter
l.TargetFileSize = 32 << 20 // 32 MB
l.TargetFileSize = 64 << 20 // 64 MB
l.Compression = pebble.SnappyCompression
l.EnsureDefaults()
}
Expand All @@ -60,8 +73,9 @@ func newPebbleOptions(dbNum int) *pebble.Options {
func createPebbleDBs(rootDir string, dbNum int) []*pebble.DB {
cache := pebble.NewCache(cacheSize)
tableCache := pebble.NewTableCache(cache, dbNum, int(cache.MaxSize()))
defer tableCache.Unref()
dbs := make([]*pebble.DB, dbNum)
for i := 0; i < dbCount; i++ {
for i := 0; i < dbNum; i++ {
opts := newPebbleOptions(dbNum)
opts.Cache = cache
opts.TableCache = tableCache
Expand Down
13 changes: 13 additions & 0 deletions logservice/eventstore/pebble_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
// Copyright 2025 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package eventstore

import (
Expand Down

0 comments on commit 2febea6

Please sign in to comment.