Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapshots are created over and over again Postgres #20

Closed
basz opened this issue Mar 25, 2018 · 12 comments
Closed

snapshots are created over and over again Postgres #20

basz opened this issue Mar 25, 2018 · 12 comments

Comments

@basz
Copy link
Member

basz commented Mar 25, 2018

from docker log

postgres_1         | 2018-03-25 14:42:45.795 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:45.795 UTC [26] DETAIL:  Key (name)=(snapshot:customer_customer) already exists.
postgres_1         | 2018-03-25 14:42:45.795 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);
postgres_1         | 2018-03-25 14:42:45.899 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:45.899 UTC [26] DETAIL:  Key (name)=(snapshot:dossier_dossier) already exists.
postgres_1         | 2018-03-25 14:42:45.899 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);
postgres_1         | 2018-03-25 14:42:45.992 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:45.992 UTC [26] DETAIL:  Key (name)=(snapshot:dossier_order) already exists.
postgres_1         | 2018-03-25 14:42:45.992 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);
postgres_1         | 2018-03-25 14:42:46.083 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:46.083 UTC [26] DETAIL:  Key (name)=(snapshot:filesystem_file) already exists.
postgres_1         | 2018-03-25 14:42:46.083 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);
postgres_1         | 2018-03-25 14:42:46.179 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:46.179 UTC [26] DETAIL:  Key (name)=(snapshot:identity_user) already exists.
postgres_1         | 2018-03-25 14:42:46.179 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);
postgres_1         | 2018-03-25 14:42:46.280 UTC [26] ERROR:  duplicate key value violates unique constraint "projections_name_key"
postgres_1         | 2018-03-25 14:42:46.280 UTC [26] DETAIL:  Key (name)=(snapshot:sop_workflow) already exists.
postgres_1         | 2018-03-25 14:42:46.280 UTC [26] STATEMENT:  INSERT INTO "projections" (name, position, state, status, locked_until)
postgres_1         |    VALUES ($1, '{}', '{}', $2, NULL);

At first I thought is was because of the : in the name, however changing that to - didn't solve it.

@basz
Copy link
Member Author

basz commented Mar 25, 2018

I now notice this comment in the source // we ignore any occurring error here (duplicate projection). So I guess this is expected behaviour, meh... can I kill that logging?

@prolic
Copy link
Member

prolic commented Mar 25, 2018 via email

@prolic
Copy link
Member

prolic commented Mar 25, 2018

Where is that comment? Can't remember everything, sorry :-)

@prolic
Copy link
Member

prolic commented Mar 25, 2018 via email

@basz
Copy link
Member Author

basz commented Mar 29, 2018

Setting these options will not suppress this output into the postgres logs. Time to install log rotate on my docker logs.

@basz basz closed this as completed Mar 29, 2018
@prolic
Copy link
Member

prolic commented Mar 29, 2018

ah postgres logs, okay, yes you can't do anything about it. sorry.
is there something like "ignore duplicate key error"-addition for sql queries?

@basz
Copy link
Member Author

basz commented Mar 29, 2018

@basz
Copy link
Member Author

basz commented Mar 29, 2018

a native UPSERT sweet

@prolic
Copy link
Member

prolic commented Mar 29, 2018

cool, wanna provide another PR ?

@basz
Copy link
Member Author

basz commented Mar 29, 2018

yes, but need to prioritise, so later

@prolic
Copy link
Member

prolic commented Mar 29, 2018

no problem, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants