[BanyanDB] Store trace binary tags only in core storage, not in secondary index (sidx)
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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:
sidxResponseToVectorizedBatchonly consumesKeys/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.
- Write path —
buildSidxTags(banyand/trace/write_standalone.go) skips tags whosevalueType == pbv1.ValueTypeBinaryData. Single call site; covers standalone and liaison. - Query path — in
prepareSIDXStreaming(banyand/trace/query.go), strip binary-typed tags from the sidxTagProjection(or narrow it to tags referenced by theTagFilter), so sidx never loads binary columns, including from legacy parts. - Planner — reject conditions on
TAG_TYPE_DATA_BINARYtags with an explicit "binary tags cannot be filtered" error. This also coversbinTag = 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:
buildSidxTagsdrops binary tags. - Write + query: binary tag absent from sidx mem parts, still returned via projection from core.
- sidx
TagProjectioncontains 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
- I agree to follow this project's Code of Conduct
- 主要语言
- Java
- 星标
- 25k
- 派生
- 6.6k
- 平均合并
- 10 小时 45 分钟
- 30 天内合并 PR
- 49
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/skywalking 的其他 Issue
-
[Bug] [BanyanDB] timestamp.ParseDuration silently drops everything after "d"可能已有人在做 @soujasK 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
apache/skywalking#14287 ·
维护者通常 1 天内回复
-
[BanyanDB] Let trace queries exclude the raw span from results可能已有人在做 @hanahmily 今天认领。 未关闭enhancement
apache/skywalking#14288 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[BanyanDB] Data race and nil-pointer panic: measure write during standalone shutdown after segment close可能已有人在做 @hanahmily 今天认领。 未关闭bug
apache/skywalking#14285 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
apache/skywalking#14283 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug] BanyanDB stream query on a hot entity scans all its rows despite a small limit可能已有人在做 @hanahmily 于 8 天前认领。 未关闭bug
apache/skywalking#14261 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 apache/skywalking 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
testng-team/testng#3672 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 78/100
eclipse-edc/IdentityHub#1296 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
cloudfoundry/uaa#4194 ·
维护者通常 1 天内回复
-
area: ui priority: medium
难度 2/5 1-3 小时 新手友好度 83/100
tetsuji16/microProject#1721 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复