Skip to content

Commit

Permalink
do not hit file cache when merging files on disk.
Browse files Browse the repository at this point in the history
1. it prevents corruption. 2. it drains our cache of good stuff.
  • Loading branch information
gigablast committed Sep 11, 2015
1 parent 1b9e509 commit d0055cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Msg3.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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 ;
Expand Down
6 changes: 5 additions & 1 deletion Msg5.cpp
Expand Up @@ -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 ,
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions TcpServer.cpp
Expand Up @@ -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,
Expand Down

0 comments on commit d0055cd

Please sign in to comment.