firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Replication errors

Open aschegolskiy opened this issue 5 months ago • 8 comments

Firebird 5.0.3.1683

Sometimes in our replication.log followning warnings appeared. What could be the reason for such entries?

AZ-VS-DB02 (replica) Tue Jul 22 14:31:57 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being updated in table FSROBOT_MSGBOX does not exist, inserting instead

AZ-VS-DB02 (replica) Tue Jul 22 14:31:57 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being deleted from table FSROBOT_MSGTMP does not exist, ignoring

AZ-VS-DB02 (replica) Tue Jul 22 14:35:59 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being updated in table FSROBOT_MSGBOX does not exist, inserting instead

AZ-VS-DB02 (replica) Tue Jul 22 14:35:59 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being deleted from table FSROBOT_MSGTMP does not exist, ignoring

AZ-VS-DB02 (replica) Tue Jul 22 14:44:55 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being updated in table FSROBOT_MSGBOX does not exist, inserting instead

AZ-VS-DB02 (replica) Tue Jul 22 14:44:55 2025 Database: E:\DB_REPL\DB_AZ.IB WARNING: Record being deleted from table FSROBOT_MSGTMP does not exist, ignoring

aschegolskiy avatar Jul 22 '25 13:07 aschegolskiy

And also following entries:

AZ-VS-DB02 (replica) Tue Jul 22 16:27:10 2025 Database: E:\DB_REPL\DB_AZ.IB ERROR: violation of FOREIGN KEY constraint "FK_CLIENTLAST_1" on table "CLIENTLAST" Foreign key reference target does not exist Problematic key value is ("CUL_FROM_C_ID" = 1010100528859) At segment 14912, offset 4339

aschegolskiy avatar Jul 22 '25 13:07 aschegolskiy

It looks like you have read-write replica and someone mess with data in the target database so data conflicts happen.

aafemt avatar Jul 22 '25 14:07 aafemt

It looks like you have read-write replica and someone mess with data in the target database so data conflicts happen.

No, it's in read only mode. I double checked script and using query on replica:

select rdb$get_context('SYSTEM', 'REPLICA_MODE')
from rdb$database
---
READ-ONLY

aschegolskiy avatar Jul 22 '25 18:07 aschegolskiy

How long ago (and on which FB version) the replica was re-initialized the last time?

dyemanov avatar Jul 24 '25 07:07 dyemanov

We usually re-initialize replica every week (on Sundays), after backup/restore DB. It was done on July 20th before above mentioned logs. We tried to find the reason for these errors. There is a suspicion that the reason was the deletion of old archive logs. To avoid a conflict when a log file arrives for an old replica, but we have already done reinitialization. Now we do not delete old archive logs, and this week such errors did not occur.

aschegolskiy avatar Jul 28 '25 09:07 aschegolskiy

We'll keep an eye on the logs some more and I'll write the results.

aschegolskiy avatar Jul 28 '25 09:07 aschegolskiy

on which FB version Firebird 5.0.3.1683

aschegolskiy avatar Jul 28 '25 09:07 aschegolskiy

As for now, the issue was caused by our deleting "old' archive logs. We disabled backup script code which does deletion, and got no errors and warnings mentioned above . But I suspect there is no check for the first archive log, when nbackup used for reinitialization.

aschegolskiy avatar Jul 30 '25 08:07 aschegolskiy