Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Jan 20, 2022 11:02:45 AM
Apr 7, 2020 12:01:26 PM
Note: the concept ’ UPSERT MODE’ is NOT documented in the User Guide. i.e. it is not a word you can search for in the User Guide and is not a key word in the Replicate UI.
In Change Processing Tuning be aware of the following:
“ Applying cached events in transactional mode to endpoints that do not enforce constraints (such as Vertica and IBM Netezza), may result in duplicate records on the target. This is because such endpoints do not return duplicate errors.” (see User Guide)
Example #1:
Table 'SHIPPING'.'TRANSPORTER_PROFILE' (subtask 1 thread 1) is suspended. RetCode: SQL_SUCCESS SqlState: 23000 NativeError: 2627 Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'TRANSPORTER_PROFILE_PK_TRANSPORTER_PROFILE'. Cannot insert duplicate key in object 'rol.TRANSPORTER_PROFILE'. The duplicate key value is (BNIN , BETTA, EMAIL).; Failed to commit 10000 rows to target 'rol.TRANSPORTER_PROFILE'
Resolution: Upon checking, the record from the source, it contains spaces and after doing a query to trim the records, it was indeed a duplicate record. Customer is expecting duplicate records so they will change the apply error handling. As for full load, they can change the pk for the target or they can filter the "bad record"
Example #2:
Resolved by customer: "I just found out the issue. I had to re-create the table late Friday night and when doing so applied the wrong PK to the table. I was experimenting with results in COMPOSE modelling in TEST and used wrong script when applying to PROD. I will reload prod and let you know whether I still see these issues. You can close this ticket. However, can you tell me whether it would be possible to see these warning in the notifications monitoring via AEM?"
Replicate allows you to set a notification for warnings (written to the log with "W:" as opposed to "E:" for errors). Also if you adjust the error handling settings, AEM can send a notification with the "all errors" notification option:
If there is a Duplicate key when applying INSERT, the Apply Conflicts handling option is set to “Log record to the exceptions table”, no notification will be sent. However, if it is set to Stop task, a notification will be sent.
Example #3:
ISSUE: We got duplicate data in snowflake.
The duplicate data happened about 02/24 12:00PM.
Please help advice how to avoid such issue in future?
I think I need reload the whole task.
Resolution: The issue has to do with applying cached changes after the full load completes. This is the recommended configuration for Snowflake target. In task settings, Change Processing Tuning, disable the checkbox "Apply batched changes to multiple tables concurrently" In Error Handling, Apply conflicts, set Duplicate key when applying INSERT to UPDATE; and No record found for applying an UPDATE to INSERT.