Skip to content

Commit f467ee6

Browse files
committed
update wal
1 parent e51d6dc commit f467ee6

File tree

5 files changed

+8
-21
lines changed

5 files changed

+8
-21
lines changed

db.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func (db *DB) openWalFiles() (*wal.WAL, error) {
157157
DirPath: db.options.DirPath,
158158
SegmentSize: db.options.SegmentSize,
159159
SegmentFileExt: dataFileNameSuffix,
160-
BlockCache: db.options.BlockCache,
161160
Sync: db.options.Sync,
162161
BytesPerSync: db.options.BytesPerSync,
163162
})

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
module github.com/rosedblabs/rosedb/v2
22

3-
go 1.19
3+
go 1.21
44

55
require (
66
github.com/google/btree v1.1.2
7-
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020
7+
github.com/rosedblabs/wal v1.3.7
88
github.com/valyala/bytebufferpool v1.0.0
99
)
1010

1111
require (
1212
github.com/davecgh/go-spew v1.1.1 // indirect
1313
github.com/kr/text v0.2.0 // indirect
1414
github.com/pmezard/go-difflib v1.0.0 // indirect
15-
github.com/robfig/cron/v3 v3.0.0 // indirect
1615
golang.org/x/sys v0.11.0 // indirect
1716
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
1817
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -21,6 +20,6 @@ require (
2120
require (
2221
github.com/bwmarrin/snowflake v0.3.0
2322
github.com/gofrs/flock v0.8.1
24-
github.com/hashicorp/golang-lru/v2 v2.0.4 // indirect
25-
github.com/stretchr/testify v1.8.4
23+
github.com/robfig/cron/v3 v3.0.0
24+
github.com/stretchr/testify v1.9.0
2625
)

go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
77
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
88
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
99
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
10-
github.com/hashicorp/golang-lru/v2 v2.0.4 h1:7GHuZcgid37q8o5i3QI9KMT4nCWQQ3Kx3Ov6bb9MfK0=
11-
github.com/hashicorp/golang-lru/v2 v2.0.4/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
1210
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
1311
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
1412
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -19,10 +17,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
1917
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2018
github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
2119
github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
22-
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020 h1:EA8XGCVg1FDM6Dh4MP4sTsmH3gvjhRtp/N+lbnBwtJE=
23-
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020/go.mod h1:wdq54KJUyVTOv1uddMc6Cdh2d/YCIo8yjcwJAb1RCEM=
24-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
25-
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
20+
github.com/rosedblabs/wal v1.3.7 h1:ZB/xczf+/fEwbjbPnC/A6DLZRx0rxKgtQsWw2+SxKDg=
21+
github.com/rosedblabs/wal v1.3.7/go.mod h1:DFvhrmTTeiXvn2btXXT2MW9Nvu99PU0g/pKGgh0+T+o=
22+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
23+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
2624
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
2725
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
2826
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=

merge.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ func (db *DB) openMergeDB() (*DB, error) {
196196
SegmentFileExt: hintFileNameSuffix,
197197
Sync: false,
198198
BytesPerSync: 0,
199-
BlockCache: 0,
200199
})
201200
if err != nil {
202201
return nil, err
@@ -218,7 +217,6 @@ func (db *DB) openMergeFinishedFile() (*wal.WAL, error) {
218217
SegmentFileExt: mergeFinNameSuffix,
219218
Sync: false,
220219
BytesPerSync: 0,
221-
BlockCache: 0,
222220
})
223221
}
224222

@@ -327,7 +325,6 @@ func (db *DB) loadIndexFromHintFile() error {
327325
// we don't need to rotate the hint file, just write all data to the same file.
328326
SegmentSize: math.MaxInt64,
329327
SegmentFileExt: hintFileNameSuffix,
330-
BlockCache: 32 * KB * 10,
331328
})
332329
if err != nil {
333330
return err

options.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ type Options struct {
1010
// SegmentSize specifies the maximum size of each segment file in bytes.
1111
SegmentSize int64
1212

13-
// BlockCache specifies the size of the block cache in number of bytes.
14-
// A block cache is used to store recently accessed data blocks, improving read performance.
15-
// If BlockCache is set to 0, no block cache will be used.
16-
BlockCache uint32
17-
1813
// Sync is whether to synchronize writes through os buffer cache and down onto the actual disk.
1914
// Setting sync is required for durability of a single write operation, but also results in slower writes.
2015
//
@@ -62,7 +57,6 @@ const (
6257
var DefaultOptions = Options{
6358
DirPath: tempDBDir(),
6459
SegmentSize: 1 * GB,
65-
BlockCache: 0,
6660
Sync: false,
6761
BytesPerSync: 0,
6862
WatchQueueSize: 0,

0 commit comments

Comments
 (0)