logs more metadata when failing to recover head from WAL in TSDB (#8250)

pull/8264/head
Owen Diehl 2 years ago committed by GitHub
parent 4047d7a9c8
commit 944b488bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      pkg/storage/stores/tsdb/head_manager.go

@ -524,11 +524,11 @@ func recoverHead(dir string, heads *tenantHeads, wals []WALIdentifier) error {
if len(rec.Chks.Chks) > 0 {
tenant, ok := seriesMap[rec.UserID]
if !ok {
return errors.New("found tsdb chunk metas without user in WAL replay")
return fmt.Errorf("found tsdb chunk metas without user in WAL replay (period=%s): %+v", id.String(), *rec)
}
x, ok := tenant[rec.Chks.Ref]
if !ok {
return errors.New("found tsdb chunk metas without series in WAL replay")
return fmt.Errorf("found tsdb chunk metas without series in WAL replay (period=%s): %+v", id.String(), *rec)
}
_ = heads.Append(rec.UserID, x.ls, x.fp, rec.Chks.Chks)
}
@ -549,6 +549,10 @@ type WALIdentifier struct {
ts time.Time
}
func (w WALIdentifier) String() string {
return fmt.Sprint(w.ts.Unix())
}
func parseWALPath(p string) (id WALIdentifier, ok bool) {
ts, err := strconv.Atoi(p)
if err != nil {

Loading…
Cancel
Save