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 8ded095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/zhang201702/goleveldb
module github.com/syndtr/goleveldb

go 1.14

Expand Down
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 8ded095

Please sign in to comment.