wu-sheng opened a new pull request, #13883:
URL: https://github.com/apache/skywalking/pull/13883

   ### Runtime MAL/LAL rules can declare dynamic layers
   
   Runtime hot-update rules pushed through the runtime-rule admin API may now 
declare a `layerDefinitions:` block. Layers register through a new 
`Layer.registerDynamic` channel (post-seal allowed) and are refcount-tracked by 
`RuntimeLayerRegistry`: removing the last declaring rule unregisters the layer. 
Ordinals are operator-pinned in the `100_000+` tier — no auto-allocation; the 
ordinal is persisted in `ServiceTraffic` primary keys and must be 
operator-stable across restarts.
   
   Bundled and runtime are strictly separate ownership channels:
   - Runtime overrides of bundled rules cannot carry `layerDefinitions:` — REST 
rejects pre-persist with `applyStatus=layer_override_forbidden`.
   - Legacy override rows on disk-twins drop the static-loader substitution and 
apply post-seal via the dynamic channel so they remain operator-removable.
   - `RuleSetMerger` no longer injects resolver-only ACTIVE rows into the 
static loader; pure-runtime rules go through `RuleSync.runOnce` post-seal 
exclusively.
   
   Conflict validation surfaces structured HTTP 400 with the existing 
`{applyStatus, catalog, name, message}` envelope using new `applyStatus` codes: 
`layer_ordinal_out_of_range`, `layer_name_conflict`, `layer_ordinal_collision`, 
`layer_name_invalid`, `layer_override_forbidden`. The checker handles in-batch 
duplicates, self-update multi-claimant ordinal reuse, and bundled-vs-runtime 
cross-channel collisions.
   
   See 
[docs/en/concepts-and-designs/runtime-rule-hot-update.md#dynamic-layers](https://github.com/apache/skywalking/blob/feature/runtime-dynamic-layers/docs/en/concepts-and-designs/runtime-rule-hot-update.md#dynamic-layers)
 for the full contract — ordinal tiers, lifecycle, limitations, and conflict 
rules.
   
   - [x] If this is non-trivial feature, paste the links/URLs to the design doc.
         Design discussion in CLAUDE memory; user-facing docs in 
\`docs/en/concepts-and-designs/runtime-rule-hot-update.md#dynamic-layers\`.
   - [x] Update the documentation to include this new feature.
         \`docs/en/concepts-and-designs/runtime-rule-hot-update.md\` gets a new 
\"Dynamic layers\" section; 
\`oap-server/server-starter/src/main/resources/layer-extensions.yml\` header 
updated for the new tier convention; \`CLAUDE.md\` adds a Comments style note.
   - [x] Tests(including UT, IT, E2E) are added to verify the new feature.
         Unit: 121 runtime-rule + 25 server-core analysis + 188 LAL compiler 
tests, all green. New classes: \`LayerDynamicRegisterTest\` (12 tests), 
\`RuntimeLayerRegistryTest\` (19), \`DbOverrideRuntimeRuleResolverTest\` (5). 
E2E: \`runtime-rule-flow.sh\` extended with Phases 5e/5f/5g (three 
layer-rejection assertions through the HTTP envelope) plus Phase 5h 
(restart-survival: POST sibling rule, swctl layer ls shows, docker restart OAP, 
swctl still shows, /inactivate + /delete, swctl no longer shows). Local e2e 
against banyandb backend: \`SUMMARY: 1 passed, 0 failed\` × 2 back-to-back runs.
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace 
the issue number. Closes #<issue number>.
   - [x] Update the [\`CHANGES\` 
log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).


-- 
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