18.05.2021 13:52, Omacht András wrote:
FB4 - 4.0.0.2489 We tried the following in both (sync, async) modes: Master: CREATE SEQUENCE TMP_GEN_1; commit; (The sequence was created fine in replicas.) Master: select gen_id(tmp_gen_1, 1) from rdb$database; -- Result: 1 - OK commit; select gen_id(tmp_gen_1, 0) from rdb$database; -- Result: 1 – OK Replica: select gen_id(tmp_gen_1, 0) from rdb$database; -- Result: 0 – This should be 1. Can someone confirm if this is a bug?
This is "as designed". Generators are replicated if you made some modifications and commit them, in other words if you had a chance to store the newly generated values in some tables.
Otherwise (changes were rolled back or transaction is de facto read-only, as in your example), generators are not replicated. IMO, it doesn't make much sense in real life, because the new value is not utilized anyway. Moreover, replicating them unconditionally would negatively affect the performance (if they would be replicated immediately, increment by increment, instead of replicating only the last value as it's done now).
Dmitry Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel