From c001e158cd24c59250cb0397587b676775f97007 Mon Sep 17 00:00:00 2001 From: hailin0 Date: Wed, 19 Jul 2023 17:06:16 +0800 Subject: [PATCH] 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 dc7ab55bc..c364de207 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 b332d2f38..08765a5d1 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 d1af0adb8..924f53f63 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 {