feat(adr0034): Route assignment ops per domain - #1219
Merged
Conversation
Replace the single fixed backend_driver with an immutable AssignmentBundle behind an ArcSwap: a global backend, per-instance named [assignment.backends.*] backends, and an untargeted fan-out set. Routing keys on the assignment target - system and unconfigured domains use the global driver, a bound domain uses its mapped block's shared instance. - driver_for_target resolves domain/project targets to a backend via a per-domain binding-name cache; project targets resolve through the owning domain - list_role_assignments dispatches on system/project/domain filters and fans out over every active backend when untargeted, unioning and re-paginating the deduplicated result (ADR 0034 section 5) - reload/refresh_bindings rebuild the bundle and clear the cache in place; a failed rebuild keeps the last-known-good bundle - paginate_in_memory lifted into core-types so the SQL driver and the fan-out union share one implementation - PartialEq on AssignmentBackendConfig / OpenFGAAssignmentDriver for byte-equal block comparison on instance reuse reload/refresh_bindings take &ServiceState, not &Config: bound_domains and effective_config need it. Provider construction has no ServiceState, so new() builds a global-only bootstrap bundle; the named instances and fan-out set populate on the first reload (startup reactor lands in PR 5). Until then routing is the pre-ADR-0034 global-only behaviour. Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
|
🦢 Load Test Results Goose Attack ReportPlan Overview
Request Metrics
Response Time Metrics
Status Code Metrics
Transaction Metrics
Scenario Metrics
Error Metrics
|
|
🧪 Tempest Identity Compatibility Results (advisory, non-blocking) rust Failed test IDs |
|
| Project | keystone |
| Branch | claude/per-domain-assignments-provider-k0tp5e |
| Testbed | ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Upper Boundary nanoseconds (ns) (Limit %) |
|---|---|---|---|
| Command_Serde/apply/remove | 📈 view plot 🚷 view threshold | 86,057.00 ns(-66.06%)Baseline: 253,576.47 ns | 1,303,074.01 ns (6.60%) |
| Command_Serde/apply/set | 📈 view plot 🚷 view threshold | 89,822.00 ns(-77.86%)Baseline: 405,791.00 ns | 3,193,799.49 ns (2.81%) |
| Command_Serde/pack/delete | 📈 view plot 🚷 view threshold | 124.62 ns(+5.63%)Baseline: 117.98 ns | 152.31 ns (81.82%) |
| Command_Serde/pack/delete_index | 📈 view plot 🚷 view threshold | 109.85 ns(+4.40%)Baseline: 105.22 ns | 135.17 ns (81.27%) |
| Command_Serde/pack/set | 📈 view plot 🚷 view threshold | 222.57 ns(+16.61%)Baseline: 190.87 ns | 241.34 ns (92.22%) |
| Command_Serde/pack/set_index | 📈 view plot 🚷 view threshold | 110.04 ns(+4.62%)Baseline: 105.18 ns | 135.76 ns (81.05%) |
| Command_Serde/unpack/delete | 📈 view plot 🚷 view threshold | 162.50 ns(-13.44%)Baseline: 187.73 ns | 268.49 ns (60.52%) |
| Command_Serde/unpack/delete_index | 📈 view plot 🚷 view threshold | 127.08 ns(-18.52%)Baseline: 155.96 ns | 217.07 ns (58.54%) |
| Command_Serde/unpack/set | 📈 view plot 🚷 view threshold | 251.35 ns(-4.67%)Baseline: 263.67 ns | 357.59 ns (70.29%) |
| Command_Serde/unpack/set_index | 📈 view plot 🚷 view threshold | 125.73 ns(-18.12%)Baseline: 153.55 ns | 211.56 ns (59.43%) |
| Payload_encryption/pack/remove_cmd | 📈 view plot 🚷 view threshold | 112.80 ns(+0.15%)Baseline: 112.63 ns | 148.88 ns (75.76%) |
| Payload_encryption/pack/set_cmd | 📈 view plot 🚷 view threshold | 220.96 ns(+10.83%)Baseline: 199.36 ns | 261.91 ns (84.36%) |
| Payload_encryption/unpack/remove_cmd | 📈 view plot 🚷 view threshold | 159.00 ns(-18.88%)Baseline: 196.01 ns | 282.35 ns (56.31%) |
| Payload_encryption/unpack/set_cmd | 📈 view plot 🚷 view threshold | 251.44 ns(-7.87%)Baseline: 272.92 ns | 374.50 ns (67.14%) |
| Raft_1Node_Latency/prefix/1node | 📈 view plot 🚷 view threshold | 5,792,500.00 ns(+85.61%)Baseline: 3,120,808.42 ns | 8,025,262.34 ns (72.18%) |
| Raft_1Node_Latency/read/1node | 📈 view plot 🚷 view threshold | 31,513.00 ns(-15.63%)Baseline: 37,352.17 ns | 51,472.44 ns (61.22%) |
| Raft_1Node_Latency/remove/1node | 📈 view plot 🚷 view threshold | 241,840.00 ns(-79.31%)Baseline: 1,169,061.41 ns | 11,495,283.01 ns (2.10%) |
| Raft_1Node_Latency/write/1node | 📈 view plot 🚷 view threshold | 258,550.00 ns(-73.50%)Baseline: 975,718.59 ns | 7,555,252.10 ns (3.42%) |
| build_snapshot/default | 📈 view plot 🚷 view threshold | 89,740.00 ns(-26.77%)Baseline: 122,537.34 ns | 268,577.57 ns (33.41%) |
| fernet token/project | 📈 view plot 🚷 view threshold | 1,492.30 ns(+4.48%)Baseline: 1,428.26 ns | 1,797.14 ns (83.04%) |
| get_data_keyspace | 📈 view plot 🚷 view threshold | 0.29 ns(-8.53%)Baseline: 0.32 ns | 0.39 ns (74.66%) |
| get_db | 📈 view plot 🚷 view threshold | 0.29 ns(-8.94%)Baseline: 0.32 ns | 0.39 ns (74.44%) |
| get_fernet_token_timestamp/project | 📈 view plot 🚷 view threshold | 144.68 ns(+3.03%)Baseline: 140.43 ns | 180.01 ns (80.37%) |
| get_keyspace | 📈 view plot 🚷 view threshold | 12.11 ns(+105.12%)Baseline: 5.90 ns | 13.71 ns (88.28%) |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the single fixed backend_driver with an immutable
AssignmentBundle behind an ArcSwap: a global backend, per-instance named
[assignment.backends.*] backends, and an untargeted fan-out set. Routing
keys on the assignment target - system and unconfigured domains use the
global driver, a bound domain uses its mapped block's shared instance.
per-domain binding-name cache; project targets resolve through the
owning domain
fans out over every active backend when untargeted, unioning and
re-paginating the deduplicated result (ADR 0034 section 5)
place; a failed rebuild keeps the last-known-good bundle
fan-out union share one implementation
byte-equal block comparison on instance reuse
reload/refresh_bindings take &ServiceState, not &Config: bound_domains
and effective_config need it. Provider construction has no ServiceState,
so new() builds a global-only bootstrap bundle; the named instances and
fan-out set populate on the first reload (startup reactor lands in PR
5). Until then routing is the pre-ADR-0034 global-only behaviour.
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com