mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 14:03:07 +01:00
Backport more complete fix for bug CORE-2993 : Fatal lock manager error "Invalid lock id (NNN)" while working with monitoring tables on a highly loaded system
This commit is contained in:
parent
58b518a2b9
commit
e8a75e91f7
@ -403,6 +403,8 @@ int DatabaseSnapshot::blockingAst(void* ast_object)
|
||||
if (!(dbb->dbb_ast_flags & DBB_monitor_off))
|
||||
{
|
||||
// Write the data to the shared memory
|
||||
if (!(dbb->dbb_flags & DBB_not_in_use))
|
||||
{
|
||||
try
|
||||
{
|
||||
dumpData(tdbb, true);
|
||||
@ -413,9 +415,15 @@ int DatabaseSnapshot::blockingAst(void* ast_object)
|
||||
ex.stuff_exception(status);
|
||||
gds__log_status("Cannot dump the monitoring data", status);
|
||||
}
|
||||
}
|
||||
|
||||
// Release the lock and mark dbb as requesting a new one
|
||||
// Release the lock, if feasible
|
||||
if (!(dbb->dbb_flags & DBB_monitor_locking))
|
||||
{
|
||||
LCK_release(tdbb, lock);
|
||||
}
|
||||
|
||||
// Mark dbb as requesting a new lock
|
||||
dbb->dbb_ast_flags |= DBB_monitor_off;
|
||||
}
|
||||
|
||||
|
@ -4692,7 +4692,9 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
||||
if (dbb->dbb_ast_flags & DBB_monitor_off)
|
||||
{
|
||||
dbb->dbb_ast_flags &= ~DBB_monitor_off;
|
||||
dbb->dbb_flags |= DBB_monitor_locking;
|
||||
LCK_lock(tdbb, dbb->dbb_monitor_lock, LCK_SR, LCK_WAIT);
|
||||
dbb->dbb_flags &= ~DBB_monitor_locking;
|
||||
|
||||
// While waiting for return from LCK_lock call above the blocking AST (see
|
||||
// DatabaseSnapshot::blockingAst) was called and set DBB_monitor_off flag
|
||||
@ -5029,7 +5031,9 @@ static ISC_STATUS check_database(thread_db* tdbb, Attachment* attachment, ISC_ST
|
||||
if (dbb->dbb_ast_flags & DBB_monitor_off)
|
||||
{
|
||||
dbb->dbb_ast_flags &= ~DBB_monitor_off;
|
||||
dbb->dbb_flags |= DBB_monitor_locking;
|
||||
LCK_lock(tdbb, dbb->dbb_monitor_lock, LCK_SR, LCK_WAIT);
|
||||
dbb->dbb_flags &= ~DBB_monitor_locking;
|
||||
|
||||
if (dbb->dbb_ast_flags & DBB_monitor_off)
|
||||
LCK_release(tdbb, dbb->dbb_monitor_lock);
|
||||
|
@ -389,6 +389,8 @@ const ULONG DBB_gc_background = 0x1000000L; // background garbage collection by
|
||||
#if (defined DEV_BUILD && !defined MULTI_THREAD)
|
||||
const ULONG DBB_exec_statement = 0x2000000L; // execute statement runs against database
|
||||
#endif
|
||||
const ULONG DBB_monitor_locking = 0x4000000L; // monitoring lock is being acquired
|
||||
|
||||
//
|
||||
// dbb_ast_flags
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user