Skip to content

Commit

Permalink
update wal
Browse files Browse the repository at this point in the history
  • Loading branch information
roseduan committed Jun 14, 2024
1 parent e51d6dc commit f467ee6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func (db *DB) openWalFiles() (*wal.WAL, error) {
DirPath: db.options.DirPath,
SegmentSize: db.options.SegmentSize,
SegmentFileExt: dataFileNameSuffix,
BlockCache: db.options.BlockCache,
Sync: db.options.Sync,
BytesPerSync: db.options.BytesPerSync,
})
Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
module github.com/rosedblabs/rosedb/v2

go 1.19
go 1.21

require (
github.com/google/btree v1.1.2
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020
github.com/rosedblabs/wal v1.3.7
github.com/valyala/bytebufferpool v1.0.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/robfig/cron/v3 v3.0.0 // indirect
golang.org/x/sys v0.11.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -21,6 +20,6 @@ require (
require (
github.com/bwmarrin/snowflake v0.3.0
github.com/gofrs/flock v0.8.1
github.com/hashicorp/golang-lru/v2 v2.0.4 // indirect
github.com/stretchr/testify v1.8.4
github.com/robfig/cron/v3 v3.0.0
github.com/stretchr/testify v1.9.0
)
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/hashicorp/golang-lru/v2 v2.0.4 h1:7GHuZcgid37q8o5i3QI9KMT4nCWQQ3Kx3Ov6bb9MfK0=
github.com/hashicorp/golang-lru/v2 v2.0.4/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand All @@ -19,10 +17,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020 h1:EA8XGCVg1FDM6Dh4MP4sTsmH3gvjhRtp/N+lbnBwtJE=
github.com/rosedblabs/wal v1.3.6-0.20230924022528-3202245af020/go.mod h1:wdq54KJUyVTOv1uddMc6Cdh2d/YCIo8yjcwJAb1RCEM=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/rosedblabs/wal v1.3.7 h1:ZB/xczf+/fEwbjbPnC/A6DLZRx0rxKgtQsWw2+SxKDg=
github.com/rosedblabs/wal v1.3.7/go.mod h1:DFvhrmTTeiXvn2btXXT2MW9Nvu99PU0g/pKGgh0+T+o=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
Expand Down
3 changes: 0 additions & 3 deletions merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func (db *DB) openMergeDB() (*DB, error) {
SegmentFileExt: hintFileNameSuffix,
Sync: false,
BytesPerSync: 0,
BlockCache: 0,
})
if err != nil {
return nil, err
Expand All @@ -218,7 +217,6 @@ func (db *DB) openMergeFinishedFile() (*wal.WAL, error) {
SegmentFileExt: mergeFinNameSuffix,
Sync: false,
BytesPerSync: 0,
BlockCache: 0,
})
}

Expand Down Expand Up @@ -327,7 +325,6 @@ func (db *DB) loadIndexFromHintFile() error {
// we don't need to rotate the hint file, just write all data to the same file.
SegmentSize: math.MaxInt64,
SegmentFileExt: hintFileNameSuffix,
BlockCache: 32 * KB * 10,
})
if err != nil {
return err
Expand Down
6 changes: 0 additions & 6 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ type Options struct {
// SegmentSize specifies the maximum size of each segment file in bytes.
SegmentSize int64

// BlockCache specifies the size of the block cache in number of bytes.
// A block cache is used to store recently accessed data blocks, improving read performance.
// If BlockCache is set to 0, no block cache will be used.
BlockCache uint32

// Sync is whether to synchronize writes through os buffer cache and down onto the actual disk.
// Setting sync is required for durability of a single write operation, but also results in slower writes.
//
Expand Down Expand Up @@ -62,7 +57,6 @@ const (
var DefaultOptions = Options{
DirPath: tempDBDir(),
SegmentSize: 1 * GB,
BlockCache: 0,
Sync: false,
BytesPerSync: 0,
WatchQueueSize: 0,
Expand Down

0 comments on commit f467ee6

Please sign in to comment.