[Bucardo-general] Specific code or trigger to avoid race condition during row deletion in multimaster mode

sym39 marechal.sylvain2 at gmail.com
Mon Jan 19 17:58:06 UTC 2015


Hello all,

Here is my configuration:
- 2 machines A and B
- Multimaster mode (bucardo add sync xxx dbs=A:source B:source)
- All tables are updated by A, and no table are updated by B *except* 
the field "state" of the table "Events" that may be written by B too.

What I am trying to achieve is to avoid one deleted row to be recreated:
-A delete one row
-At "the same time", B update the row by changing the "state" field
-As a result, the line is recreated on A <- That is what I like to avoid

I see the following solution to avoid the line "re"creation:
1) Change the application design to avoid machine B updating the Event 
table. But this is hard to change.
2) Instruct bucardo not to consider the "state"field when filling the 
delta table

What is the best way to achieve 2) ?
-I manually change the bucardo_delta trigger of the Events table by 
creating a specific UPDATE trigger with a WHEN condition that does not 
take into account the "state" field - this seems to work but I find this 
a bit "hackish" because I do it "manually".
-There is a bucardo_custom_trigger table, can it be used for this ?
-Or should I use a specific customcode?
-Or should it work if I use customcols with only "important" columns (I 
guess this is not the goal of customcols, and I am not sure that the 
delta trigger uses colums, but I may be wrong)

Thanks and regards,
Sylvain


More information about the Bucardo-general mailing list