hanahmily opened a new pull request, #1215:
URL: https://github.com/apache/skywalking-banyandb/pull/1215

   ## What
   
   A trace-pipeline sampler operates on a single trace schema per group. This 
PR adds registration-time validation, in the property schema registry 
(`banyand/metadata/schema/property/client.go`), that enforces the plugin ⟺ 
single-trace invariant in **both directions**:
   
   - **Trace side** (`CreateTrace` / `UpdateTrace`): reject introducing a 
second, differently-named trace into a group whose pipeline is enabled with a 
sampler plugin. The trace being updated is excluded by name, so updating the 
sole trace is allowed.
   - **Group side** (`CreateGroup` / `UpdateGroup`): reject enabling a sampler 
pipeline on a group that already holds more than one trace.
   
   ## When it triggers
   
   Only when the group's `TracePipelineConfig` is `enabled` **and** declares at 
least one sampler plugin. Disabled pipelines and pipelines without a sampler 
are unaffected. Rejections return `codes.FailedPrecondition`, consistent with 
the neighboring tombstone invariant.
   
   ## Scope
   
   Registration-time only — the check lives in the single registry write path 
(`GroupRegistryService` / property store writes flow through here). There is no 
reconcile-side defense; the narrow TOCTOU window (two concurrent trace creates 
racing the group read) is accepted, matching how the existing group validations 
behave.
   
   ## Tests
   
   - 7 new unit tests in `pipeline_single_trace_test.go` covering both 
directions, self-update-allowed, disabled-pipeline-not-triggered, 
no-pipeline-allowed, and group-with-pipeline-but-no-traces-allowed.
   - Full `banyand/metadata/schema/property` suite passes; `gofmt` / `go vet` / 
`golangci-lint` clean.
   
   Part of apache/skywalking#13634


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to