fix(mirror): skip notification projections (#9878)

# Which Problems Are Solved

During the mirror command execution we saw high wait times for
notification projections.

# How the Problems Are Solved

As the events are skipped anyways because the notifications are sent out
by the source Zitadel we skip the projections and just set the current
state.
This commit is contained in:
Silvan
2025-05-12 15:58:23 +02:00
committed by GitHub
parent e302591f09
commit 5331841675
4 changed files with 43 additions and 6 deletions

View File

@@ -248,7 +248,7 @@ func projections(
}()
for i := 0; i < int(config.Projections.ConcurrentInstances); i++ {
go execProjections(ctx, instances, failedInstances, &wg)
go execProjections(ctx, es, instances, failedInstances, &wg)
}
existingInstances := queryInstanceIDs(ctx, client)
@@ -264,7 +264,7 @@ func projections(
logging.WithFields("took", time.Since(start)).Info("projections executed")
}
func execProjections(ctx context.Context, instances <-chan string, failedInstances chan<- string, wg *sync.WaitGroup) {
func execProjections(ctx context.Context, es *eventstore.Eventstore, instances <-chan string, failedInstances chan<- string, wg *sync.WaitGroup) {
for instance := range instances {
logging.WithFields("instance", instance).Info("starting projections")
ctx = internal_authz.WithInstanceID(ctx, instance)
@@ -290,7 +290,7 @@ func execProjections(ctx context.Context, instances <-chan string, failedInstanc
continue
}
err = notification.ProjectInstance(ctx)
err = notification.SetCurrentState(ctx, es)
if err != nil {
logging.WithFields("instance", instance).OnError(err).Info("trigger notification failed")
failedInstances <- instance