Skip to content

Commit

Permalink
Meta server: fix null pointer de-reference in chunk server hibernatio…
Browse files Browse the repository at this point in the history
…n. Change hibernation message log level in replay to debug. Fix message in retire RPC show method, and retire error message by adding missing spaces. Display remaining to evacuate chunks count in trace message.
  • Loading branch information
mikeov committed Nov 11, 2017
1 parent 066465b commit 67f0ee6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/cc/meta/LayoutManager.cc
Expand Up @@ -6177,7 +6177,7 @@ LayoutManager::Validate(MetaRetireChunkserver& req)
}
req.status = -EPERM;
req.statusMsg = "chunk server retire is deprecated,"
"please use chunk directory evacuation ";
" please use chunk directory evacuation ";
KFS_LOG_STREAM_INFO << req.statusMsg <<
KFS_LOG_EOM;
return false;
Expand Down Expand Up @@ -6208,15 +6208,19 @@ LayoutManager::RetireServer(MetaRetireChunkserver& req)
server->SetRetiring(req.startTime, req.nSecsDown);
if (server->IsHibernating()) {
HibernatedServerInfos::iterator it;
HibernatingServerInfo* const hs =
HibernatingServerInfo* hs =
FindHibernatingCSInfo(req.location, &it);
if (hs) {
hs->sleepEndTime = req.startTime + req.nSecsDown;
} else {
mHibernatingServers.insert(it, HibernatingServerInfo(
it = mHibernatingServers.insert(it, HibernatingServerInfo(
req.location, req.startTime, req.nSecsDown, req.replayFlag));
hs = &*it;
}
KFS_LOG_STREAM_INFO << "hibernating server: " << req.location <<
KFS_LOG_STREAM(req.replayFlag ?
MsgLogger::kLogLevelDEBUG :
MsgLogger::kLogLevelINFO) <<
"hibernating server: " << req.location <<
" down time: " << req.nSecsDown <<
KFS_LOG_EOM;
hs->retiredFlag = true;
Expand Down Expand Up @@ -12085,6 +12089,7 @@ LayoutManager::RemoveRetiring(
(server->IsReplay() ? " replay" : "") <<
" removed: " << retFlag <<
" retiring: " << server->IsRetiring() <<
" chunks: " << server->GetChunkCount() <<
KFS_LOG_EOM;
}
if (server->GetChunkCount() <= 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/cc/meta/MetaRequest.h
Expand Up @@ -1892,7 +1892,7 @@ struct MetaRetireChunkserver : public MetaRequest, public ServerLocation {
return os <<
(nSecsDown > 0 ? "hibernating server: " : "retiring server: ") <<
location <<
"down time: " << nSecsDown
" down time: " << nSecsDown
;
}
bool Validate()
Expand Down

0 comments on commit 67f0ee6

Please sign in to comment.