mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:57: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:
@@ -4,41 +4,23 @@ import (
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
"github.com/zitadel/zitadel/internal/view/model"
|
||||
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
||||
)
|
||||
|
||||
func ViewsToPb(views []*model.View) []*admin_pb.View {
|
||||
v := make([]*admin_pb.View, len(views))
|
||||
for i, view := range views {
|
||||
v[i] = ViewToPb(view)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func ViewToPb(view *model.View) *admin_pb.View {
|
||||
return &admin_pb.View{
|
||||
Database: view.Database,
|
||||
ViewName: view.ViewName,
|
||||
LastSuccessfulSpoolerRun: timestamppb.New(view.LastSuccessfulSpoolerRun),
|
||||
ProcessedSequence: view.CurrentSequence,
|
||||
EventTimestamp: timestamppb.New(view.EventTimestamp),
|
||||
}
|
||||
}
|
||||
|
||||
func CurrentSequencesToPb(database string, currentSequences *query.CurrentSequences) []*admin_pb.View {
|
||||
v := make([]*admin_pb.View, len(currentSequences.CurrentSequences))
|
||||
for i, currentSequence := range currentSequences.CurrentSequences {
|
||||
func CurrentSequencesToPb(database string, currentSequences *query.CurrentStates) []*admin_pb.View {
|
||||
v := make([]*admin_pb.View, len(currentSequences.CurrentStates))
|
||||
for i, currentSequence := range currentSequences.CurrentStates {
|
||||
v[i] = CurrentSequenceToPb(database, currentSequence)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func CurrentSequenceToPb(database string, currentSequence *query.CurrentSequence) *admin_pb.View {
|
||||
func CurrentSequenceToPb(database string, currentSequence *query.CurrentState) *admin_pb.View {
|
||||
return &admin_pb.View{
|
||||
Database: database,
|
||||
ViewName: currentSequence.ProjectionName,
|
||||
ProcessedSequence: currentSequence.CurrentSequence,
|
||||
LastSuccessfulSpoolerRun: timestamppb.New(currentSequence.Timestamp),
|
||||
ProcessedSequence: currentSequence.Sequence,
|
||||
LastSuccessfulSpoolerRun: timestamppb.New(currentSequence.LastRun),
|
||||
EventTimestamp: timestamppb.New(currentSequence.EventCreatedAt),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user