8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:43:04 +01:00
This commit is contained in:
asfernandes 2015-06-29 01:02:52 +00:00
parent eedd10643b
commit ae30b29011
9 changed files with 52 additions and 44 deletions

View File

@ -391,6 +391,7 @@ int jrd_rel::blocking_ast_gcLock(void* ast_object)
SW - gc allowed, usual state SW - gc allowed, usual state
PW - gc allowed to the one connection only PW - gc allowed to the one connection only
****/ ****/
jrd_rel* relation = static_cast<jrd_rel*>(ast_object); jrd_rel* relation = static_cast<jrd_rel*>(ast_object);
try try
@ -401,7 +402,7 @@ int jrd_rel::blocking_ast_gcLock(void* ast_object)
AsyncContextHolder tdbb(dbb, FB_FUNCTION); AsyncContextHolder tdbb(dbb, FB_FUNCTION);
fb_assert(!(relation->rel_flags & REL_gc_lockneed)); fb_assert(!(relation->rel_flags & REL_gc_lockneed));
if (relation->rel_flags & REL_gc_lockneed) // work already done syncronously ? if (relation->rel_flags & REL_gc_lockneed) // work already done synchronously ?
return 0; return 0;
relation->rel_flags |= REL_gc_blocking; relation->rel_flags |= REL_gc_blocking;

View File

@ -248,6 +248,7 @@ public:
static Lock* createLock(thread_db* tdbb, MemoryPool* pool, jrd_rel* relation, lck_t, bool); static Lock* createLock(thread_db* tdbb, MemoryPool* pool, jrd_rel* relation, lck_t, bool);
static int blocking_ast_gcLock(void*); static int blocking_ast_gcLock(void*);
void downgradeGCLock(thread_db* tdbb); void downgradeGCLock(thread_db* tdbb);
bool acquireGCLock(thread_db* tdbb, int wait); bool acquireGCLock(thread_db* tdbb, int wait);
@ -350,8 +351,8 @@ inline RelationPages* jrd_rel::getPages(thread_db* tdbb, TraNumber tran, bool al
/// class jrd_rel::GCShared /// class jrd_rel::GCShared
inline jrd_rel::GCShared::GCShared(thread_db* tdbb, jrd_rel* relation) : inline jrd_rel::GCShared::GCShared(thread_db* tdbb, jrd_rel* relation)
m_tdbb(tdbb), : m_tdbb(tdbb),
m_relation(relation), m_relation(relation),
m_gcEnabled(false) m_gcEnabled(false)
{ {

View File

@ -50,8 +50,8 @@ void LCK_write_data(Jrd::thread_db*, Jrd::Lock*, SLONG);
class AutoLock class AutoLock
{ {
public: public:
explicit AutoLock(Jrd::thread_db* tdbb, Jrd::Lock* lck = NULL) : explicit AutoLock(Jrd::thread_db* tdbb, Jrd::Lock* lck = NULL)
m_tdbb(tdbb), : m_tdbb(tdbb),
m_lock(lck) m_lock(lck)
{ {
} }

View File

@ -690,6 +690,7 @@ static int validate(Firebird::UtilSvc* svc)
const Switches valSwitches(val_option_in_sw_table, FB_NELEM(val_option_in_sw_table), false, true); const Switches valSwitches(val_option_in_sw_table, FB_NELEM(val_option_in_sw_table), false, true);
const char** argv = svc->argv.begin(); const char** argv = svc->argv.begin();
const char* const* end = svc->argv.end(); const char* const* end = svc->argv.end();
for (++argv; argv < end; argv++) for (++argv; argv < end; argv++)
{ {
if (!*argv) if (!*argv)
@ -972,9 +973,9 @@ void Validation::output(const char* format, ...)
int ms; int ms;
TimeStamp::getCurrentTimeStamp().decode(&now, &ms); TimeStamp::getCurrentTimeStamp().decode(&now, &ms);
// s.printf("%04d-%02d-%02d %02d:%02d:%02d.%04d ", ///s.printf("%04d-%02d-%02d %02d:%02d:%02d.%04d ",
s.printf("%02d:%02d:%02d.%02d ", s.printf("%02d:%02d:%02d.%02d ",
// now.tm_year + 1900, now.tm_mon + 1, now.tm_mday, ///now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
now.tm_hour, now.tm_min, now.tm_sec, ms / 100); now.tm_hour, now.tm_min, now.tm_sec, ms / 100);
vdr_service->outputVerbose(s.c_str()); vdr_service->outputVerbose(s.c_str());
@ -1581,16 +1582,20 @@ void Validation::walk_database()
vdr_tab_incl->reset(); vdr_tab_incl->reset();
if (!vdr_tab_incl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) || if (!vdr_tab_incl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) ||
!vdr_tab_incl->result()) !vdr_tab_incl->result())
{
continue; continue;
} }
}
if (vdr_tab_excl) if (vdr_tab_excl)
{ {
vdr_tab_excl->reset(); vdr_tab_excl->reset();
if (!vdr_tab_excl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) || if (!vdr_tab_excl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) ||
vdr_tab_excl->result()) vdr_tab_excl->result())
{
continue; continue;
} }
}
string relName; string relName;
relName.printf("Relation %d (%s)", relation->rel_id, relation->rel_name.c_str()); relName.printf("Relation %d (%s)", relation->rel_id, relation->rel_name.c_str());
@ -2708,7 +2713,7 @@ Validation::RTN Validation::walk_relation(jrd_rel* relation)
} }
WIN window(DB_PAGE_SPACE, -1); WIN window(DB_PAGE_SPACE, -1);
header_page* page = 0; header_page* page = NULL;
fetch_page(false, (SLONG) HEADER_PAGE, pag_header, &window, &page); fetch_page(false, (SLONG) HEADER_PAGE, pag_header, &window, &page);
vdr_max_transaction = page->hdr_next_transaction; vdr_max_transaction = page->hdr_next_transaction;
CCH_RELEASE(vdr_tdbb, &window); CCH_RELEASE(vdr_tdbb, &window);

View File

@ -862,7 +862,7 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
{ // scope { // scope
jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation); jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation);
if (attachment->att_flags & ATT_NO_CLEANUP || !gcGuard.gcEnabled() || if ((attachment->att_flags & ATT_NO_CLEANUP) || !gcGuard.gcEnabled() ||
(rpb->rpb_flags & (rpb_chained | rpb_gc_active))) (rpb->rpb_flags & (rpb_chained | rpb_gc_active)))
{ {
if (rpb->rpb_b_page == 0) if (rpb->rpb_b_page == 0)
@ -1939,7 +1939,7 @@ bool VIO_garbage_collect(thread_db* tdbb, record_param* rpb, const jrd_tra* tran
jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation); jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation);
if (attachment->att_flags & ATT_no_cleanup || !gcGuard.gcEnabled()) if ((attachment->att_flags & ATT_no_cleanup) || !gcGuard.gcEnabled())
return true; return true;
const TraNumber oldest_snapshot = rpb->rpb_relation->isTemporary() ? const TraNumber oldest_snapshot = rpb->rpb_relation->isTemporary() ?
@ -3643,6 +3643,7 @@ bool VIO_sweep(thread_db* tdbb, jrd_tra* transaction, TraceSweepEvent* traceSwee
ERR_punt(); ERR_punt();
} }
return ret; return ret;
} }