diff --git a/internal/command/command.go b/internal/command/command.go index 86730fabcc..8d77be765e 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -296,7 +296,7 @@ func (c *Commands) asyncPush(ctx context.Context, cmds ...eventstore.Command) { _, err := c.eventstore.Push(localCtx, cmds...) if err != nil { for _, cmd := range cmds { - logging.WithError(err).Errorf("could not push event %q", cmd.Type()) + logging.WithError(err).Warnf("could not push event %q", cmd.Type()) } } diff --git a/internal/eventstore/eventstore_pusher_test.go b/internal/eventstore/eventstore_pusher_test.go index cbd1a72e34..bd97b2e1e6 100644 --- a/internal/eventstore/eventstore_pusher_test.go +++ b/internal/eventstore/eventstore_pusher_test.go @@ -390,10 +390,10 @@ func TestCRDB_Push_Parallel(t *testing.T) { }, }, res: res{ - minErrCount: 1, + minErrCount: 0, eventsRes: eventsRes{ aggIDs: []string{"204"}, - pushedEventsCount: 6, + pushedEventsCount: 8, aggTypes: database.TextArray[eventstore.AggregateType]{eventstore.AggregateType(t.Name())}, }, }, diff --git a/internal/eventstore/v3/push.go b/internal/eventstore/v3/push.go index c217359828..22ea9295f6 100644 --- a/internal/eventstore/v3/push.go +++ b/internal/eventstore/v3/push.go @@ -8,7 +8,6 @@ import ( "fmt" "strconv" "strings" - "sync" "github.com/cockroachdb/cockroach-go/v2/crdb" "github.com/jackc/pgx/v5/pgconn" @@ -29,13 +28,10 @@ func (es *Eventstore) Push(ctx context.Context, commands ...eventstore.Command) // tx is not closed because [crdb.ExecuteInTx] takes care of that var ( sequences []*latestSequence - once sync.Once ) err = crdb.ExecuteInTx(ctx, &transaction{tx}, func() error { - once.Do(func() { - sequences, err = latestSequences(ctx, tx, commands) - }) + sequences, err = latestSequences(ctx, tx, commands) if err != nil { return err }