You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2024/07/17 04:57:55 UTC
(skywalking-banyandb) branch patch-seg-ref created (now aa2a7e08)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch patch-seg-ref
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
at aa2a7e08 Increase Seg Ref Count Wrongly
This branch includes the following new commits:
new aa2a7e08 Increase Seg Ref Count Wrongly
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(skywalking-banyandb) 01/01: Increase Seg Ref Count Wrongly
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch patch-seg-ref
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit aa2a7e080f9e0765eb5d756e46d77ab8478d32a3
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Jul 17 12:57:03 2024 +0800
Increase Seg Ref Count Wrongly
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
CHANGES.md | 1 +
banyand/internal/storage/segment.go | 1 -
banyand/measure/tstable.go | 4 ++--
banyand/stream/tstable.go | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 8ab401c5..d3362043 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -28,6 +28,7 @@ Release Notes.
- Fix memory leak in sorting the stream by the inverted index.
- Fix the wrong array flags parsing in command line. The array flags should be parsed by "StringSlice" instead of "StringArray".
- Fix a bug that the Stream module didn't support duplicated in index-based filtering and sorting
+- Fix the bug that segment's reference count is increased twice when the controller try to create an existing segment.
## 0.6.1
diff --git a/banyand/internal/storage/segment.go b/banyand/internal/storage/segment.go
index 507846d6..8138244d 100644
--- a/banyand/internal/storage/segment.go
+++ b/banyand/internal/storage/segment.go
@@ -244,7 +244,6 @@ func (sc *segmentController[T, O]) create(start time.Time) (*segment[T], error)
for i := range sc.lst {
s := sc.lst[last-i]
if s.Contains(start.UnixNano()) {
- s.incRef()
return s, nil
}
}
diff --git a/banyand/measure/tstable.go b/banyand/measure/tstable.go
index e65aef6e..d2a20b4a 100644
--- a/banyand/measure/tstable.go
+++ b/banyand/measure/tstable.go
@@ -235,8 +235,8 @@ func (tst *tsTable) Close() error {
tst.loopCloser.Done()
tst.loopCloser.CloseThenWait()
}
- tst.RLock()
- defer tst.RUnlock()
+ tst.Lock()
+ defer tst.Unlock()
if tst.snapshot == nil {
return nil
}
diff --git a/banyand/stream/tstable.go b/banyand/stream/tstable.go
index 6fbad53a..dff93b39 100644
--- a/banyand/stream/tstable.go
+++ b/banyand/stream/tstable.go
@@ -248,8 +248,8 @@ func (tst *tsTable) Close() error {
tst.loopCloser.Done()
tst.loopCloser.CloseThenWait()
}
- tst.RLock()
- defer tst.RUnlock()
+ tst.Lock()
+ defer tst.Unlock()
if tst.snapshot == nil {
return tst.index.Close()
}