Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Log on metadata-read-error in ExtentDown code-path (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran RG authored Sep 18, 2017
1 parent 9b992ae commit eb02de6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions services/controllerhost/event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,20 @@ func (event *ExtentDownEvent) Handle(context *Context) error {

case checkPreconditionState:
stats, err = context.mm.ReadExtentStats(event.dstID, event.extentID)

// if we cannot read the stats, we should fail immediately
if err != nil {
context.m3Client.IncCounter(metrics.ExtentDownEventScope, metrics.ControllerErrMetadataReadCounter)
context.m3Client.IncCounter(metrics.ExtentDownEventScope, metrics.ControllerFailures)
context.log.WithFields(bark.Fields{
common.TagDst: common.FmtDst(event.dstID),
common.TagExt: common.FmtExt(event.extentID),
`error`: err,
}).Error("Cannot read extent stats")
return errRetryable
}

if err == nil && stats.GetStatus() != shared.ExtentStatus_OPEN {
if stats.GetStatus() != shared.ExtentStatus_OPEN {
context.m3Client.IncCounter(metrics.ExtentDownEventScope, metrics.ControllerFailures)
context.log.WithFields(bark.Fields{
common.TagDst: common.FmtDst(event.dstID),
Expand All @@ -834,16 +841,6 @@ func (event *ExtentDownEvent) Handle(context *Context) error {
return nil // non-retryable
}

// if we cannot read the stats, we should fail immediately
if err != nil {
context.m3Client.IncCounter(metrics.ExtentDownEventScope, metrics.ControllerErrMetadataReadCounter)
context.log.WithFields(bark.Fields{
common.TagDst: common.FmtDst(event.dstID),
common.TagExt: common.FmtExt(event.extentID),
`error`: err,
}).Error("Cannot read extent stats")
return errRetryable
}
event.inputID = stats.GetExtent().GetInputHostUUID()
event.storeIDs = stats.GetExtent().GetStoreUUIDs()

Expand Down

0 comments on commit eb02de6

Please sign in to comment.