Skip to content

Commit 625ce77

Browse files
committed
Early diagnostics for the improperly re-initialized replica
1 parent ca73940 commit 625ce77

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/remote/server/ReplServer.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,22 @@ namespace
781781
const FB_UINT64 db_sequence = target->initReplica();
782782
const FB_UINT64 last_db_sequence = control.getDbSequence();
783783

784-
if (db_sequence != last_db_sequence)
784+
if (db_sequence < last_db_sequence)
785+
{
786+
if (db_sequence)
787+
{
788+
raiseError("Replica database was replaced but found to be older (sequence = %" UQUADFORMAT ") "
789+
"than the one priorly processed (sequence = %" UQUADFORMAT ")",
790+
db_sequence, last_db_sequence);
791+
}
792+
else
793+
{
794+
raiseError("Replica database was replaced but found to have zero sequence number,"
795+
"\n\tprobably after improper fixup/restore process (e.g. without -seq[uence] switch)");
796+
}
797+
}
798+
799+
if (db_sequence > last_db_sequence)
785800
{
786801
if (sequence == db_sequence + 1)
787802
{

0 commit comments

Comments
 (0)