Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilder committed May 18, 2016
1 parent d32ad26 commit f2bcf9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions tsdb/engine/tsm1/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,12 @@ func (c *Compactor) write(path string, iter KeyIterator) (err error) {
}

// Write the key and value
err = w.WriteBlock(key, minTime, maxTime, block)
if err == ErrMaxBlocksExceeded {
if err := w.WriteBlock(key, minTime, maxTime, block); err == ErrMaxBlocksExceeded {
if err := w.WriteIndex(); err != nil {
return err
}

return ErrMaxBlocksExceeded
}

if err != nil {
return err
} else if err != nil {
return err
}

Expand Down Expand Up @@ -888,7 +884,7 @@ func (k *tsmKeyIterator) combine(dedup bool) blocks {
// Filter out only the values for overlapping block
v = Values(v).Include(first.minTime, first.maxTime)
if len(v) > 0 {
// Recoder that we read a subset of the block
// Record that we read a subset of the block
k.blocks[i].markRead(v[0].UnixNano(), v[len(v)-1].UnixNano())
}

Expand Down
2 changes: 1 addition & 1 deletion tsdb/engine/tsm1/compact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func TestCompactor_CompactFull_TombstonedMultipleRanges(t *testing.T) {
// max keys per blocks is exceeded
func TestCompactor_CompactFull_MaxKeys(t *testing.T) {
// This test creates a lot of data and causes timeout failures for these envs
if testing.Short() || os.Getenv("CIRCLECI") != "" || os.Getenv("APPVEYOR") != "" || os.Getenv("GORACE") != "" {
if testing.Short() || os.Getenv("CI") != "" || os.Getenv("GORACE") != "" {
t.Skip("Skipping max keys compaction test")
}
dir := MustTempDir()
Expand Down

0 comments on commit f2bcf9d

Please sign in to comment.