[RCA] Collect a bounded native-log incident window

未关闭
#14,223 7 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@UchihaIthachi 已经在做这个了。

开始于 2026年11月18日。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, java

调研方向

Start with bydbctl/internal/cmd/root.go and stream.go, then inspect the native-log E2E fixtures and the ordinary stream query API. Build the proposed bydbctl rca collect --source=native-log operation around the stated bounds, local workspace manifest, and refusal cases; add hand-authored fixture tests before implementation. Done means the real CLI scenarios meet the acceptance criteria, including truthful partial status, interruption cleanup, and no server writes.

由索引模型根据 Issue 内容生成。

描述

database enhancement logging

Umbrella: #14222

Summary

Collect a bounded native-log incident window. Deliver one usable operation, not a framework-only foundation.

Boundary

Proposed activation caller: bydbctl rca collect --source=native-log. Command names are proposed, not existing APIs.
Reporter collection runs with read-only source access; offline steps use local files only.
No source storage/wire-format changes are requested. The incident format is separately versioned.

Requirements

R1. Reuse the ordinary stream query API for _monitoring_log/log; require UTC start/end, selected nodes, levels, output path, byte budget and deadline. Do not enable logging or modify a cluster.
R2. Persist a private local workspace with schema version, collection interval, source status, hashes and tool build information. Decode searchable tags and binary JSON data.fields without dropping unknown fields; preserve source log_id.
R3. Query one bounded time/node/level selection and filter module/message locally. No adaptive time subdivision or automatic pagination. Mark coverage partial or unknown when scan limits prevent proving completeness, including timestamp ties.
R4. Bound per-query rows, cumulative bytes and elapsed time; no automatic retries in this first slice; record missing schema, unreachable nodes, truncation separately from an empty successful query. Verify retrieved rows rather than trusting producer written counters.

Acceptance criteria

  • A hand-authored three-row fixture includes two rows with the same timestamp, a nested secret in data.fields, and a module predicate whose server-side limit would hide a match. For an unsaturated fixture assert exact IDs and decoded fields; for a saturated fixture require an explicit partial/unknown status, never complete.
  • Invoke the real CLI against the native-log E2E deployment, then with an absent schema and an unavailable endpoint. Assert no server writes/config changes, bounded termination, private files, and a truthful manifest.
  • Interrupt a collection: no complete marker may be left. Existing stream query commands remain unchanged.
  • Use hand-authored or independently captured fixtures with documented provenance; do not generate expected values using the code under test.
  • Add focused behavioral tests before implementation and record the actual RED command/failure, then GREEN results.
  • Keep existing CLI/API behavior compatible. Never overwrite unrelated user files; output conflicts must be refused.

Scope and readiness audit

  • Boundary and behavior: the single operation above; independently observable output and refusal behavior.
  • Production activation: the named CLI or skill entry point above, included in the same PR.
  • Packages/callers: bydbctl/internal/cmd/root.go and stream.go; new internal RCA collector package; existing native-log E2E fixtures.
  • Dependencies: None. See the dependency contract below for the exact shared interfaces and runtime independence.
  • Classification: initial leaf candidate, NOT automation-ready until contract/RED audit.
  • RED evidence: not executed during this planning task; no claim of passing or failing implementation tests.
  • End-to-end proof: the real command/skill scenarios above, not source-text assertions.
  • Formats/lifecycle/fixtures: private workspace or public archive only; artifact-specific fixture family above.
  • Focused tests: CLI leaves should add TestRCA… coverage under bydbctl/internal/cmd and/or the introduced collector package;
    run go test ./bydbctl/internal/cmd -run TestRCA -count=1 plus the new package tests. Skill leaves must add a replayable evaluation harness
    with an exact command documented in the PR. Final test names/paths are fixed when the prerequisite seam merges.
  • Resource/concurrency checks: cancellation, bounded reads/output and cleanup on failure; use repository panic-aware goroutine wrappers if concurrency is introduced.
  • Decision: one proposed PR. If the named behavior requires an unimplemented server API or another lifecycle change, stop and split that prerequisite.

Required-only scope audit

Bounded export is required; exhaustive historical recovery is not.

Removed/deferred: Adaptive window splitting, automatic pagination, additional drop-metric endpoint collection, configurable retry engines and automatic resume.

Out of scope

Query-trace storage, schema changes, native receiver bug fixes, redaction, public archives, Kubernetes installation.

Concrete verification and closure gate

These are required acceptance tests, not examples that may be skipped. Artifact filenames and unsupported format handling must follow the merged prerequisite contracts. Before queueing, fix the tested schema version, configured limits, observable statuses and independent expected values; record any necessary interface decision in this issue rather than leaving it to an agent mid-run.

Fixed acceptance scenario

Use three independently authored native-log rows with IDs L1/L2/L3 inside [10:00, 10:05) UTC and a fourth outside. L2/L3 share a timestamp; one contains a nested data.fields value. With adequate limits, assert exactly L1/L2/L3 and the expected decoded values. With a two-row scan cap, assert partial/unknown coverage, never complete. Exercise absent schema, an unreachable endpoint and cancellation; no completed manifest marker or cluster mutation is allowed.

Executable regression

Proposed named regression: TestRCANativeLogCollect in bydbctl/internal/cmd exercising the registered command through an existing CLI test seam.
After normal repository generation, use:

go test ./bydbctl/internal/cmd -run '^TestRCANativeLogCollect$' -count=1 -v
make test-ci PKG=./bydbctl/internal/cmd

The exact selector must execute at least one test, not return “no tests to run.” If repository conventions require a different test harness or location, update this section with the real command before queueing; do not claim this proposed test already exists. Also run the actual changed internal package suites.

For GraphLoom, apply only the regression tests/fixtures to the chosen base: they must compile and fail by a relevant assertion. Apply the implementation: the same test must pass. Tests that import a new production package missing from the base are not valid assertion-based RED proof; use an existing command seam. Exercise the real CLI with fixture endpoints/files. If the issue requires deployment E2E, record its separate command and result; fixture-server tests alone do not satisfy it.

Evidence required to close this issue
  • Source/base revision, exact commands, fixture provenance and independently specified expected outcomes.
  • Actual positive and negative/partial-case results; explain failures and rerun after fixes.
  • Produced artifact/manifest/report samples with no real sensitive data, and the relevant size/coverage/privacy assertions.
  • Applicable repository checks and integration/evaluation results; explicitly list checks not run. A required check not run leaves acceptance incomplete, not passed.
  • For failures/cancellation, confirm no false completion marker and no unrelated user-file overwrite.

No verification execution is claimed by adding this section. Do not close the issue merely because code or documentation was submitted.

Dependency contract: implementation order versus runtime inputs

Implementation prerequisites mean merged interfaces needed to implement/test this issue. They do not mean that those evidence collectors must run or succeed for every incident.

No unmerged RCA issue prerequisite. Existing native-log storage is already implemented.

Runtime behavior and verification

This issue delivers the first usable native-log collector together with minimal shared RCA plumbing in the same PR; it is not a standalone framework project. Keep CLI registration, workspace/manifest, artifact writing and source statuses independent of the native-log adapter. Register artifact format/source identity explicitly so later collectors do not need a native-log schema, endpoint or record to create a valid workspace.

Add a source-neutral workspace/manifest test with no native-log artifact. The existing native-log CLI remains the production activation for this PR. Do not implement future collectors here.

Wait for prerequisite contracts to merge before queueing automated implementation, then revalidate the real interfaces. Do not add direct blockers for dependencies already covered transitively. No new issue or automation job is introduced by this clarification.

主要语言
Java
星标
25k
派生
6.6k
平均合并
10 小时 45 分钟
30 天内合并 PR
49

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/skywalking 的其他 Issue

查看 apache/skywalking 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。