Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027315
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2014-08-12 14:022015-03-06 13:16
ReportershuehnerView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed in Version3.0PR15Q2
StatusclosedFix in branchFixed in SCM revision03b252d94692
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027315: Slow query related to interrupted background processes running on tomcat startup.

DescriptionThe following query is run on tomcat startup and seems to cause lots of I/O.

LOG: duration: 17306.911 ms execute <unnamed>: UPDATE AD_PROCESS_RUN SET END_TIME=NOW(),STATUS='SYR' WHERE END_TIME IS NULL

It seems that this query is supposed to mark processes interrupted by the last tomcat shutdown with status=SYR. by finding such processes with the END_TIME is null filter.

However the query as such triggers a sequential scan of ad_process_run which can be very big in some cases.

However that table does have an existing index on status column.
It should be functionally possible to add a status filter similar to status=running or (status <> complete && status <> error) which should use that index and skip scanning most of the table.
Steps To Reproduce-
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0026794 closedalostale Prevent re-starting background processes not finished when starting tomcat 
related to defect 0021215 closedAugustoMauch Process monitor shows stopped process as in execution 

-  Notes
(0075073)
hgbot (developer)
2015-03-02 12:23

Repository: erp/devel/pi
Changeset: 03b252d94692423fdc89e455fad1ba1a91278671
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Mar 02 12:22:20 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/03b252d94692423fdc89e455fad1ba1a91278671 [^]

fixed issue 27315: Slow query for interrupted bg processes on tomcat start

  On Tomcat start, background processes that were in execution are updated to change
  their status from 'Processing' to 'System Restart'.

  This query does a sequential scan on ad_process_run which can be slow if there are
  many records.

  This fix:
   * Adds a filter on STATUS column which is indexed. The amount of processes in PRC
     status is expected to be small (specially comapring with the total rows in this
     table), so indexed scan should be used instead of sequential scan.
   * Adds log to inform about the number of executions marked as 'System Restart'

---
M src/org/openbravo/base/OBSchedulerInitializerListener.java
---
(0075111)
hudsonbot (developer)
2015-03-02 20:31

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9d659cacae03 [^]
Maturity status: Test
(0075244)
AugustoMauch (manager)
2015-03-06 13:16

Code reviewed and verified in pi@486e7700e8d0

- Issue History
Date Modified Username Field Change
2014-08-12 14:02 shuehner New Issue
2014-08-12 14:02 shuehner Assigned To => AugustoMauch
2014-08-12 14:02 shuehner Modules => Core
2014-08-12 14:02 shuehner Triggers an Emergency Pack => No
2014-08-12 14:02 shuehner Tag Attached: Performance
2015-02-24 17:03 alostale Relationship added related to 0026794
2015-02-24 17:03 alostale Status new => acknowledged
2015-02-24 17:03 alostale Priority normal => high
2015-02-24 17:04 alostale Priority high => urgent
2015-03-02 09:38 ngarcia Issue Monitored: ngarcia
2015-03-02 12:11 alostale Assigned To AugustoMauch => alostale
2015-03-02 12:11 alostale Review Assigned To => AugustoMauch
2015-03-02 12:14 alostale Relationship added related to 0021215
2015-03-02 12:23 hgbot Checkin
2015-03-02 12:23 hgbot Note Added: 0075073
2015-03-02 12:23 hgbot Status acknowledged => resolved
2015-03-02 12:23 hgbot Resolution open => fixed
2015-03-02 12:23 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/03b252d94692423fdc89e455fad1ba1a91278671 [^]
2015-03-02 20:31 hudsonbot Checkin
2015-03-02 20:31 hudsonbot Note Added: 0075111
2015-03-06 13:16 AugustoMauch Note Added: 0075244
2015-03-06 13:16 AugustoMauch Status resolved => closed
2015-03-06 13:16 AugustoMauch Fixed in Version => 3.0PR15Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker