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 2026/01/20 03:48:37 UTC

(skywalking-banyandb) branch bug/sidx-check created (now 8d94e4a1)

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a change to branch bug/sidx-check
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


      at 8d94e4a1 Update version to 0.10 and fix panic in sidx merge and flush operations.

This branch includes the following new commits:

     new 8d94e4a1 Update version to 0.10 and fix panic in sidx merge and flush operations.

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: Update version to 0.10 and fix panic in sidx merge and flush operations.

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch bug/sidx-check
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git

commit 8d94e4a1b3f9b814097b22078abb7308587fb271
Author: Hongtao Gao <ha...@gmail.com>
AuthorDate: Tue Jan 20 11:48:14 2026 +0800

    Update version to 0.10 and fix panic in sidx merge and flush operations.
---
 CHANGES.md                     | 1 +
 api/proto/banyandb/version.go  | 2 +-
 banyand/internal/sidx/merge.go | 5 -----
 banyand/internal/sidx/sidx.go  | 9 ++++-----
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index 3e70e8d2..2232be11 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -29,6 +29,7 @@ Release Notes.
 - Fix duplicate elements in stream query results by implementing element ID-based deduplication across scan, merge, and result building stages.
 - Fix data written to the wrong shard and related stream queries.
 - Fix the lifecycle panic when the trace has no sidx.
+- Fix panic in sidx merge and flush operations when part counts don't match expectations.
 
 ### Document
 
diff --git a/api/proto/banyandb/version.go b/api/proto/banyandb/version.go
index 2a4b305f..4ce532be 100644
--- a/api/proto/banyandb/version.go
+++ b/api/proto/banyandb/version.go
@@ -19,7 +19,7 @@
 package apiversion
 
 // Version is the version of the API.
-const Version = "0.9"
+const Version = "0.10"
 
 // Revision is the revision of the API. Building with -ldflags -X.
 var revision string
diff --git a/banyand/internal/sidx/merge.go b/banyand/internal/sidx/merge.go
index 41922f95..f5e3bfea 100644
--- a/banyand/internal/sidx/merge.go
+++ b/banyand/internal/sidx/merge.go
@@ -22,7 +22,6 @@ import (
 
 	"github.com/apache/skywalking-banyandb/pkg/encoding"
 	"github.com/apache/skywalking-banyandb/pkg/fs"
-	"github.com/apache/skywalking-banyandb/pkg/logger"
 )
 
 var (
@@ -47,10 +46,6 @@ func (s *sidx) Merge(closeCh <-chan struct{}, partIDtoMerge map[uint64]struct{},
 		}
 	}
 
-	if len(partsToMerge) != len(partIDtoMerge) {
-		logger.Panicf("not enough parts to merge: %d", len(partsToMerge))
-	}
-
 	// Create new merged part
 	newPart, err := s.mergeParts(s.fileSystem, closeCh, partsToMerge, newPartID, s.root)
 	if err != nil {
diff --git a/banyand/internal/sidx/sidx.go b/banyand/internal/sidx/sidx.go
index 197c1870..a059e8b7 100644
--- a/banyand/internal/sidx/sidx.go
+++ b/banyand/internal/sidx/sidx.go
@@ -131,6 +131,10 @@ func (s *sidx) Flush(partIDsToFlush map[uint64]struct{}) (*FlusherIntroduction,
 	}
 	defer snap.decRef()
 
+	if len(snap.parts) == 0 {
+		return nil, nil
+	}
+
 	// Create flush introduction
 	flushIntro := generateFlusherIntroduction()
 
@@ -153,11 +157,6 @@ func (s *sidx) Flush(partIDsToFlush map[uint64]struct{}) (*FlusherIntroduction,
 		newPW := newPartWrapper(nil, mustOpenPart(pw.ID(), partPath, s.fileSystem))
 		flushIntro.flushed[newPW.ID()] = newPW
 	}
-
-	if len(flushIntro.flushed) != len(partIDsToFlush) {
-		logger.Panicf("expected %d parts to flush, but got %d", len(partIDsToFlush), len(flushIntro.flushed))
-		return nil, nil
-	}
 	return flushIntro, nil
 }