Skip to content

Commit

Permalink
fixed #582 ALTER percolate index stuck waiting search load; set prefe…
Browse files Browse the repository at this point in the history
…r writer for RT and percolate indexes
  • Loading branch information
tomatolog committed Nov 29, 2018
1 parent 3f7e7eb commit c26a236
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/searchd.cpp
Expand Up @@ -838,7 +838,11 @@ void ServedStats_c::CalcStatsForInterval ( const QueryStatContainer_i * pContain
}

//////////////////////////////////////////////////////////////////////////
ServedIndex_c::ServedIndex_c ( const ServedDesc_t& tDesc )

// want write lock to wipe out reader and not wait readers
// but only for RT and PQ indexes as these operations are rare there
ServedIndex_c::ServedIndex_c ( const ServedDesc_t & tDesc )
: m_tLock ( tDesc.m_eType==eITYPE::RT || tDesc.m_eType==eITYPE::PERCOLATE )
{
*(ServedDesc_t*)(this) = tDesc;
}
Expand Down
5 changes: 5 additions & 0 deletions src/sphinxstd.h
Expand Up @@ -3547,6 +3547,11 @@ class RwLock_t : public CSphRwlock
{
Verify ( Done());
}

explicit RwLock_t ( bool bPreferWriter )
{
Verify ( Init ( bPreferWriter ) );
}
};


Expand Down

0 comments on commit c26a236

Please sign in to comment.