fix: add additional logging on loading fields.idxl files (#25309)

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

closes https://github.com/influxdata/influxdb/issues/25289
pull/25334/head
davidby-influx 2024-09-12 08:25:02 -07:00 committed by GitHub
parent 7dc8b1d648
commit 5d8d1120e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -2243,7 +2243,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) {
@ -2287,7 +2295,7 @@ func (fscm *measurementFieldSetChangeMgr) loadFieldChangeSet(r io.Reader) (Field
}
func (fs *MeasurementFieldSet) ApplyChanges() error {
log, end := logger.NewOperation(fs.changeMgr.logger, "loading changes", "field indices")
log, end := logger.NewOperation(fs.changeMgr.logger, "loading changes", "field indices", zap.String("path", fs.changeMgr.changeFilePath))
defer end()
changes, err := fs.changeMgr.loadAllFieldChanges(log)
if err != nil {