mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:17: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:
@@ -2,11 +2,9 @@ package instance
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -59,19 +57,19 @@ func ChangeSecurityPolicyAllowedOrigins(allowedOrigins []string) func(event *Sec
|
||||
}
|
||||
}
|
||||
|
||||
func (e *SecurityPolicySetEvent) Data() interface{} {
|
||||
func (e *SecurityPolicySetEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *SecurityPolicySetEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||||
func (e *SecurityPolicySetEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func SecurityPolicySetEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
func SecurityPolicySetEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
securityPolicyAdded := &SecurityPolicySetEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
err := json.Unmarshal(event.Data, securityPolicyAdded)
|
||||
err := event.Unmarshal(securityPolicyAdded)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "IAM-soiwj", "unable to unmarshal oidc config added")
|
||||
}
|
||||
|
Reference in New Issue
Block a user