Commit Graph

10950 Commits (fcd425c8c62ccce9e549be7705d5a29c668e10f2)

Author SHA1 Message Date
rw fcd425c8c6 Incorporate style feedback from Joe. 2016-09-27 14:07:06 -07:00
rw 9429a2f96a Gotos to simplify uses of the new encoder pools.
For maintainability.
2016-09-27 11:47:25 -07:00
joelegasse 1eda0277a7 Merge pull request #7365 from influxdata/jl-shardgroup-sort
Stablize the sorting of meta.ShardGroupInfos
2016-09-27 11:02:47 -04:00
Jason Wilder 5367372253 Merge pull request #7364 from influxdata/2016-09-26-fix-data-race-in-write-path
Fix data race in *tsdb.Shard write path.
2016-09-26 18:34:19 -06:00
Jason Wilder e707b07946 Merge pull request #7367 from influxdata/2016-09-26-fix-varint-encoder-segfault
Fix off-by-one error that could panic.
2016-09-26 18:30:01 -06:00
rw f131d3cc77 Fix off-by-one error that could panic. 2016-09-26 17:03:03 -07:00
rw 3e0d3be461 Use pre-existing function. 2016-09-26 13:12:10 -07:00
rw bea010b5f3 Fix data race in *tsdb.Shard write path.
Ensure that the Shard's Index is read-locked before calculating the
count of its constituent series.
2016-09-26 12:42:35 -07:00
joelegasse bc4282ad99 Merge pull request #7347 from influxdata/2016-09-22-zero-alloc-strconv-parse-numbers
Zero-alloc wrappers for strconv.Parse{Int,Float}. Thanks @rw
2016-09-26 15:33:30 -04:00
joelegasse 611e413791 Merge pull request #7345 from influxdata/2016-09-22-zero-alloc-fnv64a
Implement and use zero-alloc FNV64a. Thanks @rw
2016-09-26 15:15:10 -04:00
joelegasse a17d095aae Merge pull request #7350 from influxdata/2016-09-22-reduce-allocs-in-validate-series-and-fields
Remove a few short-lived string allocs. Thanks @rw
2016-09-26 15:01:53 -04:00
rw 3155ff2a27 Implement and use zero-alloc FNV64a.
+ Remove a heap alloc in (Point).HashID() and (Row).tagsHash()
  (According to `-gcflags -m`).
+ Direct port from the stdlib.
+ Fuzz test for equivalence to stdlib version.
+ Save one alloc per line when writing with the bulk protocol.
2016-09-26 11:43:27 -07:00
rw 16c3bd2093 Happy-path zero-alloc num parsing fuzz tests. 2016-09-26 11:41:31 -07:00
rw 6906fe7240 Zero-alloc wrappers for strconv.Parse{Int,Float}
+ Reduces short-lived heap allocs during value parsing.
+ Fuzz tests to verify equivalence to stdlib functions.
2016-09-26 11:41:31 -07:00
Cory LaNou e93730759f Merge pull request #7363 from influxdata/cjl-update-godeps-protobuf
update protobuf dependency
2016-09-26 13:40:09 -05:00
Jason Wilder 4b5d989905 Merge pull request #7335 from influxdata/jw-tsm-syscalls
Avoid stat syscall when planning compactions
2016-09-26 12:30:05 -06:00
Jason Wilder 6a604c2928 Merge pull request #7348 from influxdata/jw-write-allocs
Reduce allocations in write path/compactions
2016-09-26 12:29:31 -06:00
rw 68c2212aac Shorten name of static-lifetime string var. 2016-09-26 11:26:24 -07:00
rw 02c86ea9db Remove unnecessary string constant. 2016-09-26 11:25:04 -07:00
Jason Wilder 139ef8062e Simplify encoder buffer usage 2016-09-26 12:19:16 -06:00
Jason Wilder f632b41f6a Update godoc 2016-09-26 12:19:15 -06:00
Jason Wilder 658149a6ff Removed commented out code 2016-09-26 12:19:15 -06:00
Jason Wilder 7f96d78b79 Make encoder re-usable
This allows encoders to be re-used and maintained in a pool to
avoid allocating new ones on every compactions and write of an encoded
block.  The pool used is not a sync.Pool to ensure that the encoders
will not be garbage collected.
2016-09-26 12:19:15 -06:00
Jason Wilder 0401527093 Pre-allocate cache store and entries
These were not sized so they always had to be grown causing
garbage to be created.
2016-09-26 12:19:15 -06:00
Jason Wilder 730ceeea46 Re-used allocated byte slices during compactions 2016-09-26 12:19:15 -06:00
Jason Wilder 25508fa05f Add pool.Bytes for re-using byte slices
This adds a new pool type that allows byte slices
to be re-used across clients.  A sync.Pool can't be used in some
cases because the the slices not in use end up getting garbage
collected due to frequent GCs.
2016-09-26 12:19:15 -06:00
Jason Wilder ac9a7d520b Pre-allocated Points slice when parsing points
Over a longer period of writes, this allocation shows up quite
a bit in profiles since the slice needs to be resized frequently.

This scans the slice to count how many lines are going to be parsed
in order to pre-allocate the slice capacity.  It's slightly slower,
but creates less garbage in the long run.
2016-09-26 12:19:15 -06:00
Jason Wilder b3dd10ec20 Merge pull request #7312 from influxdata/jw-map-allocate
Reduce allocations in idsForExpr
2016-09-26 11:42:56 -06:00
Cory LaNou d533ebf184
update protobuf dependency 2016-09-26 12:34:25 -05:00
Cory LaNou 662b4b495c Merge pull request #7362 from influxdata/cjl-vet-fix
fix failing vet issue in test
2016-09-26 12:29:32 -05:00
Cory LaNou 4a2d23da4a
fix failing vet issue in test 2016-09-26 11:29:02 -05:00
Cory LaNou 33ce9fd11c Merge pull request #7327 from influxdata/cjl-export-wal
export wal files when exporting shard data
2016-09-26 09:40:24 -05:00
Jason Wilder 6671ef00f0 Reduce allocations in idsForExpr 2016-09-26 08:36:59 -06:00
Jason Wilder c2cfd63091 Avoid stat syscall when planning compactions
When the planner runs, it needs to determine if any files have tombstones.
The code to determine if a tombstone existed involved stating the .tombstone
file.  Since the planner runs very frequently when there are many shards, this
causea a lot of system calls that are unnecessary.

Instead, cache the results of the stats calls and only refresh them when we
haven't checked at least once or we write new tombstone data.

This also caches the results of the TSMReader.Stats call to avoid creating
garbage.
2016-09-24 15:53:28 -06:00
Cory LaNou 4f952ad483 export wal files when exporting shard data 2016-09-23 15:09:17 -05:00
joelegasse c2315b208c Merge pull request #7305 from influxdata/jl-udp-split
UDP Client: Split large points
2016-09-23 15:30:21 -04:00
Joe LeGasse 2cbd411a9a client: updated README for UDP point splitting 2016-09-23 15:13:40 -04:00
Joe LeGasse 0d2b339d7c models: Added AppendString, PointSize, and Round to Point
This change also updates the UDP client to take advantage of these
improvements, as well as some code review changes.
2016-09-23 13:22:30 -04:00
Joe LeGasse ee6816756a udp client: large points will now be split, if possible
The v2 UDP client will attempt to split points that exceed the
configured payload size. It will only do this for points that have a
timestamp specified.
2016-09-23 13:22:30 -04:00
Vladimir Sagan 86f3300a46 refactor conditions of udp write func 2016-09-23 13:22:30 -04:00
Vladimir Sagan a3da819552 UDP client refactoring 2016-09-23 13:22:30 -04:00
Vladimir Sagan 0e33af50a9 UDP client: write metrics splitting metrics into chunks 2016-09-23 13:22:30 -04:00
rw b86885c5cd Remove a few short-lived string allocs.
(*tsdb.Shard).validateSeriesAndFields uses fewer string allocs in some
hot spots.
2016-09-22 17:55:57 -07:00
Jason Wilder 67cd17d866 Merge pull request #7349 from influxdata/jw-appveyor
Use go 1.6 on appveyor
2016-09-22 18:32:16 -06:00
Jason Wilder 28a807f47c Use go 1.6 on appveyor
Seems the default has switched to 1.7, but we still use go 1.6.
2016-09-22 18:20:49 -06:00
Jason Wilder a8ad18bb36 Merge pull request #7314 from influxdata/jw-delete-shard
Unload index before closing shard
2016-09-21 11:32:19 -06:00
Cory LaNou 7e515cf5f7 Merge pull request #7317 from influxdata/cjl-7316-test
Add test to prevent future parsing regressions for time durations
2016-09-16 15:50:07 -05:00
Jason Wilder d06b28992d Unload index before closing shard
When deleting a shard, the shard is locked and then removed from the
index.  Removal from the index can be slow if there are a lot of
series.  During this time, the shard is still expected to exist by
the meta store and tsdb store so stats collections, queries and writes
could all be run on this shard while it's locked.  This can cause everything
to lock up until the unindexing completes and the shard can be unlocked.

Fixes #7226
2016-09-16 12:01:50 -06:00
Jason Wilder cd7c39962d Merge pull request #7318 from influxdata/jw-sub-panic
Fix panic in subscriber.Statistics
2016-09-16 12:01:22 -06:00
Jason Wilder 14b0f6e496 Fix panic in subscriber.Statistics
The tags passed into Statistics() calls are not supposed to be modified.
The balanceWriter in subscribers tried to modify them triggering a panic
because they can be nil.
2016-09-16 11:49:15 -06:00