8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:03:03 +01:00

This should fix bug #8138 : Bugcheck when replicator state is changed concurrently

This commit is contained in:
Vlad Khorsun 2024-05-28 14:28:17 +03:00
parent 9e7f247dea
commit 2375ce0c1a

View File

@ -1141,6 +1141,18 @@ void Attachment::checkReplSetLock(thread_db* tdbb)
void Attachment::invalidateReplSet(thread_db* tdbb, bool broadcast)
{
if (broadcast)
{
// Signal other attachments about the changed state
if (att_repl_lock->lck_logical == LCK_none)
LCK_lock(tdbb, att_repl_lock, LCK_EX, LCK_WAIT);
else
LCK_convert(tdbb, att_repl_lock, LCK_EX, LCK_WAIT);
}
if (att_flags & ATT_repl_reset)
return;
att_flags |= ATT_repl_reset;
if (att_relations)
@ -1152,15 +1164,6 @@ void Attachment::invalidateReplSet(thread_db* tdbb, bool broadcast)
}
}
if (broadcast)
{
// Signal other attachments about the changed state
if (att_repl_lock->lck_logical == LCK_none)
LCK_lock(tdbb, att_repl_lock, LCK_EX, LCK_WAIT);
else
LCK_convert(tdbb, att_repl_lock, LCK_EX, LCK_WAIT);
}
LCK_release(tdbb, att_repl_lock);
}