"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/jrd/nbak.cpp" between
Firebird-3.0.2.32703-0.tar.bz2 and Firebird-3.0.4.33054-0.tar.bz2

About: Firebird is a relational database offering many ANSI SQL standard features.

nbak.cpp  (Firebird-3.0.2.32703-0.tar.bz2):nbak.cpp  (Firebird-3.0.4.33054-0.tar.bz2)
skipping to change at line 406 skipping to change at line 406
} }
}; };
PioCount pioCount(tdbb->getDatabase()); PioCount pioCount(tdbb->getDatabase());
return PAG_page_count(tdbb, &pioCount); return PAG_page_count(tdbb, &pioCount);
} }
bool BackupManager::extendDatabase(thread_db* tdbb) bool BackupManager::extendDatabase(thread_db* tdbb)
{ {
if (!alloc_table)
{
LocalAllocWriteGuard localAllocGuard(this);
actualizeAlloc(tdbb, false);
}
ULONG maxPage = 0; ULONG maxPage = 0;
{ {
LocalAllocReadGuard localAllocGuard(this); LocalAllocReadGuard localAllocGuard(this);
AllocItemTree::Accessor all(alloc_table); AllocItemTree::Accessor all(alloc_table);
if (all.getFirst()) if (all.getFirst())
{ {
do do
{ {
const ULONG pg = all.current().db_page; const ULONG pg = all.current().db_page;
skipping to change at line 564 skipping to change at line 570
actualizeAlloc(tdbb, true); actualizeAlloc(tdbb, true);
} }
LocalAllocReadGuard localAllocGuard(this); LocalAllocReadGuard localAllocGuard(this);
NBAK_TRACE(("Merge. Alloc table is actualized.")); NBAK_TRACE(("Merge. Alloc table is actualized."));
AllocItemTree::Accessor all(alloc_table); AllocItemTree::Accessor all(alloc_table);
if (all.getFirst()) if (all.getFirst())
{ {
int n = 0;
do { do {
if (--tdbb->tdbb_quantum < 0) if (--tdbb->tdbb_quantum < 0)
JRD_reschedule(tdbb, QUANTUM, true); JRD_reschedule(tdbb, QUANTUM, true);
WIN window2(DB_PAGE_SPACE, all.current().db_page) ; WIN window2(DB_PAGE_SPACE, all.current().db_page) ;
NBAK_TRACE(("Merge page %d, diff=%d", all.current ().db_page, all.current().diff_page)); NBAK_TRACE(("Merge page %d, diff=%d", all.current ().db_page, all.current().diff_page));
Ods::pag* page = CCH_FETCH(tdbb, &window2, LCK_wr ite, pag_undefined); Ods::pag* page = CCH_FETCH(tdbb, &window2, LCK_wr ite, pag_undefined);
NBAK_TRACE(("Merge: page %d is fetched", all.curr ent().db_page)); NBAK_TRACE(("Merge: page %d is fetched", all.curr ent().db_page));
if (page->pag_scn != current_scn) if (page->pag_scn != current_scn)
{ {
CCH_MARK(tdbb, &window2); CCH_MARK_SYSTEM(tdbb, &window2);
NBAK_TRACE(("Merge: page %d is marked", a ll.current().db_page)); NBAK_TRACE(("Merge: page %d is marked", a ll.current().db_page));
} }
CCH_RELEASE(tdbb, &window2); CCH_RELEASE(tdbb, &window2);
NBAK_TRACE(("Merge: page %d is released", all.cur rent().db_page)); NBAK_TRACE(("Merge: page %d is released", all.cur rent().db_page));
if (++n == 512)
{
CCH_flush(tdbb, FLUSH_SYSTEM, 0);
n = 0;
}
} while (all.getNext()); } while (all.getNext());
} }
CCH_flush(tdbb, FLUSH_ALL, 0); CCH_flush(tdbb, FLUSH_ALL, 0);
NBAK_TRACE(("Merging is over. Database unlocked")); NBAK_TRACE(("Merging is over. Database unlocked"));
} }
catch (const Firebird::Exception&) catch (const Firebird::Exception&)
{ {
endLock.unlockWrite(tdbb); endLock.unlockWrite(tdbb);
throw; throw;
 End of changes. 4 change blocks. 
1 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)