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

Fixed bug #8094 : Creation Index Error when restore with parallels workers

This commit is contained in:
Vlad Khorsun 2024-04-26 13:09:34 +03:00
parent 7d2ac8f49d
commit e96fc77d50
3 changed files with 57 additions and 1 deletions

View File

@ -1998,6 +1998,61 @@ SLONG DPM_prefetch_bitmap(thread_db* tdbb, jrd_rel* relation, PageBitmap* bitmap
#endif
ULONG DPM_pointer_pages(thread_db* tdbb, jrd_rel* relation)
{
/**************************************
*
* D P M _ p o i n t e r _ p a g e s
*
**************************************
*
* Functional description
* Return the number of pointer pages in a relation.
*
**************************************/
SET_TDBB(tdbb);
const Database* const dbb = tdbb->getDatabase();
#ifdef VIO_DEBUG
VIO_trace(DEBUG_TRACE_ALL,
"DPM_pointer_pages (relation %d)\n", relation->rel_id);
#endif
RelationPages* relPages = relation->getPages(tdbb);
ULONG sequence = relPages->rel_pages ? relPages->rel_pages->count() - 1 : 0;
WIN window(relPages->rel_pg_space_id, -1);
while (true)
{
const pointer_page* ppage =
get_pointer_page(tdbb, relation, relPages, &window, sequence, LCK_read);
if (!ppage)
{
BUGCHECK(243);
// msg 243 missing pointer page in DPM_data_pages
}
const bool eof = (ppage->ppg_header.pag_flags & ppg_eof);
CCH_RELEASE(tdbb, &window);
if (eof)
break;
sequence++;
tdbb->checkCancelState();
}
#ifdef VIO_DEBUG
VIO_trace(DEBUG_TRACE_ALL,
" returned pointer pages: %" ULONGFORMAT"\n", sequence + 1);
#endif
fb_assert(relPages->rel_pages && relPages->rel_pages->count() == sequence + 1);
return sequence + 1;
}
void DPM_scan_pages( thread_db* tdbb)
{
/**************************************

View File

@ -74,6 +74,7 @@ void DPM_pages(Jrd::thread_db*, SSHORT, int, ULONG, ULONG);
#ifdef SUPERSERVER_V2
SLONG DPM_prefetch_bitmap(Jrd::thread_db*, Jrd::jrd_rel*, Jrd::PageBitmap*, SLONG);
#endif
ULONG DPM_pointer_pages(Jrd::thread_db*, Jrd::jrd_rel*);
void DPM_scan_pages(Jrd::thread_db*);
void DPM_store(Jrd::thread_db*, Jrd::record_param*, Jrd::PageStack&, const Jrd::RecordStorageType type);
RecordNumber DPM_store_blob(Jrd::thread_db*, Jrd::blb*, Jrd::Record*);

View File

@ -252,7 +252,7 @@ public:
m_flags |= IS_LARGE_SCAN;
}
m_countPP = m_creation->relation->getPages(tdbb)->rel_pages->count();
m_countPP = DPM_pointer_pages(tdbb, m_creation->relation);
if ((m_creation->index->idx_flags & (idx_expression | idx_condition)) && (workers > 1))
MET_lookup_index_expr_cond_blr(tdbb, m_creation->index_name, m_exprBlob, m_condBlob);