I am wondering the semantic of the initial.load.delete.first option.
Today I tried setting up a master-slave replication and, during the initial load, I experienced the following exception:
Caused by: java.sql.SQLException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.TblRegolazioneSecondaria' and the index name 'TblRegolazioneSecondaria_PK'. The duplicate key value is (UP_AGRI_1, Jan 2 2014 12:00AM, 1).
The slave node alredy has populated data (from previous backup + tests), in fact I enabled the folliwing options
believing that it would both send schema (it happens) and clear data (is it happening?)
Executing a COUNT(*) over the PK fields on the master returns only unique rows. The same query on the slave returns duplicates.
When is the "initial.load.delete.first" performed? If it's performed after the index creation attempt, it'll just fail.
If this is the expected behaviour, what is the imagined use-case for the delete.first?
Should I manually delete everything from the slave database before setting up the replication?
This appear to happen when the follow flow occurs:
Initial load, Alter a table, Initial Load.
Mainly due to the fact that the delete is not occurring until after the create currently which causes an issue on adding the PK column as part of the alter/create process.
I will open a bug but in the mean time yes, delete everything manually prior to rerunning an initial load when a new key is added and you should be fine.
I am not sure if it can help you, but the flow I followed isn't strictly the one you mentioned. I made multiple experiments on the two databases, everytime performing a bin/symadmin -e (both nodes) uninstall.
So, from SymmetricDS's point of view, there was ever only a single initial load request.
It's true that, in the meanwhile, the keys changed. [In fact, but this might be material for a different bug/thread/request for help, Symmetric won't/cant't properly work on tables with no keys, as it will just duplicate everything.]
Thanks for your reply.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.