mikebridge opened a new pull request, #42760:
URL: https://github.com/apache/superset/pull/42760

   Title: `feat(semantic-layers): add safe containment result cache`
   
   ### SUMMARY
   
   Adds an experimental, default-off containment cache for semantic-layer 
results.
   Superset can reuse exact, projected, filtered, or additive-rollup results 
only when
   the provider explicitly delegates cache responsibility and declares 
compatible
   semantics. Identities include the semantic definition, provider material, and
   either a global declaration or typed request security context.
   
   The implementation replaces the original monolithic cache with separate 
identity,
   proof-policy, transformation, repository, coordination, host-adapter, and
   application-service boundaries. Descriptor mutation uses bounded Redis 
owner-token
   leases; expected cache failures fall back to the provider, while 
transformation or
   programming defects remain visible. Forced queries bypass reads but store 
successful
   fresh output under the canonical non-force identity. Responses and the chart 
cache
   pill distinguish semantic containment hits from ordinary result-cache hits.
   
   | Superseded PR | Contribution retained here |
   |---|---|
   | #40221 | Core containment proofs, transformation, result propagation, and 
UI indicator (Beto attribution retained) |
   | #41824 | Owner-safe descriptor mutation and concurrency regressions |
   | #41825 | `force_query` excluded from ordinary result identity |
   | #41826 | Successful forced refresh stored after read bypass |
   | #41856 | SQL NULL semantics and complete correctness coverage |
   
   Shortcut: SC-106828. The old PRs should remain open until this replacement is
   created and its supersession plan is explicitly approved.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   The existing cached pill remains visually unchanged. Its tooltip says 
“semantic
   query result” for containment hits and “query result” for ordinary cache 
hits.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest --cov=superset/semantic_layers/ --cov-branch --cov-fail-under=100 \
     tests/unit_tests/semantic_layers/ -q
   pytest -q tests/unit_tests/queries/query_object_test.py \
     tests/unit_tests/utils/test_cache_manager.py \
     tests/unit_tests/async_events/test_cache_backend.py \
     tests/unit_tests/config_test.py tests/unit_tests/initialization_test.py
   ```
   
   Run the focused CachedLabel and ChartPills Jest tests, frontend type 
checking,
   targeted Python/frontend pre-commit hooks, and `pre-commit run --all-files` 
as
   recorded in the linked verification artifact. The dedicated CI job also 
exercises
   pinned Redis and Sentinel services with expiry, stale-release, concurrent 
writer,
   prune/store, parity, descriptor-bound, and lock-free healthy-read assertions.
   
   Rollout requires both `SEMANTIC_LAYERS` and
   `SEMANTIC_LAYER_CONTAINMENT_CACHE`, plus supported distributed coordination.
   Canary one worker cohort after capturing latency/error/cache-health 
baselines and
   observe one normal traffic cycle. Roll back by disabling the dedicated flag 
and
   restarting every web/worker process; confirm an enabled gauge of zero and 
normal
   provider success.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Shortcut SC-106828
   - [x] Required feature flags: `SEMANTIC_LAYERS`, 
`SEMANTIC_LAYER_CONTAINMENT_CACHE`
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to