View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001727 | SymmetricDS | Bug | public | 2014-05-21 22:10 | 2014-06-17 00:27 |
Reporter | brickman | Assigned To | chenson | ||
Priority | normal | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.5.17 | ||||
Target Version | 3.6.0 | Fixed in Version | 3.6.0 | ||
Summary | 0001727: 100% CPU when expiring SYM_DATA_GAP with missing SYM_DATA | ||||
Description | SymmeticDS Version 3.5.17 Database: Firebird 2.5.1 Our database got into a state where we had a large number of SYM_DATA_GAP records (2499). In addition, we had SYM_DATA_EVENT records which did not reference any SYM_DATA records. The following query returned 92 rows select data_id from sym_data_event a where not exists (select * from sym_data b where a.data_id = b.data_id); We are not clear how SymmetricDS got into this state, however from review of org.jumpmind.symmetric.route.DataGapDetector#isDataGapExpired, it looks like this state is expected and is handled. However, when org.jumpmind.symmetric.route.DataGapDetector#isDataGapExpired is called against a Firebird database when in this state, Firebird cannot handle the query which causes SymmetricDS to freeze with 100% CPU utilisation. We isolated the problematic query in org.jumpmind.symmetric.service.impl.DataServiceSqlMap putSql("findNextDataCreateTimeSql", "" + "select create_time from $(data) where data_id in (select min(data_id) from $(data) where data_id >= ?)"); We resolved this issue in our environment by splitting the query up. In org.jumpmind.symmetric.service.impl.DataServiceSqlMap we added putSql("findMinDataSql", "" + "select min(data_id) from $(data) where data_id >= ?"); We changed org.jumpmind.symmetric.service.impl.DataService#findNextCreateTimeOfDataStartingAt to public Date findNextCreateTimeOfDataStartingAt(long dataId) { return findCreateTimeOfData(sqlTemplate.queryForObject(getSql("findMinDataSql"), Long.class, dataId)); } We rebuild the SymmetricDS project with these changes and it successfully expired the SYM_DATA_GAP records and continued syncing as normal. | ||||
Steps To Reproduce | Please refer to the description. The SymmetricDS database was in an unusual state with a large number of SYM_DATA_GAP records and SYM_DATA_EVENT referencing missing SYM_DATA records. | ||||
Additional Information | SymmeticDS Version 3.5.17 Database: Firebird 2.5.1 | ||||
Tags | No tags attached. | ||||
SymmetricDS: master e9c4b7b4 2014-05-22 08:28:28 Details Diff |
0001727: 100% CPU when expiring SYM_DATA_GAP with missing SYM_DATA |
Affected Issues 0001727 |
|
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataService.java | Diff File | ||
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataServiceSqlMap.java | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-05-21 22:10 | brickman | New Issue | |
2014-05-22 12:28 | chenson | Status | new => resolved |
2014-05-22 12:28 | chenson | Fixed in Version | => 3.6.0 |
2014-05-22 12:28 | chenson | Resolution | open => fixed |
2014-05-22 12:28 | chenson | Assigned To | => chenson |
2014-05-22 12:29 | chenson | Note Added: 0000522 | |
2014-05-22 12:29 | chenson | Target Version | => 3.6.0 |
2014-05-22 13:00 | Changeset attached | => SymmetricDS trunk r8285 | |
2014-06-17 00:27 | chenson | Status | resolved => closed |
2015-07-31 01:49 | chenson | Changeset attached | => SymmetricDS master e9c4b7b4 |