Skip to content

Commit

Permalink
Merge pull request #379 from alja/hdfs-heal-fixes
Browse files Browse the repository at this point in the history
pfc-V2 Correction in file sync and detach (related only to hdfs healing mode)
  • Loading branch information
abh3 committed Jun 16, 2016
2 parents 9118903 + 3973423 commit 439ec0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/XrdFileCache/XrdFileCache.cc
Expand Up @@ -188,7 +188,7 @@ void Cache::Detach(XrdOucCacheIO* io)
delete it->file;
}
m_active.erase(it);
break;
if (m_configuration.m_hdfsmode == false) break;
}
else
++it;
Expand Down
6 changes: 3 additions & 3 deletions src/XrdFileCache/XrdFileCacheFile.cc
Expand Up @@ -268,12 +268,12 @@ bool File::Open()
}
else {
m_fileSize = m_fileSize;
int ss = (m_fileSize - 1)/m_cfi.GetBufferSize() + 1;
TRACEF(Debug, "Creating new file info, data size = " << m_fileSize << " num blocks = " << ss);
m_cfi.SetBufferSize(Cache::GetInstance().RefConfiguration().m_bufferSize);
m_cfi.SetFileSize(m_fileSize);
m_cfi.WriteHeader(m_infoFile);
m_infoFile->Fsync();
int ss = (m_fileSize - 1)/m_cfi.GetBufferSize() + 1;
TRACEF(Debug, "Creating new file info, data size = " << m_fileSize << " num blocks = " << ss);
}

if (m_prefetchState != kComplete) cache()->RegisterPrefetchFile(this);
Expand Down Expand Up @@ -753,7 +753,7 @@ void File::Sync()
XrdSysMutexHelper _lck(&m_syncStatusMutex);
for (std::vector<int>::iterator i = m_writes_during_sync.begin(); i != m_writes_during_sync.end(); ++i)
{
m_cfi.SetBitWriteCalled(offsetIdx(*i));
m_cfi.SetBitWriteCalled(*i);
}
written_while_in_sync = m_non_flushed_cnt = (int) m_writes_during_sync.size();
m_writes_during_sync.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/XrdFileCache/XrdFileCacheIOFileBlock.cc
Expand Up @@ -163,7 +163,7 @@ int IOFileBlock::Read (char *buff, long long off, int size)
int idx_first = off0/m_blocksize;
int idx_last = (off0+size-1)/m_blocksize;
int bytes_read = 0;
TRACEIO(Debug, "IOFileBlock::Read() "<< off << "@" << size << " block range ["<< idx_first << ", " << idx_last << "]");
TRACEIO(Dump, "IOFileBlock::Read() "<< off << "@" << size << " block range ["<< idx_first << ", " << idx_last << "]");

for (int blockIdx = idx_first; blockIdx <= idx_last; ++blockIdx )
{
Expand Down Expand Up @@ -212,7 +212,7 @@ int IOFileBlock::Read (char *buff, long long off, int size)
}
assert(readBlockSize);

TRACEIO(Debug, "IOFileBlock::Read() block[ " << blockIdx << "] read-block-size[" << readBlockSize << "], offset[" << readBlockSize << "] off = " << off );
TRACEIO(Dump, "IOFileBlock::Read() block[ " << blockIdx << "] read-block-size[" << readBlockSize << "], offset[" << readBlockSize << "] off = " << off );

long long min = blockIdx*m_blocksize;
if ( off < min) { assert(0); }
Expand Down

0 comments on commit 439ec0c

Please sign in to comment.