Schedule a full compaction after a successful import
parent
a520ed99ee
commit
761a8f8bec
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue