From ee312b0920809ef6238b770261f6a157ebf4f720 Mon Sep 17 00:00:00 2001 From: dimitr Date: Thu, 26 Jun 2008 11:20:41 +0000 Subject: [PATCH] Final part of the solution for CORE-1938: fixed synchronization. --- src/jrd/dfw.epp | 4 ++++ src/jrd/met.epp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index d8573afe15..254ef2351c 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -3404,6 +3404,7 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, } relation->rel_flags &= ~REL_deleting; + relation->rel_flags &= ~REL_check_existence; return false; case 1: @@ -3476,6 +3477,8 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, isc_arg_string, ERR_cstring(work->dfw_name), isc_arg_end); } + + relation->rel_flags |= REL_check_existence; return true; case 3: @@ -3573,6 +3576,7 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, // Mark relation in the cache as dropped relation->rel_flags |= REL_deleted; relation->rel_flags &= ~REL_deleting; + relation->rel_flags &= ~REL_check_existence; // Release relation triggers MET_release_triggers(tdbb, &relation->rel_pre_store); diff --git a/src/jrd/met.epp b/src/jrd/met.epp index cf662ee03d..81e5412d70 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -2951,9 +2951,11 @@ void MET_post_existence(thread_db* tdbb, jrd_rel* relation) **************************************/ SET_TDBB(tdbb); - if (++relation->rel_use_count == 1 && - !MET_lookup_relation_id(tdbb, relation->rel_id, false)) + relation->rel_use_count++; + + if (!MET_lookup_relation_id(tdbb, relation->rel_id, false)) { + relation->rel_use_count--; ERR_post(isc_relnotdef, isc_arg_string, ERR_string(relation->rel_name), isc_arg_end); } }