diff --git a/CHANGELOG.md b/CHANGELOG.md index ee819d9e79..45eb7f9e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - [#9084](https://github.com/influxdata/influxdb/pull/9084): Handle high cardinality deletes in TSM engine - [#9162](https://github.com/influxdata/influxdb/pull/9162): Improve inmem index startup performance for high cardinality. - [#8491](https://github.com/influxdata/influxdb/pull/8491): Add further tsi support for streaming/copying shards. +- [#9181](https://github.com/influxdata/influxdb/pull/9181): Schedule a full compaction after a successful import ### Bugfixes diff --git a/tsdb/engine/tsm1/engine.go b/tsdb/engine/tsm1/engine.go index c0271eea4d..f7fe11cb78 100644 --- a/tsdb/engine/tsm1/engine.go +++ b/tsdb/engine/tsm1/engine.go @@ -815,8 +815,12 @@ func (e *Engine) Restore(r io.Reader, basePath string) error { // Import reads a tar archive generated by Backup() and adds each // file matching basePath as a new TSM file. This obtains // a write lock so no operations can be performed while Importing. +// If the import is successful, a full compaction is scheduled. func (e *Engine) Import(r io.Reader, basePath string) error { - return e.overlay(r, basePath, true) + if err := e.overlay(r, basePath, true); err != nil { + return err + } + return e.ScheduleFullCompaction() } // overlay reads a tar archive generated by Backup() and adds each file