mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:03:03 +01:00
Fixed #8237: Database access error when nbackup is starting
This commit is contained in:
parent
1db7b07edd
commit
1e6bd16d2c
@ -225,7 +225,29 @@ namespace Jrd {
|
|||||||
if (bak_state != Ods::hdr_nbak_normal)
|
if (bak_state != Ods::hdr_nbak_normal)
|
||||||
diff_page = bm->getPageIndex(tdbb, bdb.bdb_page.getPageNum());
|
diff_page = bm->getPageIndex(tdbb, bdb.bdb_page.getPageNum());
|
||||||
|
|
||||||
|
bool readPageAsNormal = false;
|
||||||
if (bak_state == Ods::hdr_nbak_normal || !diff_page)
|
if (bak_state == Ods::hdr_nbak_normal || !diff_page)
|
||||||
|
readPageAsNormal = true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!bm->readDifference(tdbb, diff_page, page))
|
||||||
|
{
|
||||||
|
if (page->pag_type == 0 && page->pag_generation == 0 && page->pag_scn == 0)
|
||||||
|
{
|
||||||
|
// We encountered a page which was allocated, but never written to the
|
||||||
|
// difference file. In this case we try to read the page from database. With
|
||||||
|
// this approach if the page was old we get it from DISK, and if the page
|
||||||
|
// was new IO error (EOF) or BUGCHECK (checksum error) will be the result.
|
||||||
|
// Engine is not supposed to read a page which was never written unless
|
||||||
|
// this is a merge process.
|
||||||
|
readPageAsNormal = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ERR_punt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (readPageAsNormal)
|
||||||
{
|
{
|
||||||
// Read page from disk as normal
|
// Read page from disk as normal
|
||||||
int retryCount = 0;
|
int retryCount = 0;
|
||||||
@ -247,11 +269,6 @@ namespace Jrd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!bm->readDifference(tdbb, diff_page, page))
|
|
||||||
ERR_punt();
|
|
||||||
}
|
|
||||||
|
|
||||||
setHeader(h);
|
setHeader(h);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user