Schedule a full compaction after a successful import

pull/9181/head
Andrew Hare 2017-11-29 13:50:38 -07:00
parent a520ed99ee
commit 761a8f8bec
1 changed files with 5 additions and 1 deletions

View File

@ -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 // Import reads a tar archive generated by Backup() and adds each
// file matching basePath as a new TSM file. This obtains // file matching basePath as a new TSM file. This obtains
// a write lock so no operations can be performed while Importing. // 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 { 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 // overlay reads a tar archive generated by Backup() and adds each file