mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:57:32 +00:00
feat(eventstore): increase parallel write capabilities (#5940)
This implementation increases parallel write capabilities of the eventstore. Please have a look at the technical advisories: [05](https://zitadel.com/docs/support/advisory/a10005) and [06](https://zitadel.com/docs/support/advisory/a10006). The implementation of eventstore.push is rewritten and stored events are migrated to a new table `eventstore.events2`. If you are using cockroach: make sure that the database user of ZITADEL has `VIEWACTIVITY` grant. This is used to query events.
This commit is contained in:
@@ -8,11 +8,14 @@ import (
|
||||
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/api/call"
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/handler/v2"
|
||||
"github.com/zitadel/zitadel/internal/query/projection"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
||||
)
|
||||
@@ -170,7 +173,8 @@ func (q *Queries) SessionByID(ctx context.Context, shouldTriggerBulk bool, id, s
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
if shouldTriggerBulk {
|
||||
ctx = projection.SessionProjection.Trigger(ctx)
|
||||
ctx, err = projection.SessionProjection.Trigger(ctx, handler.WithAwaitRunning())
|
||||
logging.OnError(err).Debug("unable to trigger")
|
||||
}
|
||||
|
||||
query, scan := prepareSessionQuery(ctx, q.client)
|
||||
@@ -222,7 +226,7 @@ func (q *Queries) SearchSessions(ctx context.Context, queries *SessionsSearchQue
|
||||
return nil, errors.ThrowInternal(err, "QUERY-Sfg42", "Errors.Internal")
|
||||
}
|
||||
|
||||
sessions.LatestSequence, err = q.latestSequence(ctx, sessionsTable)
|
||||
sessions.State, err = q.latestState(ctx, sessionsTable)
|
||||
return sessions, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user