mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
fix(mirror): use correct statements on push (#8414)
# Which Problems Are Solved The mirror command used the wrong position to filter for events if different database technologies for source and destination were used. # How the Problems Are Solved The statements which diverge are stored on the client so that different technologies can use different statements. # Additional Context - https://discord.com/channels/927474939156643850/1256396896243552347
This commit is contained in:
@@ -71,7 +71,7 @@ func (s *Storage) Push(ctx context.Context, intent *eventstore.PushIntent) (err
|
||||
return err
|
||||
}
|
||||
|
||||
return push(ctx, tx, intent, commands)
|
||||
return s.push(ctx, tx, intent, commands)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ func lockAggregates(ctx context.Context, tx *sql.Tx, intent *eventstore.PushInte
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func push(ctx context.Context, tx *sql.Tx, reducer eventstore.Reducer, commands []*command) (err error) {
|
||||
func (s *Storage) push(ctx context.Context, tx *sql.Tx, reducer eventstore.Reducer, commands []*command) (err error) {
|
||||
ctx, span := tracing.NewSpan(ctx)
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
@@ -171,7 +171,7 @@ func push(ctx context.Context, tx *sql.Tx, reducer eventstore.Reducer, commands
|
||||
cmd.position.InPositionOrder,
|
||||
)
|
||||
|
||||
stmt.WriteString(pushPositionStmt)
|
||||
stmt.WriteString(s.pushPositionStmt)
|
||||
stmt.WriteString(`)`)
|
||||
}
|
||||
stmt.WriteString(` RETURNING created_at, "position"`)
|
||||
|
Reference in New Issue
Block a user