Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dard committed Jul 5, 2017
1 parent 0748d28 commit 101af89
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
- [#8466](https://github.com/influxdata/influxdb/issues/8466): illumos build broken on syscall.Mmap
- [#8124](https://github.com/influxdata/influxdb/issues/8124): Prevent privileges on non-existent databases from being set.

## v1.3.0 [unreleased]
## v1.3.1 [unreleased]

### Bugfixes

- [#8559](https://github.com/influxdata/influxdb/issues/8559): Ensure temporary TSM files get cleaned up when compaction aborted.


## v1.3.0 [2017-06-21]

### Release Notes

Expand Down
25 changes: 7 additions & 18 deletions tsdb/engine/tsm1/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,7 @@ func (c *Compactor) CompactFull(tsmFiles []string) ([]string, error) {
c.mu.RUnlock()

if !enabled {
c.mu.Lock()
defer c.mu.Unlock()
if err := c.cleanupDisabledCompaction(tsmFiles); err != nil {
if err := c.removeTmpFiles(files); err != nil {
return nil, err
}
return nil, errCompactionsDisabled
Expand Down Expand Up @@ -782,9 +780,7 @@ func (c *Compactor) CompactFast(tsmFiles []string) ([]string, error) {
c.mu.RUnlock()

if !enabled {
c.mu.Lock()
defer c.mu.Unlock()
if err := c.cleanupDisabledCompaction(tsmFiles); err != nil {
if err := c.removeTmpFiles(files); err != nil {
return nil, err
}
return nil, errCompactionsDisabled
Expand All @@ -794,19 +790,12 @@ func (c *Compactor) CompactFast(tsmFiles []string) ([]string, error) {

}

// cleanupDisabledCompaction is responsible for cleaning up a compaction that
// removeTmpFiles is responsible for cleaning up a compaction that
// was started, but then abandoned before the temporary files were dealt with.
func (c *Compactor) cleanupDisabledCompaction(tsmFiles []string) error {
for _, f := range tsmFiles {
files, err := filepath.Glob(filepath.Join(filepath.Dir(f), fmt.Sprintf("*.%s", CompactionTempExtension)))
if err != nil {
return fmt.Errorf("error cleaning up compaction temp files: %s", err.Error())
}

for _, f := range files {
if err := os.Remove(f); err != nil {
return fmt.Errorf("error removing temp compaction file: %v", err)
}
func (c *Compactor) removeTmpFiles(files []string) error {
for _, f := range files {
if err := os.Remove(f); err != nil {
return fmt.Errorf("error removing temp compaction file: %v", err)
}
}
return nil
Expand Down

0 comments on commit 101af89

Please sign in to comment.