mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 10:06:14 +00:00
add when load datapartition failed,then warn
Signed-off-by: awzhgw <guowl18702995996@gmail.com>
This commit is contained in:
parent
76ac26b91e
commit
38164ada4b
@ -289,8 +289,10 @@ func (d *Disk) RestorePartition(visitor PartitionVisitor) {
|
||||
)
|
||||
defer wg.Done()
|
||||
if dp, err = LoadDataPartition(path.Join(d.Path, filename), d); err != nil {
|
||||
log.LogError(fmt.Sprintf("action[RestorePartition] new partition(%v) err(%v) ",
|
||||
partitionID, err.Error()))
|
||||
mesg:=fmt.Sprintf("action[RestorePartition] new partition(%v) err(%v) ",
|
||||
partitionID, err.Error())
|
||||
log.LogError(mesg)
|
||||
exporter.NewAlarm(mesg)
|
||||
return
|
||||
}
|
||||
if visitor != nil {
|
||||
|
||||
@ -40,13 +40,13 @@ type Alarm struct {
|
||||
Counter
|
||||
}
|
||||
|
||||
func NewAlarm(key string) (a *Alarm) {
|
||||
func NewAlarm(detail string) (a *Alarm) {
|
||||
if !enabled {
|
||||
ump.Alarm(fmt.Sprintf("%v_%v_warning", clustername, modulename), key)
|
||||
ump.Alarm(fmt.Sprintf("%v_%v_warning", clustername, modulename), detail)
|
||||
return
|
||||
}
|
||||
a = AlarmPool.Get().(*Alarm)
|
||||
a.name = metricsName(fmt.Sprintf("%s_alarm", key))
|
||||
a.name = metricsName(fmt.Sprintf("%s_alarm", detail))
|
||||
a.Add(1)
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user