8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

Fixed #8237: Database access error when nbackup is starting

(cherry picked from commit 1e6bd16d2c)
This commit is contained in:
AlexPeshkoff 2024-09-02 16:21:14 +03:00
parent 3e62713977
commit 47327a17b9

View File

@ -228,7 +228,29 @@ namespace Jrd {
if (bak_state != Ods::hdr_nbak_normal)
diff_page = bm->getPageIndex(tdbb, bdb.bdb_page.getPageNum());
bool readPageAsNormal = false;
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
int retryCount = 0;
@ -250,11 +272,6 @@ namespace Jrd {
}
}
}
else
{
if (!bm->readDifference(tdbb, diff_page, page))
ERR_punt();
}
setHeader(h);
}