Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035634Openbravo ERPY. DBSourceManagerpublic2017-03-28 16:412017-04-01 12:06
caristu 
caristu 
highminoralways
closedfixed 
5
 
3.0PR17Q2 
alostale
Core
Pre packaging ( pi )
2017-11-01
pi
http://code.openbravo.com/erp/devel/pi/rev/47c768943f70d1c674cb0a2701faf29edde3da84 [^]
No
0035634: The generation of indexes in parallel fails under some circumstances
The generation of indexes in parallel fails if the maximum number of active connections configured for the database pool is lower than the number of indexes to be added on existing tables.
1) Execute the attached test. It fails with the following error:

org.apache.ddlutils.DatabaseOperationException - Could not get a connection from the datasource
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted
    at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)

Notice that if the MAX_ACTIVE_CONNECTIONS would be higher or equals than 3 (the number of new indexes added to existing tables within the test) the test is executed successfully.
No tags attached.
caused by feature request 00346543.0PR17Q2 closed alostale some performance improvements in DBSM tasks 
diff testIssue35634.diff (17,858) 2017-03-28 16:42
https://issues.openbravo.com/file_download.php?file_id=10613&type=bug
Issue History
2017-03-28 16:41caristuNew Issue
2017-03-28 16:41caristuAssigned To => platform
2017-03-28 16:41caristuModules => Core
2017-03-28 16:41caristuTriggers an Emergency Pack => No
2017-03-28 16:42caristuFile Added: testIssue35634.diff
2017-03-28 16:43caristuRelationship addedcaused by 0034654
2017-03-28 17:01caristuRegression level => Pre packaging ( pi )
2017-03-28 17:01caristuRegression date => 2017-11-01
2017-03-28 17:01caristuRegression introduced in release => pi
2017-03-28 17:01caristuRegression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/47c768943f70d1c674cb0a2701faf29edde3da84 [^]
2017-03-28 17:02caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14906#r14906
2017-03-28 19:22caristuAssigned Toplatform => caristu
2017-03-28 19:23caristuStatusnew => scheduled
2017-03-29 09:15hgbotCheckin
2017-03-29 09:15hgbotNote Added: 0095619
2017-03-29 09:15hgbotStatusscheduled => resolved
2017-03-29 09:15hgbotResolutionopen => fixed
2017-03-29 09:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/555bede6abb1fe0abd4f7ccb29c16d694778eb54 [^]
2017-03-29 09:15hgbotCheckin
2017-03-29 09:15hgbotNote Added: 0095620
2017-03-29 09:16hgbotCheckin
2017-03-29 09:16hgbotNote Added: 0095621
2017-03-29 09:19caristuReview Assigned To => alostale
2017-03-29 15:06hudsonbotCheckin
2017-03-29 15:06hudsonbotNote Added: 0095653
2017-03-31 09:01alostaleNote Added: 0095743
2017-03-31 09:14hgbotCheckin
2017-03-31 09:14hgbotNote Added: 0095745
2017-03-31 09:22hgbotCheckin
2017-03-31 09:22hgbotNote Added: 0095746
2017-03-31 09:40alostaleNote Added: 0095748
2017-03-31 09:40alostaleStatusresolved => closed
2017-03-31 09:40alostaleFixed in Version => 3.0PR17Q2
2017-03-31 10:19hgbotCheckin
2017-03-31 10:19hgbotNote Added: 0095751
2017-03-31 10:25hgbotCheckin
2017-03-31 10:25hgbotNote Added: 0095752
2017-03-31 15:11hudsonbotCheckin
2017-03-31 15:11hudsonbotNote Added: 0095772
2017-04-01 12:06hudsonbotCheckin
2017-04-01 12:06hudsonbotNote Added: 0095778

Notes
(0095619)
hgbot   
2017-03-29 09:15   
Repository: erp/devel/dbsm-main
Changeset: 555bede6abb1fe0abd4f7ccb29c16d694778eb54
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Mar 29 09:13:33 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/555bede6abb1fe0abd4f7ccb29c16d694778eb54 [^]

fixes issue 35634: Index generation in parallel fails under some circumstances

This problem can be reproduced when the number of max active connections of the pool used in DBSM is lower than the number of database connections retrieved in parallel to complete a task (currently the only task that performs queries in parallel is the creation of indexes on existing tables).
In order to prevent this problem, now the update.database and export.database tasks increase the number of active connections supported by the pool with a safe value: having one thread and the default max active connections (8) it was working fine, therefore we now set the max active connections for those tasks to the number of threads multiplied by 8.

---
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
---
(0095620)
hgbot   
2017-03-29 09:15   
Repository: erp/devel/dbsm-main
Changeset: 177b065cc30f915990c490530af0666cc766ef6b
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Mar 29 09:14:14 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/177b065cc30f915990c490530af0666cc766ef6b [^]

related to issue 35634: Added test case

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/model/indexes/BASE_MODEL_FOUR_COLUMNS.xml
A src-test/model/indexes/THREE_INDEXES.xml
A src-test/src/org/openbravo/dbsm/test/model/IndexParallelization.java
---
(0095621)
hgbot   
2017-03-29 09:16   
Repository: erp/devel/pi
Changeset: 8e2360637c673d0c973e56a8a2a32365c93e415d
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Mar 29 09:15:58 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8e2360637c673d0c973e56a8a2a32365c93e415d [^]

related to issue 35634: Updated DBSM library

---
M src-db/database/lib/dbsourcemanager.jar
---
(0095653)
hudsonbot   
2017-03-29 15:06   
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/f901bb68d428 [^]
Maturity status: Test
(0095743)
alostale   
2017-03-31 09:01   
Found minor cosmetic issues in review: https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0095745)
hgbot   
2017-03-31 09:14   
Repository: erp/devel/dbsm-main
Changeset: 50c5c91e5d8d467e24d6a421b02e5646ffce9257
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Mar 31 09:13:59 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/50c5c91e5d8d467e24d6a421b02e5646ffce9257 [^]

related to bug 35634: removed redundant if clause, reduced log message to debug

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
---
(0095746)
hgbot   
2017-03-31 09:22   
Repository: erp/devel/pi
Changeset: 6c833a1c6320532e251b930b391645b6d2cf86b9
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Mar 31 09:21:19 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6c833a1c6320532e251b930b391645b6d2cf86b9 [^]

related to bug 35634: updated DBSM library with code review improvements

---
M src-db/database/lib/dbsourcemanager.jar
---
(0095748)
alostale   
2017-03-31 09:40   
code reviewed + tested
(0095751)
hgbot   
2017-03-31 10:19   
Repository: erp/devel/dbsm-main
Changeset: f5fc17d3752472414982ac5fc8002f05e0e80d24
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Mar 31 10:18:38 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/f5fc17d3752472414982ac5fc8002f05e0e80d24 [^]

related to bug 35634: centralize set of max active connections in setMaxThreads

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
---
(0095752)
hgbot   
2017-03-31 10:25   
Repository: erp/devel/pi
Changeset: 91233525974fafeed358e7ebf0829aace6e0cc46
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Mar 31 10:24:51 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/91233525974fafeed358e7ebf0829aace6e0cc46 [^]

related to bug 35634: updated DBSM library with code review improvements

---
M src-db/database/lib/dbsourcemanager.jar
---
(0095772)
hudsonbot   
2017-03-31 15:11   
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/2fc0a768a178 [^]
Maturity status: Test
(0095778)
hudsonbot   
2017-04-01 12:06   
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/44185ff76d75 [^]
Maturity status: Test