mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:27:33 +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:
@@ -1,11 +1,8 @@
|
||||
package idp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
||||
)
|
||||
|
||||
type JWTIDPAddedEvent struct {
|
||||
@@ -42,20 +39,20 @@ func NewJWTIDPAddedEvent(
|
||||
}
|
||||
}
|
||||
|
||||
func (e *JWTIDPAddedEvent) Data() interface{} {
|
||||
func (e *JWTIDPAddedEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *JWTIDPAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||||
func (e *JWTIDPAddedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func JWTIDPAddedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
func JWTIDPAddedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
e := &JWTIDPAddedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
|
||||
err := json.Unmarshal(event.Data, e)
|
||||
err := event.Unmarshal(e)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "IDP-Et1dq", "unable to unmarshal event")
|
||||
}
|
||||
@@ -131,20 +128,20 @@ func ChangeJWTOptions(options OptionChanges) func(*JWTIDPChangedEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *JWTIDPChangedEvent) Data() interface{} {
|
||||
func (e *JWTIDPChangedEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *JWTIDPChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||||
func (e *JWTIDPChangedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func JWTIDPChangedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
func JWTIDPChangedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
e := &JWTIDPChangedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
|
||||
err := json.Unmarshal(event.Data, e)
|
||||
err := event.Unmarshal(e)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "IDP-D3gjzh", "unable to unmarshal event")
|
||||
}
|
||||
|
Reference in New Issue
Block a user