Skip to content

Commit 7d7a810

Browse files
authored
Do not allow the AST thread to release EX lock on a relation while it's in the deleting state (#7252)
The problem is rarely reproduced by bugs.core_2879 test. Without the fix the phase 4 of delete_relation DFW may fail because MET_lookup_relation_id cannot find a relation.
1 parent 0f02101 commit 7d7a810

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/jrd/dfw.epp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4955,6 +4955,7 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
49554955
case 4:
49564956
relation = MET_lookup_relation_id(tdbb, work->dfw_id, true);
49574957
if (!relation) {
4958+
fb_assert(false);
49584959
return false;
49594960
}
49604961

src/jrd/met.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4468,7 +4468,7 @@ static int blocking_ast_relation(void* ast_object)
44684468

44694469
if (relation->rel_use_count)
44704470
relation->rel_flags |= REL_blocking;
4471-
else
4471+
else if (!(relation->rel_flags & REL_deleting))
44724472
{
44734473
relation->rel_flags &= ~REL_blocking;
44744474
relation->rel_flags |= REL_check_existence;

0 commit comments

Comments
 (0)