Skip to content

Commit

Permalink
disable bz1 recompression
Browse files Browse the repository at this point in the history
This commit only appends new blocks of points and disables checks for
recompressing small blocks at the end of a series.
  • Loading branch information
benbjohnson committed Sep 10, 2015
1 parent 2d66729 commit 733fa0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ With this release InfluxDB is moving to Go 1.5.
- [#4053](https://github.com/influxdb/influxdb/pull/4053): Prohibit dropping default retention policy.
- [#4060](https://github.com/influxdb/influxdb/pull/4060): Don't log EOF error in openTSDB input.
- [#3978](https://github.com/influxdb/influxdb/issues/3978): [0.9.3] (regression) cannot use GROUP BY * with more than a single field in SELECT clause
- [#4058](https://github.com/influxdb/influxdb/pull/4058): Disable bz1 recompression

## v0.9.3 [2015-08-26]

Expand Down
23 changes: 6 additions & 17 deletions tsdb/engine/bz1/bz1.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,25 +389,14 @@ func (e *Engine) writeIndex(tx *bolt.Tx, key string, a [][]byte) error {
return fmt.Errorf("new blocks: %s", err)
}
return nil
} else {
// Determine uncompressed block size.
sz, err := snappy.DecodedLen(v[8:])
if err != nil {
return fmt.Errorf("snappy decoded len: %s", err)
}

// Append new blocks if our time range is past the last on-disk time
// and if our previous block was at least the minimum block size.
if int64(btou64(v[0:8])) < tmin && sz >= e.BlockSize {
bkt.FillPercent = 1.0
if err := e.writeBlocks(bkt, a); err != nil {
return fmt.Errorf("append blocks: %s", err)
}
return nil
} else if int64(btou64(v[0:8])) < tmin {
// Append new blocks if our time range is past the last on-disk time.
bkt.FillPercent = 1.0
if err := e.writeBlocks(bkt, a); err != nil {
return fmt.Errorf("append blocks: %s", err)
}

// Otherwise fallthrough to slower insert mode.
e.statMap.Add(statSlowInsert, 1)
return nil
}

// Generate map of inserted keys.
Expand Down

0 comments on commit 733fa0a

Please sign in to comment.