Skip to content

Commit

Permalink
Additional fix for correct Nbackup state lock accounting. See also CO…
Browse files Browse the repository at this point in the history
…RE-3465
  • Loading branch information
hvlad committed Jun 15, 2011
1 parent 9f94f41 commit 757ac29
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/jrd/cch.cpp
Expand Up @@ -590,7 +590,6 @@ pag* CCH_fake(thread_db* tdbb, WIN* window, int wait)

if (!write_buffer(tdbb, bdb, bdb->bdb_page, true, tdbb->tdbb_status_vector, true))
{
attachment->backupStateReadUnLock(tdbb);
CCH_unwind(tdbb, true);
}
}
Expand Down Expand Up @@ -2205,15 +2204,22 @@ void CCH_unwind(thread_db* tdbb, const bool punt)
BUGCHECK(268); // msg 268 buffer marked during cache unwind
}

tdbb->getAttachment()->backupStateReadUnLock(tdbb);

if (bdb->ourExclusiveLock()) {
bdb->bdb_flags &= ~(BDB_writer | BDB_faked | BDB_must_write);
if (bdb->ourIOLock())
{
bdb->unLockIO(tdbb);
}
bdb->release(tdbb);
else
{
if (tdbb->getAttachment()) {
tdbb->getAttachment()->backupStateReadUnLock(tdbb);
}

while (bdb->ourIOLock())
bdb->unLockIO(tdbb);
if (bdb->ourExclusiveLock()) {
bdb->bdb_flags &= ~(BDB_writer | BDB_faked | BDB_must_write);
}

bdb->release(tdbb);
}
}
}

Expand Down

0 comments on commit 757ac29

Please sign in to comment.