mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:07:36 +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:
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
caos_errs "github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
||||
"github.com/zitadel/zitadel/internal/repository/org"
|
||||
)
|
||||
|
||||
@@ -71,71 +70,61 @@ func TestCommandSide_SetCustomMessageText(t *testing.T) {
|
||||
t,
|
||||
expectFilter(),
|
||||
expectPush(
|
||||
[]*repository.Event{
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageGreeting,
|
||||
"Greeting",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageSubject,
|
||||
"Subject",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageTitle,
|
||||
"Title",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessagePreHeader,
|
||||
"PreHeader",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageText,
|
||||
"Text",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageButtonText,
|
||||
"ButtonText",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageFooterText,
|
||||
"Footer",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
},
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageGreeting,
|
||||
"Greeting",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageSubject,
|
||||
"Subject",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageTitle,
|
||||
"Title",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessagePreHeader,
|
||||
"PreHeader",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageText,
|
||||
"Text",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageButtonText,
|
||||
"ButtonText",
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextSetEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageFooterText,
|
||||
"Footer",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -231,64 +220,54 @@ func TestCommandSide_SetCustomMessageText(t *testing.T) {
|
||||
),
|
||||
),
|
||||
expectPush(
|
||||
[]*repository.Event{
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageGreeting,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageSubject,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageTitle,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessagePreHeader,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageText,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageButtonText,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageFooterText,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
},
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageGreeting,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageSubject,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageTitle,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessagePreHeader,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageText,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageButtonText,
|
||||
language.English,
|
||||
),
|
||||
|
||||
org.NewCustomTextRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
domain.MessageFooterText,
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
),
|
||||
},
|
||||
@@ -472,15 +451,11 @@ func TestCommandSide_RemoveCustomMessageText(t *testing.T) {
|
||||
),
|
||||
),
|
||||
expectPush(
|
||||
[]*repository.Event{
|
||||
eventFromEventPusher(
|
||||
org.NewCustomTextTemplateRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
},
|
||||
org.NewCustomTextTemplateRemovedEvent(context.Background(),
|
||||
&org.NewAggregate("org1").Aggregate,
|
||||
"Template",
|
||||
language.English,
|
||||
),
|
||||
),
|
||||
),
|
||||
},
|
||||
|
Reference in New Issue
Block a user