View Issue Details

IDProjectCategoryView StatusLast Update
0005070SymmetricDSBugpublic2021-11-04 14:58
Reportermuhammedc Assigned Torudiejd  
Priorityhigh 
Status closedResolutionfixed 
Product Version3.12.10 
Target Version3.12.12Fixed in Version3.12.12 
Summary0005070: Error on purge on Firebird DB with Dialect 1
DescriptionTheres an error when the purge run occurs on a firebird db using dialect 1. When SymmetricDS creates the sym_batch_outgoing table it uses the following script:

CREATE TABLE SYM_OUTGOING_BATCH(
    BATCH_ID NUMERIC(18) NOT NULL,
    NODE_ID VARCHAR(50) NOT NULL,
    CHANNEL_ID VARCHAR(128),
    STATUS CHAR(2),
    ERROR_FLAG SMALLINT DEFAULT 0,
    SQL_STATE VARCHAR(10),
    SQL_CODE INTEGER DEFAULT 0 NOT NULL,
    SQL_MESSAGE BLOB SUB_TYPE TEXT,
    LAST_UPDATE_HOSTNAME VARCHAR(255),
    LAST_UPDATE_TIME TIMESTAMP,
    CREATE_TIME TIMESTAMP,
    SUMMARY VARCHAR(255),
    IGNORE_COUNT INTEGER DEFAULT 0 NOT NULL,
    BYTE_COUNT NUMERIC(18) DEFAULT 0 NOT NULL,
    LOAD_FLAG SMALLINT DEFAULT 0,
    EXTRACT_COUNT INTEGER DEFAULT 0 NOT NULL,
    SENT_COUNT INTEGER DEFAULT 0 NOT NULL,
    LOAD_COUNT INTEGER DEFAULT 0 NOT NULL,
    RELOAD_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    OTHER_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    DATA_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    LOAD_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    DATA_INSERT_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    DATA_UPDATE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    DATA_DELETE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_INSERT_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_UPDATE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_DELETE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    LOAD_INSERT_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    LOAD_UPDATE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    LOAD_DELETE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    NETWORK_MILLIS INTEGER DEFAULT 0 NOT NULL,
    FILTER_MILLIS INTEGER DEFAULT 0 NOT NULL,
    LOAD_MILLIS INTEGER DEFAULT 0 NOT NULL,
    ROUTER_MILLIS INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_MILLIS INTEGER DEFAULT 0 NOT NULL,
    TRANSFORM_EXTRACT_MILLIS INTEGER DEFAULT 0 NOT NULL,
    TRANSFORM_LOAD_MILLIS INTEGER DEFAULT 0 NOT NULL,
    LOAD_ID NUMERIC(18),
    COMMON_FLAG SMALLINT DEFAULT 0,
    FALLBACK_INSERT_COUNT INTEGER DEFAULT 0 NOT NULL,
    FALLBACK_UPDATE_COUNT INTEGER DEFAULT 0 NOT NULL,
    IGNORE_ROW_COUNT INTEGER DEFAULT 0 NOT NULL,
    MISSING_DELETE_COUNT INTEGER DEFAULT 0 NOT NULL,
    SKIP_COUNT INTEGER DEFAULT 0 NOT NULL,
    TOTAL_EXTRACT_MILLIS INTEGER DEFAULT 0 NOT NULL,
    TOTAL_LOAD_MILLIS INTEGER DEFAULT 0 NOT NULL,
    EXTRACT_JOB_FLAG SMALLINT DEFAULT 0,
    EXTRACT_START_TIME TIMESTAMP,
    TRANSFER_START_TIME TIMESTAMP,
    LOAD_START_TIME TIMESTAMP,
    FAILED_DATA_ID NUMERIC(18) DEFAULT 0 NOT NULL,
    FAILED_LINE_NUMBER NUMERIC(18) DEFAULT 0 NOT NULL,
    CREATE_BY VARCHAR(255),
    PRIMARY KEY (BATCH_ID, NODE_ID)
)

However, when the table is created, the BATCH_ID field changes from NUMERIC(18) to DOUBLE PRECISION. When SymmetricDS tries to purge the table, it is expecting an INTERGER (NUMERIC(18)) but finds the DOUBLE PRECISION and fails with the following error:

2021-08-13 11:03:13,580 INFO [client_db-cl_0310948] [PurgeService] [main] Looking for old channels in batches
2021-08-13 11:03:13,580 INFO [client_db-cl_0310948] [PurgeService] [main] Getting range for data
2021-08-13 11:03:13,596 INFO [client_db-cl_0310948] [PurgeService] [main] Failed to execute purge, but will try again, StackTraceKey.init [NumberFormatException:3670024406] java.lang.NumberFormatException: For input string: "22.0"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Long.parseLong(Unknown Source)
    at java.lang.Long.valueOf(Unknown Source)
    at org.jumpmind.db.sql.Row.longValue(Row.java:121)
    at org.jumpmind.db.sql.mapper.LongMapper.mapRow(LongMapper.java:29)
    at org.jumpmind.db.sql.mapper.LongMapper.mapRow(LongMapper.java:26)
    at org.jumpmind.db.sql.JdbcSqlReadCursor.next(JdbcSqlReadCursor.java:139)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:216)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:206)
    at org.jumpmind.db.sql.AbstractSqlTemplate.query(AbstractSqlTemplate.java:196)
    at org.jumpmind.symmetric.service.impl.PurgeService.getMaxDataIdEligibleToPurge(PurgeService.java:413)
    at org.jumpmind.symmetric.service.impl.PurgeService.purgeDataRows(PurgeService.java:368)
    at org.jumpmind.symmetric.service.impl.PurgeService.purgeOutgoing(PurgeService.java:128)
    at org.jumpmind.symmetric.service.impl.PurgeService.purgeOutgoing(PurgeService.java:91)
    at org.jumpmind.symmetric.SymmetricAdmin.runPurge(SymmetricAdmin.java:474)
    at org.jumpmind.symmetric.SymmetricAdmin.executeWithOptions(SymmetricAdmin.java:360)
    at org.jumpmind.symmetric.AbstractCommandLauncher.execute(AbstractCommandLauncher.java:184)
    at org.jumpmind.symmetric.SymmetricAdmin.main(SymmetricAdmin.java:176)

2021-08-13 11:03:13,596 INFO [client_db-cl_0310948] [PurgeService] [main] The outgoing purge process is about to run for data older than 13 Aug 2021 9:03:13 AM
2021-08-13 11:03:13,596 INFO [client_db-cl_0310948] [PurgeService] [main] Looking for old nodes in batches
2021-08-13 11:03:13,596 INFO [client_db-cl_0310948] [PurgeService] [main] Looking for old channels in batches
2021-08-13 11:03:13,596 INFO [client_db-cl_0310948] [PurgeService] [main] Getting range for data
2021-08-13 11:03:13,611 ERROR [client_db-cl_0310948] [PurgeService] [main] Failed to execute purge, so aborting, StackTraceKey [NumberFormatException:3670024406]
2021-08-13 11:03:13,611 INFO [client_db-cl_0310948] [PurgeService] [main] The outgoing purge process has completed
Steps To ReproduceUse Firebird as one of the DB's set as dialect 1
Tagsdialect: firebird

Activities

rudiejd

2021-08-18 16:00

developer   ~0001999

Looks like a problem with the precision of our BATCH_ID. In dialect 1, a NUMERIC with precision > 9 is stored as DOUBLE PRECISION.

muhammedc

2021-08-19 08:08

reporter   ~0002000

fyi notes - apologies for the delay:
problem noted on Firebird 2.5 (reproduced on windows version).
Have not tested other versions of firebird or platforms - though i suspect similar results

Issue History

Date Modified Username Field Change
2021-08-13 10:01 muhammedc New Issue
2021-08-18 13:25 rudiejd Assigned To => rudiejd
2021-08-18 13:25 rudiejd Status new => assigned
2021-08-18 16:00 rudiejd Note Added: 0001999
2021-08-18 16:42 rudiejd Tag Attached: dialect: firebird
2021-08-19 08:08 muhammedc Note Added: 0002000
2021-09-22 19:09 elong Status assigned => resolved
2021-09-22 19:09 elong Resolution open => fixed
2021-09-22 19:09 elong Fixed in Version => 3.12.12
2021-09-22 19:09 elong Target Version => 3.12.12
2021-11-04 14:58 admin Status resolved => closed