Skip to content

Commit

Permalink
Merge branch 'rocksdb-log-size-fix' into release-3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lni committed Sep 7, 2019
2 parents cb7543d + bf49d3c commit 988668b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/logdb/kv/rocksdb/kv_rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
logDBLRUCacheSize = int(settings.Soft.RDBLRUCacheSize)
maxBackgroundCompactions = int(settings.Soft.RDBMaxBackgroundCompactions)
maxBackgroundFlushes = int(settings.Soft.RDBMaxBackgroundFlushes)
keepLogFileNum = int(settings.Soft.RDBKeepLogFileNum)
)

// NewKVStore returns a RocksDB based IKVStore instance.
Expand Down Expand Up @@ -73,6 +74,8 @@ func getRocksDBOptions(directory string,
}
opts := gorocksdb.NewDefaultOptions()
opts.SetMaxManifestFileSize(1024 * 1024 * 128)
opts.SetMaxLogFileSize(1024 * 1024 * 128)
opts.SetKeepLogFileNum(keepLogFileNum)
opts.SetBlockBasedTableFactory(bbto)
opts.SetCreateIfMissing(true)
opts.SetUseFsync(true)
Expand Down
4 changes: 3 additions & 1 deletion internal/settings/soft.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ type soft struct {
//
// LogDB
//

// RDBKeepLogFileNum defines how many log files to keep.
RDBKeepLogFileNum uint64
// RDBMaxBackgroundCompactions is the MaxBackgroundCompactions parameter
// directly passed to rocksdb.
RDBMaxBackgroundCompactions uint64
Expand Down Expand Up @@ -260,5 +261,6 @@ func getDefaultSoftSettings() soft {
RDBMaxBackgroundCompactions: 2,
RDBMaxBackgroundFlushes: 2,
RDBLRUCacheSize: 0,
RDBKeepLogFileNum: 16,
}
}

0 comments on commit 988668b

Please sign in to comment.