[BanyanDB] Store trace binary tags only in core storage, not in secondary index (sidx)

オープン
#14,282 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@hanahmily がすでに取り組んでいます。

2026年11月30日 から。

  • #1508 @hanahmily による — オープン

評価

この issue はまだ評価されていません。

説明

enhancement
Search before asking
  • I had searched in the issues and found no similar feature requirement.
Description

Trace binary tags (TAG_TYPE_DATA_BINARY) are currently written into every secondary index (sidx) of a trace, in addition to the trace core storage. This copy is useless and expensive:

  • Not filterable: parseExpr (pkg/query/logical/tag_filter.go) has no binary literal, so any condition on a binary tag fails at planning time.
  • Never read back from sidx: sidxResponseToVectorizedBatch only consumes Keys/Data/SIDs/PartIDs; projected tag values are always materialized from core blocks (findBlockTag).
  • Costly: binary tags are typically the largest values. They are duplicated once per index rule, rewritten on every sidx merge, and — because the full tag projection is forwarded to sidx (prepareSIDXStreaming) — even re-read from sidx at query time when projected.
Proposal

Keep binary tags only in the trace core storage.

  1. Write path — buildSidxTags (banyand/trace/write_standalone.go) skips tags whose valueType == pbv1.ValueTypeBinaryData. Single call site; covers standalone and liaison.
  2. Query path — in prepareSIDXStreaming (banyand/trace/query.go), strip binary-typed tags from the sidx TagProjection (or narrow it to tags referenced by the TagFilter), so sidx never loads binary columns, including from legacy parts.
  3. Planner — reject conditions on TAG_TYPE_DATA_BINARY tags with an explicit "binary tags cannot be filtered" error. This also covers binTag = null, which would otherwise change semantics once the column is gone from sidx.
Compatibility
  • Existing sidx parts that contain binary columns stay readable; sidx already tolerates tags absent from some blocks. Old columns disappear naturally as merges rewrite parts — no migration.
  • Mixed-version clusters are safe: the sidx mem part is built where the write is handled; no wire format change.
  • Query results are unchanged, since binary values are already served from core storage.
Tests
  • Unit: buildSidxTags drops binary tags.
  • Write + query: binary tag absent from sidx mem parts, still returned via projection from core.
  • sidx TagProjection contains no binary tags.
  • Planner rejects conditions (including = null) on binary tags.
  • Merge of an old-format sidx part (with binary column) and a new one.
Use case

Reduce disk usage, write/merge amplification, and query I/O for traces that carry large binary tags.

Related issues

No response

Are you willing to submit a pull request to implement this on your own?
  • Yes I am willing to submit a pull request on my own!
Code of Conduct
主要言語
Java
スター
25k
フォーク
6.6k
平均マージ
10時間 45分
マージ済み PR(30日)
49

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/skywalking のほかの issue

apache/skywalking の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。