Skip to content

Commit

Permalink
Revert "leveldb: fix table file leaks when manifest is rotated (syndt…
Browse files Browse the repository at this point in the history
…r#409)"

This reverts commit 126854a.
  • Loading branch information
zhang201702 committed Jun 20, 2023
1 parent 63e8a13 commit 76f9b00
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions leveldb/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,9 @@ func (s *session) commit(r *sessionRecord, trivial bool) (err error) {
}
}()

if s.manifest == nil {
if s.manifest == nil || s.manifest.Size() >= s.o.GetMaxManifestFileSize() {
// manifest journal writer not yet created, create one
err = s.newManifest(r, nv)
} else if s.manifest.Size() >= s.o.GetMaxManifestFileSize() {
// pass nil sessionRecord to avoid over-reference table file
err = s.newManifest(nil, nv)
} else {
err = s.flushManifest(r)
}
Expand Down

0 comments on commit 76f9b00

Please sign in to comment.