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
The following commit(s) were added to refs/heads/bug/sidx-check by this push:
new 8b957c18 Enhance debug logging in sidx merge and flush operations to
track discrepancies in part counts.
8b957c18 is described below
commit 8b957c18ee8341dcc16a8ffb895e4aad77e2e4f2
Author: Hongtao Gao <[email protected]>
AuthorDate: Tue Jan 20 12:06:11 2026 +0800
Enhance debug logging in sidx merge and flush operations to track
discrepancies in part counts.
---
banyand/internal/sidx/merge.go | 8 ++++++++
banyand/internal/sidx/sidx.go | 8 ++++++++
test/e2e-v2/script/docker-compose/base-compose.yml | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/banyand/internal/sidx/merge.go b/banyand/internal/sidx/merge.go
index f5e3bfea..d5b64f14 100644
--- a/banyand/internal/sidx/merge.go
+++ b/banyand/internal/sidx/merge.go
@@ -45,6 +45,14 @@ func (s *sidx) Merge(closeCh <-chan struct{}, partIDtoMerge
map[uint64]struct{},
partsToMerge = append(partsToMerge, pw)
}
}
+ if d := s.l.Debug(); d.Enabled() {
+ if len(partsToMerge) != len(partIDtoMerge) {
+ d.Int("parts_to_merge_count", len(partsToMerge)).
+ Int("part_ids_to_merge_count",
len(partIDtoMerge)).
+ Str("root", s.root).
+ Msg("parts to merge count does not match part
ids to merge count")
+ }
+ }
// Create new merged part
newPart, err := s.mergeParts(s.fileSystem, closeCh, partsToMerge,
newPartID, s.root)
diff --git a/banyand/internal/sidx/sidx.go b/banyand/internal/sidx/sidx.go
index a059e8b7..18149770 100644
--- a/banyand/internal/sidx/sidx.go
+++ b/banyand/internal/sidx/sidx.go
@@ -157,6 +157,14 @@ 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) {
+ if d := s.l.Debug(); d.Enabled() {
+ d.Int("flushed_count", len(flushIntro.flushed)).
+ Str("root", s.root).
+ Int("part_ids_to_flush_count",
len(partIDsToFlush)).
+ Msg("part ids to flush count does not match
flushed count")
+ }
+ }
return flushIntro, nil
}
diff --git a/test/e2e-v2/script/docker-compose/base-compose.yml
b/test/e2e-v2/script/docker-compose/base-compose.yml
index 38fbc623..5b896a91 100644
--- a/test/e2e-v2/script/docker-compose/base-compose.yml
+++ b/test/e2e-v2/script/docker-compose/base-compose.yml
@@ -56,7 +56,7 @@ services:
file: ../../../docker/base-compose.yml
service: oap
environment:
- SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS: "0.9,0.10"
+ SW_STORAGE_BANYANDB_COMPATIBLE_SERVER_API_VERSIONS: "0.10"
networks:
- e2e
volumes: