mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 06:30:07 +08:00
Merge pull request #1735 from qieqieplus/rocksdb
ignore decode error for non-entry data
This commit is contained in:
commit
95ecf0c72f
@ -23,17 +23,16 @@ func NewTTLFilter() gorocksdb.CompactionFilter {
|
|||||||
func (t *TTLFilter) Filter(level int, key, val []byte) (remove bool, newVal []byte) {
|
func (t *TTLFilter) Filter(level int, key, val []byte) (remove bool, newVal []byte) {
|
||||||
// decode could be slow, causing write stall
|
// decode could be slow, causing write stall
|
||||||
// level >0 sst can run compaction in parallel
|
// level >0 sst can run compaction in parallel
|
||||||
if t.skipLevel0 && level == 0 {
|
if !t.skipLevel0 || level > 0 {
|
||||||
return false, val
|
entry := filer.Entry{}
|
||||||
}
|
if err := entry.DecodeAttributesAndChunks(val); err == nil {
|
||||||
entry := filer.Entry{}
|
if entry.TtlSec > 0 &&
|
||||||
if err := entry.DecodeAttributesAndChunks(val); err == nil {
|
entry.Crtime.Add(time.Duration(entry.TtlSec)*time.Second).Before(time.Now()) {
|
||||||
if entry.TtlSec == 0 ||
|
return true, nil
|
||||||
entry.Crtime.Add(time.Duration(entry.TtlSec)*time.Second).After(time.Now()) {
|
}
|
||||||
return false, val
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true, nil
|
return false, val
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TTLFilter) Name() string {
|
func (t *TTLFilter) Name() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user