Merge 'auth: use auth cache on login path' from Marcin Maliszkiewicz
Scylla currently has bad resiliency to connection storms. Nodes are easy to overload or impact their latency by unbound concurrency in making new connections on the client side. This can easily happen in bigger deployments where there are thousands of client instances, e.g. pods.
To improve resiliency we are introducing unified auth specialized cache to the system. This patch series is stage 1, where cache is used only on login path.
Dependency diagram:
```
|Authentication Layer|
|
v
+--------------------------------+
| Auth Cache |
+--------------------------------+
^ |
| |
| v
|Raft Write Logic | | CQL Read Layer|
```
Cache invalidation is based on raft and the cache contains full content of related tables.
Ldap role manager may benefit partially as can_logic function is common and will be cached,
but it still needs to query roles from external source.
Performance results:
For single shard connection/disconnection scenario insns/conn decreased by *5%*,
allocs/conn decreased by *23%*, tasks/conn decreased by *20%*. Results for 20 shards are very similar.
Raw data before:
```
≡ ◦ ⤖ rm -rf /tmp/scylla-data && build/release/scylla perf-cql-raw --workdir /tmp/scylla-data --smp 1 --developer-mode 1 --username cassandra --password cassandra --connection-per-request true 2> /dev/null
Running test with config: {workload=read, partitions=10000, concurrency=100, duration=5, ops_per_shard=0, auth, connection_per_request}
Pre-populated 10000 partitions
1128.55 tps (599.2 allocs/op, 0.0 logallocs/op, 145.2 tasks/op, 2586610 insns/op, 1350912 cycles/op, 0 errors)
1157.41 tps (601.3 allocs/op, 0.0 logallocs/op, 145.2 tasks/op, 2589046 insns/op, 1356691 cycles/op, 0 errors)
1167.42 tps (603.3 allocs/op, 0.0 logallocs/op, 145.2 tasks/op, 2603234 insns/op, 1360607 cycles/op, 0 errors)
1159.63 tps (605.9 allocs/op, 0.0 logallocs/op, 145.3 tasks/op, 2609977 insns/op, 1363935 cycles/op, 0 errors)
1165.12 tps (608.8 allocs/op, 0.0 logallocs/op, 145.2 tasks/op, 2625804 insns/op, 1365736 cycles/op, 0 errors)
throughput:
mean= 1155.63 standard-deviation=15.66
median= 1159.63 median-absolute-deviation=9.49
maximum=1167.42 minimum=1128.55
instructions_per_op:
mean= 2602934.31 standard-deviation=16063.01
median= 2603234.19 median-absolute-deviation=13887.96
maximum=2625804.05 minimum=2586609.82
cpu_cycles_per_op:
mean= 1359576.30 standard-deviation=5945.69
median= 1360607.05 median-absolute-deviation=4358.94
maximum=1365736.42 minimum=1350912.10
```
Raw data after:
```
≡ ◦ ⤖ rm -rf /tmp/scylla-data && build/release/scylla perf-cql-raw --workdir /tmp/scylla-data --smp 1 --developer-mode 1 --username cassandra --password cassandra --connection-per-request true --duration 10 2> /dev/null
Running test with config: {workload=read, partitions=10000, concurrency=100, duration=10, ops_per_shard=0, auth, connection_per_request}
Pre-populated 10000 partitions
1132.09 tps (457.5 allocs/op, 0.0 logallocs/op, 115.1 tasks/op, 2432485 insns/op, 1270655 cycles/op, 0 errors)
1157.70 tps (458.4 allocs/op, 0.0 logallocs/op, 115.1 tasks/op, 2447779 insns/op, 1283768 cycles/op, 0 errors)
1162.86 tps (459.0 allocs/op, 0.0 logallocs/op, 115.1 tasks/op, 2463225 insns/op, 1291782 cycles/op, 0 errors)
1153.15 tps (460.2 allocs/op, 0.0 logallocs/op, 115.2 tasks/op, 2469230 insns/op, 1296381 cycles/op, 0 errors)
1142.09 tps (460.6 allocs/op, 0.0 logallocs/op, 115.1 tasks/op, 2478900 insns/op, 1299342 cycles/op, 0 errors)
1124.89 tps (462.5 allocs/op, 0.0 logallocs/op, 115.2 tasks/op, 2470962 insns/op, 1305026 cycles/op, 0 errors)
1156.75 tps (464.4 allocs/op, 0.0 logallocs/op, 115.1 tasks/op, 2493823 insns/op, 1305136 cycles/op, 0 errors)
1152.16 tps (466.3 allocs/op, 0.0 logallocs/op, 115.2 tasks/op, 2497246 insns/op, 1309816 cycles/op, 0 errors)
1154.77 tps (469.8 allocs/op, 0.0 logallocs/op, 115.5 tasks/op, 2571954 insns/op, 1345341 cycles/op, 0 errors)
1152.22 tps (472.4 allocs/op, 0.0 logallocs/op, 115.3 tasks/op, 2551954 insns/op, 1334202 cycles/op, 0 errors)
throughput:
mean= 1148.87 standard-deviation=12.08
median= 1153.15 median-absolute-deviation=7.88
maximum=1162.86 minimum=1124.89
instructions_per_op:
mean= 2487755.88 standard-deviation=43838.23
median= 2478900.02 median-absolute-deviation=24531.06
maximum=2571954.26 minimum=2432485.38
cpu_cycles_per_op:
mean= 1304144.76 standard-deviation=22129.55
median= 1305025.71 median-absolute-deviation=12363.25
maximum=1345341.16 minimum=1270655.17
```
Fixes https://github.com/scylladb/scylladb/issues/18891
Backport: no, it's a new feature
Closes scylladb/scylladb#26841
* github.com:scylladb/scylladb:
auth: use auth cache on login path
auth: corutinize standard_role_manager::can_login
main: auth: add auth cache dependency to auth service
raft: update auth cache when data changes
auth: storage_service: reload auth cache on v1 to v2 auth migration
raft: reload auth cache on snapshot application
service: add auth cache getter to storage service
main: start auth cache service
auth: add unified cache implementation
auth: move table names to common.hh