Skip to content

Commit

Permalink
fix: add additional logging on loading fields.idxl files (#25309) (#2…
Browse files Browse the repository at this point in the history
…5319) (#25324)

Log the path of the file being loaded, and when level=debug
log progress for each set of field changes

closes #25289

(cherry picked from commit 5d8d112)

closes #25311

(cherry picked from commit 96c97a7)

closes #25313
  • Loading branch information
davidby-influx authored Sep 12, 2024
1 parent f302d97 commit 46086c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,15 @@ func (fscm *measurementFieldSetChangeMgr) loadAllFieldChanges(log *zap.Logger) (
return nil
}
})()
changesetCount := 0
totalChanges := 0
for fcs, err = fscm.loadFieldChangeSet(fd); err == nil; fcs, err = fscm.loadFieldChangeSet(fd) {
totalChanges += len(fcs)
changesetCount++
log.Debug("loading field change set",
zap.Int("set", changesetCount),
zap.Int("changes", len(fcs)),
zap.Int("total_changes", totalChanges))
changes = append(changes, fcs)
}
if errors.Is(err, io.EOF) {
Expand Down Expand Up @@ -2543,7 +2551,7 @@ func (fscm *measurementFieldSetChangeMgr) loadFieldChangeSet(r io.Reader) (Field
}

func (fs *MeasurementFieldSet) ApplyChanges() error {
log, end := logger.NewOperation(context.TODO(), fs.changeMgr.logger, "loading changes", "field indices")
log, end := logger.NewOperation(context.TODO(), fs.changeMgr.logger, "loading changes", "field indices", zap.String("path", fs.changeMgr.changeFilePath))
defer end()
changes, err := fs.changeMgr.loadAllFieldChanges(log)
if err != nil {
Expand Down

0 comments on commit 46086c8

Please sign in to comment.