action #34525

Improve handling of screenshot inserts into the database

Added by szarate almost 2 years ago. Updated over 1 year ago.

Status:ResolvedStart date:09/04/2018
Priority:HighDue date:
Assignee:coolo% Done:

0%

Category:Feature requests
Target version:Done
Difficulty:
Duration:

Description

Currently the database is throwing errors with insertions to the screenshots table, Since there might be screenshots that are already there, we don't need to add them or change them, and we don't want to waste time figuring out if we do (Database time speaking), is preferred to simply implement postgreSQL specific sentences like ON CONFLICT clause

This would most likely require to move towards postgreSQL 9.5 at least (And we have version 10 out also already and packaged at obs which is the one where the postgreSQL project points to atm)

2018-04-09 12:35:05 CEST openqa geekotest ERROR:  duplicate key value violates unique constraint "screenshots_filename"
2018-04-09 12:35:05 CEST openqa geekotest DETAIL:  Key (filename)=(af0/4e2/1ce90e331bdfafa86d652a29b8.png) already exists.
2018-04-09 12:35:05 CEST openqa geekotest STATEMENT:  INSERT INTO screenshots ( filename, t_created) VALUES ( $1, $2 ) RETURNING id
2018-04-09 12:35:06 CEST openqa geekotest ERROR:  duplicate key value violates unique constraint "screenshots_filename"
2018-04-09 12:35:06 CEST openqa geekotest DETAIL:  Key (filename)=(228/607/9ea51a4834202457ecb2760f83.png) already exists.
2018-04-09 12:35:06 CEST openqa geekotest STATEMENT:  INSERT INTO screenshots ( filename, t_created) VALUES ( $1, $2 ) RETURNING id

History

#1 Updated by coolo over 1 year ago

  • Priority changed from Normal to High

As this makes reading postgresql logs basically impossible, I raise prio

Last time we had this problem, Marius found that running it in a transaction silences postgresql

#3 Updated by coolo over 1 year ago

  • Target version changed from Ready to Current Sprint

#4 Updated by coolo over 1 year ago

  • Assignee set to coolo

#5 Updated by coolo over 1 year ago

  • Status changed from New to Resolved

#6 Updated by szarate over 1 year ago

  • Target version changed from Current Sprint to Done

Also available in: Atom PDF