zitadel/internal/eventstore/handler/v2
Silvan 77cd430b3a
refactor(handler): cache active instances (#9008)
# Which Problems Are Solved

Scheduled handlers use `eventstore.InstanceIDs` to get the all active
instances within a given timeframe. This function scrapes through all
events written within that time frame which can cause heavy load on the
database.

# How the Problems Are Solved

A new query cache `activeInstances` is introduced which caches the ids
of all instances queried by id or host within the configured timeframe.

# Additional Changes

- Changed `default.yaml`
  - Removed `HandleActiveInstances` from custom handler configs
- Added `MaxActiveInstances` to define the maximal amount of cached
instance ids
- fixed start-from-init and start-from-setup to start auth and admin
projections twice
- fixed org cache invalidation to use correct index

# Additional Context

- part of #8999
2024-12-06 11:32:53 +00:00
..
failed_event_get_count.sql feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
failed_event_set.sql feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
failed_event.go feat(storage): generic cache interface (#8628) 2024-09-25 21:40:21 +02:00
field_handler.go refactor(handler): cache active instances (#9008) 2024-12-06 11:32:53 +00:00
handler.go refactor(handler): cache active instances (#9008) 2024-12-06 11:32:53 +00:00
init.go fix(handler): optimise snapshot hanlding (#8652) 2024-10-02 18:34:19 +03:00
log.go feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
mock_test.go refactor(handler): cache active instances (#9008) 2024-12-06 11:32:53 +00:00
reduce.go feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
state_get_await.sql fix(eventstore): improve pagination of handler filter (#6968) 2023-12-01 12:25:41 +00:00
state_get.sql fix(eventstore): improve pagination of handler filter (#6968) 2023-12-01 12:25:41 +00:00
state_lock.sql feat(eventstore): increase parallel write capabilities (#5940) 2023-10-19 12:19:10 +02:00
state_set.sql fix(eventstore): improve pagination of handler filter (#6968) 2023-12-01 12:25:41 +00:00
state_test.go fix(eventstore): revert precise decimal (#8527) (#8679) 2024-09-24 18:43:29 +02:00
state.go fix(eventstore): revert precise decimal (#8527) (#8679) 2024-09-24 18:43:29 +02:00
statement_test.go feat(oidc): sid claim for id_tokens issued through login V1 (#8525) 2024-09-03 13:19:00 +00:00
statement.go fix(handler): optimise snapshot hanlding (#8652) 2024-10-02 18:34:19 +03:00