do not hit file cache when merging files on disk.

1. it prevents corruption. 2. it drains our cache of good stuff.
This commit is contained in:
Matt Wells 2015-09-11 11:09:15 -07:00
parent 1b9e509a55
commit d0055cda6b
3 changed files with 9 additions and 3 deletions

@ -683,6 +683,7 @@ bool Msg3::readList ( char rdbId ,
////////
BigFile *ff = base->getFile(m_fileNums[i]);
RdbCache *rpc = getDiskPageCache ( m_rdbId );
if ( ! m_allowPageCache ) rpc = NULL;
// . vfd is unique 64 bit file id
// . if file is opened vfd is -1, only set in call to open()
int64_t vfd = ff->getVfd();
@ -1057,6 +1058,7 @@ bool Msg3::doneScanning ( ) {
// compute cache info
RdbCache *rpc = getDiskPageCache ( m_rdbId );
if ( ! m_allowPageCache ) rpc = NULL;
int64_t vfd ;
if ( ff ) vfd = ff->getVfd();
key192_t ck ;

@ -531,6 +531,10 @@ bool Msg5::readList ( ) {
int32_t niceness = m_niceness;
if ( niceness > 0 ) niceness = 2;
if ( m_isRealMerge ) niceness = 1;
bool allowPageCache = true;
// just in case cache is corrupted, do not use it for doing real
// merges, also it would kick out good lists we have in there already
if ( m_isRealMerge ) allowPageCache = false;
if ( compute ) {
m_msg3.readList ( m_rdbId ,
m_collnum ,
@ -547,7 +551,7 @@ bool Msg5::readList ( ) {
m_compensateForMerge ,
-1,//m_syncPoint ,
true , // just get endKey?
m_allowPageCache );
allowPageCache );
if ( g_errno ) {
log("db: Msg5: getting endKey: %s",mstrerrno(g_errno));
return true;

@ -2279,11 +2279,11 @@ void TcpServer::destroySocket ( TcpSocket *s ) {
if ( g_hostdb.m_hostId == 0 ) {
SafeBuf sb;
sb.safePrintf("tcp: closing sd=%i bytessent=%i "
"sendbufsize=%i streaming=%i "
"sendbufused=%i streaming=%i "
"sendbuf=",
s->m_sd,
s->m_sendOffset,
s->m_sendBufSize,
s->m_sendBufUsed,
(int)s->m_streamingMode);
if ( s->m_sendBuf )
sb.safeTruncateEllipsis(s->m_sendBuf,