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 2023/07/19 09:06:22 UTC
[skywalking-banyandb] branch main updated: Fix data duplicate writing (#304)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
The following commit(s) were added to refs/heads/main by this push:
new c001e158 Fix data duplicate writing (#304)
c001e158 is described below
commit c001e158cd24c59250cb0397587b676775f97007
Author: hailin0 <wa...@apache.org>
AuthorDate: Wed Jul 19 17:06:16 2023 +0800
Fix data duplicate writing (#304)
---
CHANGES.md | 1 +
banyand/measure/tstable.go | 1 +
banyand/stream/tstable.go | 1 +
3 files changed, 3 insertions(+)
diff --git a/CHANGES.md b/CHANGES.md
index dc7ab55b..c364de20 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -16,6 +16,7 @@ Release Notes.
- BanyanDB ui type error
- Fix timer not released
- BanyanDB ui misses fields when creating a group
+- Fix data duplicate writing
### Chores
diff --git a/banyand/measure/tstable.go b/banyand/measure/tstable.go
index b332d2f3..08765a5d 100644
--- a/banyand/measure/tstable.go
+++ b/banyand/measure/tstable.go
@@ -154,6 +154,7 @@ func (t *tsTable) Get(key []byte, ts time.Time) ([]byte, error) {
func (t *tsTable) Put(key []byte, val []byte, ts time.Time) error {
if t.encoderBuffer != nil {
t.writeToBuffer(key, val, ts)
+ return nil
}
if err := t.openBuffer(); err != nil {
return err
diff --git a/banyand/stream/tstable.go b/banyand/stream/tstable.go
index d1af0adb..924f53f6 100644
--- a/banyand/stream/tstable.go
+++ b/banyand/stream/tstable.go
@@ -114,6 +114,7 @@ func (t *tsTable) Get(key []byte, ts time.Time) ([]byte, error) {
func (t *tsTable) Put(key []byte, val []byte, ts time.Time) error {
if t.buffer != nil {
t.buffer.Write(key, val, ts)
+ return nil
}
if err := t.openBuffer(); err != nil {