mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-22 07:07:41 +00:00
fix(mirror): ensure multiple runs (#9899)
# Which Problems Are Solved 1. After second execution, mirror starts to fail because of Primary key constraints on the events table. Because mirror always took the the first `system.mirror.succeeded` instead of the newest one 2. Mirror panicked during migration of fields tables # How the Problems Are Solved 1. Adjusted the database query to order descending and limit 1 2. added missing assignment # Additional Changes - detailed logging if the copy from statement failed.
This commit is contained in:
@@ -122,7 +122,11 @@ func projections(
|
||||
config.Eventstore.Querier = old_es.NewCRDB(client)
|
||||
esPusherDBClient, err := database.Connect(config.Destination, false, dialect.DBPurposeEventPusher)
|
||||
logging.OnError(err).Fatal("unable to connect eventstore push client")
|
||||
config.Eventstore.Pusher = new_es.NewEventstore(esPusherDBClient)
|
||||
|
||||
newES := new_es.NewEventstore(esPusherDBClient)
|
||||
config.Eventstore.Pusher = newES
|
||||
config.Eventstore.Searcher = newES
|
||||
|
||||
es := eventstore.NewEventstore(config.Eventstore)
|
||||
esV4 := es_v4.NewEventstoreFromOne(es_v4_pg.New(client, &es_v4_pg.Config{
|
||||
MaxRetries: config.Eventstore.MaxRetries,
|
||||
|
Reference in New Issue
Block a user