mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37: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:
@@ -1,13 +1,11 @@
|
||||
package idp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
||||
)
|
||||
|
||||
type LDAPIDPAddedEvent struct {
|
||||
@@ -165,20 +163,20 @@ func NewLDAPIDPAddedEvent(
|
||||
}
|
||||
}
|
||||
|
||||
func (e *LDAPIDPAddedEvent) Data() interface{} {
|
||||
func (e *LDAPIDPAddedEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *LDAPIDPAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||||
func (e *LDAPIDPAddedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func LDAPIDPAddedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
func LDAPIDPAddedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
e := &LDAPIDPAddedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
|
||||
err := json.Unmarshal(event.Data, e)
|
||||
err := event.Unmarshal(e)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "IDP-Dgh42", "unable to unmarshal event")
|
||||
}
|
||||
@@ -329,20 +327,20 @@ func ChangeLDAPOptions(options OptionChanges) func(*LDAPIDPChangedEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *LDAPIDPChangedEvent) Data() interface{} {
|
||||
func (e *LDAPIDPChangedEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *LDAPIDPChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
|
||||
func (e *LDAPIDPChangedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func LDAPIDPChangedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
func LDAPIDPChangedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
e := &LDAPIDPChangedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
|
||||
err := json.Unmarshal(event.Data, e)
|
||||
err := event.Unmarshal(e)
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "IDP-Sfth3", "unable to unmarshal event")
|
||||
}
|
||||
|
Reference in New Issue
Block a user