From 9f94f41e4e2a7f938273e37f5705a00c6fd825b8 Mon Sep 17 00:00:00 2001 From: hvlad Date: Wed, 15 Jun 2011 11:43:42 +0000 Subject: [PATCH] Fixed bug CORE-3521 : Delta file contents is not flushed to disk --- src/jrd/cch.cpp | 9 +++++++++ src/jrd/nbak.cpp | 5 +++++ src/jrd/nbak.h | 1 + 3 files changed, 15 insertions(+) diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index 0afda409d6..bb57f757c5 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -1187,6 +1187,15 @@ void CCH_flush(thread_db* tdbb, USHORT flush_flag, SLONG tra_number) { PIO_flush(dbb, dbb->dbb_shadow->sdw_file); } + + { + BackupManager* bm = dbb->dbb_backup_manager; + BackupManager::StateReadGuard stateGuard(tdbb); + const int backup_state = bm->getState(); + if (backup_state == nbak_state_stalled || backup_state == nbak_state_merge) + bm->flushDifference(); + } + tdbb->bumpStats(RuntimeStatistics::FLUSHES); } diff --git a/src/jrd/nbak.cpp b/src/jrd/nbak.cpp index f6723c6ec7..7573634b78 100644 --- a/src/jrd/nbak.cpp +++ b/src/jrd/nbak.cpp @@ -661,6 +661,11 @@ bool BackupManager::readDifference(thread_db* tdbb, ULONG diff_page, Ods::pag* p return true; } +void BackupManager::flushDifference() +{ + PIO_flush(database, diff_file); +} + BackupManager::BackupManager(thread_db* tdbb, Database* _database, int ini_state) : dbCreating(false), database(_database), diff_file(NULL), alloc_table(NULL), last_allocated_page(0), current_scn(0), diff_name(*_database->dbb_permanent), diff --git a/src/jrd/nbak.h b/src/jrd/nbak.h index 8f1ac93383..ee2aa0193d 100644 --- a/src/jrd/nbak.h +++ b/src/jrd/nbak.h @@ -369,6 +369,7 @@ public: void closeDelta(); bool writeDifference(ISC_STATUS* status, ULONG diff_page, Ods::pag* page); bool readDifference(thread_db* tdbb, ULONG diff_page, Ods::pag* page); + void flushDifference(); void shutdown(thread_db* tdbb);