Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: unspecified
-
Fix Version/s: unspecified
-
Component/s: Data Summarization
-
Labels:None
-
Environment:
xml-06.dc1bos.thesearchagency.com tsa-build-bidmgr-2012-01-30-p16-r31446/
Description
The sepull reports are run at the TSA account level. For each account, we get a list of its SEUs (search engine accounts) and download a report for each. Some TSA accounts have the same SEU associated with them, so multiple reports are being downloaded and parsed for a single Google (or another search engine) account. This leads to a race condition because the parsing code deletes entries in the database for the date and the campaigns in the xml file downloaded from Google. If these duplicate reports are being parsed concurrently, we run into MySQL inserting duplicate data.
2012-02-08 03:58:12.155 (3) [P1T6]: Deleting existing records where ((`startTime`="2012-02-07 00:00:00"))
2012-02-08 03:58:13.710 (1) [P1T6]: Exception [ Error parsing /var/local/tsa/sedata/google/tsa-mcc-report-2012-02-07-A456-U1391.xml.gz]:com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Du
plicate entry '2012-02-07-698302-243034693-19911182-333481333-unknown-Search Ne' for key 'PRIMARY'
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1316)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1235)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1388)
at com.carldunham.jst.db.Database.executeUpdate(Database.java:401)
at com.carldunham.jst.db.BaseDatabaseTable.insert(BaseDatabaseTable.java:366)
at com.carldunham.jst.db.BaseDatabaseTable.insert(BaseDatabaseTable.java:354)
at com.thesearchagency.searchengines.google.GoogleAPISearchEngine.parseReport(GoogleAPISearchEngine.java:1856)
at com.thesearchagency.searchengines.google.GoogleAPISearchEngine.parseReport(GoogleAPISearchEngine.java:1615)
at com.thesearchagency.searchengines.google.GoogleMCCReport$GoogleMCCReportAccountWorker.stageSearchEngineReport(GoogleMCCReport.java:198)
at com.thesearchagency.searchengines.common.SearchEngineDataStager$AccountWorker.run(SearchEngineDataStager.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2012-02-08 03:58:13.711 (3) [P1T6]: ...done