Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
sergsyb
Contributor III
Contributor III

Is target DB out of sync?

Am I understand correctly following messages mean some changes were not applied to the target DB due to PK violation. Replicator tried to insert row with the same value for PK, which already exists in the target table. From this follows target db is out of sync with the primary?

 

00008296: 2022-08-07T15:31:18 [TARGET_APPLY    ]W:  Source changes that would have had no impact were not applied to the target database. Refer to the 'attrep_apply_exceptions' table for details  (endpointshell.c:7136)

00008296: 2022-08-07T15:31:18 [ASSERTION       ]W:  The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position

 

Labels (1)
1 Solution

Accepted Solutions
lyka
Support
Support

Hello,

 

Wheat ive seen in the field about the error "Error creating Net Changes in Batch Opimized Apply mode" is its related to the attrep_apply_exceptions tables.

 

The fix for the issue on "Error creating Net Changes in Batch Optimized Apply Mode." is as follows:

 

Please modify the columns and  increase the length for the statement and error columns .By default they are set to varchar(8192)

 

As for the message:

2022-08-07T15:34:50 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:00069418:0016' (bulk_apply.c:1703)

 

What the messages means is when we received an Insert record and we tried to add it target but there was already a primary key with that value.

so replicate will not change the record that already exist but put the record into 'attrep_apply_exceptions'

 

Hope this helps!

 

Thanks

Lyka

 

 

View solution in original post

8 Replies
SachinB
Support
Support

Hello @sergsyb ,

These are the warning messages, and considered as there might be other unique indexes that Replicate is actually complaining about.

You can mitigate this message by implementing the recommendations in the article below:

https://community.qlik.com/t5/Knowledge/Qlik-Replicate-Implementing-UPSERT-and-MERGE-modes-by-applyi...

 

Regards,

Sachin B

lyka
Support
Support

Hello,

 

I recommend checking attrep_apply_exceptions and verify the cause of apply errors.

 

Thanks

Lyka

sergsyb
Contributor III
Contributor III
Author

Hello Lyka

There are 5 failed INSERTS in the table attrep_apply_exceptions. Error column of attrep_apply_exceptions contains followed messages for all Inserts
"Error creating Net Changes in Batch Opimized Apply mode. For details, see the task log"

In log we have

2022-08-07T15:31:18 [TARGET_APPLY ]W: Source changes that would have had no impact were not applied to the target database. Refer to the 'attrep_apply_exceptions' table for details (endpointshell.c:7136)
2022-08-07T15:31:18 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:0002f603:0012' (bulk_apply.c:1703)
2022-08-07T15:31:51 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:0003ebd1:0014' (bulk_apply.c:1703)
2022-08-07T15:33:29 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:00057904:0015' (bulk_apply.c:1703)
2022-08-07T15:34:50 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:00069418:0016' (bulk_apply.c:1703)

 

The  strange thing - 3 of 5 failed rows exists on the Target, but 2 are absent

lyka
Support
Support

Hello,

 

What is the target endpoint?

 

Thanks

Lyka

sergsyb
Contributor III
Contributor III
Author

SAP Sybase IQ
lyka
Support
Support

Hello,

 

Wheat ive seen in the field about the error "Error creating Net Changes in Batch Opimized Apply mode" is its related to the attrep_apply_exceptions tables.

 

The fix for the issue on "Error creating Net Changes in Batch Optimized Apply Mode." is as follows:

 

Please modify the columns and  increase the length for the statement and error columns .By default they are set to varchar(8192)

 

As for the message:

2022-08-07T15:34:50 [ASSERTION ]W: The 'INSERT' event received for table 1 after 'INSERT (1)' event with the same primary key at stream position '0004dab3:00069418:0016' (bulk_apply.c:1703)

 

What the messages means is when we received an Insert record and we tried to add it target but there was already a primary key with that value.

so replicate will not change the record that already exist but put the record into 'attrep_apply_exceptions'

 

Hope this helps!

 

Thanks

Lyka

 

 

sergsyb
Contributor III
Contributor III
Author

Thanks Lyka

You wrote "The fix for the issue on "Error creating Net Changes in Batch Optimized Apply Mode." is as follows: Please modify the columns and  increase the length for the statement and error columns .By default they are set to varchar(8192)" 

Please clarify is it means the full error message couldn't fit into Error column of table attrep_apply_exceptions and in such case we can see some general error likes "Error creating Net Changes in Batch ....." . And if we increase the length for the error column we can see REAL error message ?

lyka
Support
Support

Hello,

 

Yes. That's correct

 

Thanks

Lyka