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

More strict fix for bug CORE-5436 : [FB3 SC] Server hangs (under load test)

This commit is contained in:
hvlad 2018-06-18 13:51:44 +03:00
parent 214681c4a5
commit 91b7436451

View File

@ -275,22 +275,12 @@ int CCH_down_grade_dbb(void* ast_object)
for (const bcb_repeat* const end = tail + bcb->bcb_count; tail < end; ++tail)
{
BufferDesc* bdb = tail->bcb_bdb;
if (bdb->bdb_flags & BDB_no_blocking_ast)
{
// Acquire EX latch to avoid races with LCK_release (called by CCH_release)
// in main thread. See CORE-5436
SyncLockGuard guard(&bdb->bdb_syncPage, SYNC_EXCLUSIVE, FB_FUNCTION);
PAGE_LOCK_ASSERT(tdbb, bcb, bdb->bdb_lock);
}
else
{
// CCH_release in main thread can't call LCK_re_post as there is no
// page buffers with BDB_blocking flag set as this moment. Thus we don't
// need to protect against race condition.
// Acquire EX latch to avoid races with LCK_release (called by CCH_release)
// or LCK_lock (by lock_buffer) in main thread. See CORE-5436
SyncLockGuard guard(&bdb->bdb_syncPage, SYNC_EXCLUSIVE, FB_FUNCTION);
PAGE_LOCK_ASSERT(tdbb, bcb, bdb->bdb_lock);
}
PAGE_LOCK_ASSERT(tdbb, bcb, bdb->bdb_lock);
}
}
}