From a6772875907961017de49bfe4502aedd03f84285 Mon Sep 17 00:00:00 2001 From: davidby-influx <72418212+davidby-influx@users.noreply.github.com> Date: Thu, 12 Sep 2024 08:25:02 -0700 Subject: [PATCH] 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 (cherry picked from commit 5d8d1120e1ba060b0842d533953519fc5cd1aeed) closes https://github.com/influxdata/influxdb/issues/25311 --- tsdb/shard.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tsdb/shard.go b/tsdb/shard.go index 49590af7d32..2bc2823a298 100644 --- a/tsdb/shard.go +++ b/tsdb/shard.go @@ -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) { @@ -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 {