Dmitry, sorry, you are right, I oversimplified the case.

It works well If I create primary key.

We have very complex and long running tests.
We ran the simpliest, which creates hundreds of domains, tables, stored 
procedures, views, triggers and inserting thousands data into tables.
Almost everything is ok with replication, we only have two generators that end 
in different values in the replicas (they are different from the master, they 
remain in the original state in the replicas).

All transactions are commited in the process, it is 100% sure and tables have 
primary keys and the replication log shows no error.

My colleagues and I are trying to find the cause ...

Sorry for the blind noise.

András

-----Original Message-----
From: Dmitry Yemanov [mailto:firebi...@yandex.ru] 
Sent: Tuesday, May 18, 2021 1:46 PM
To: For discussion among Firebird Developers 
<firebird-devel@lists.sourceforge.net>
Subject: Re: [Firebird-devel] Replication - generators' value are not replicated

18.05.2021 14:36, Omacht András wrote:

> Ok, let's see the following example:
> 
> Master:
> CREATE SEQUENCE TMP_GEN_2;
> commit;
> 
> CREATE TABLE TMP_TABLE (
>      VC  VARCHAR(10)
> );
> commit;
> 
> CREATE OR ALTER TRIGGER TMP_TABLE_BIU0 FOR TMP_TABLE ACTIVE BEFORE 
> INSERT OR UPDATE POSITION 0 as declare variable dummy integer; begin
>    dummy = gen_id(tmp_gen_2, 1);
> end
> commit;
> 
> insert into TMP_TABLE (VC) values ('A'); commit;
> -- At this point in master and replica's generator has the same value: 
> 1
> 
> update tmp_table set vc = 'B';
> commit;
> -- At this point master's generator value is 2, but the replica's generator 
> value is 1.

What you should get is a "Table TMP_TABLE has no unique key" error while 
committing the UPDATE statement.


Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to