Commit Graph

11287 Commits (637a67ea353ec538356d8e46b37ce535f5f14245)

Author SHA1 Message Date
Jason Wilder 637a67ea35 Reduce lock contention on measurementFields 2016-12-19 14:17:01 -07:00
Jason Wilder b7c1e625b0 Move needSort tracking to Deduplicate
This eliminates some *UnixNano() calls and also simplifies the cache
logic so that it does not need to worry about whether entries are
sorted.
2016-12-19 14:17:01 -07:00
Jason Wilder dea87703cd Reduce UnixNano pointer call 2016-12-19 14:17:01 -07:00
Jason Wilder 346b62aea0 Merge pull request #7703 from influxdata/jw-merge-111
Merge 1.1.1 to master
2016-12-19 14:16:05 -07:00
Jason Wilder 34c06d222a Update changelog 2016-12-19 11:47:00 -07:00
Jason Wilder 3fa8492965 Merge pull request #7641 from influxdata/cs-string-escape-unit-tests
String escape & unescape unit tests & optimizations
2016-12-19 11:38:35 -07:00
Jason Wilder 4787ed1b94 Update 1.1.1 release date 2016-12-19 11:11:50 -07:00
Edd Robinson 43834d3db8 Update Go version to 1.7.4 2016-12-19 11:11:00 -07:00
Edd Robinson db4e50f34f Fixes #7625 2016-12-19 11:09:10 -07:00
Mark Rushakoff b8ef792606 Merge pull request #7744 from influxdata/mr-check-read-block-error
Fix unchecked error in templated Read${TYPE}Block
2016-12-19 09:48:15 -08:00
Mark Rushakoff 722b6345fe Fix unchecked error in templated Read${TYPE}Block 2016-12-19 09:31:26 -08:00
Mark Rushakoff 55afd56cc2 Merge pull request #7741 from influxdata/mr-export-cleanup
Clean up `influx_inspect export` command and improve performance
2016-12-19 09:18:20 -08:00
Mark Rushakoff 295a29d4ea Fix quoting on exported string fields
The previous implementation was wrong and double-escaped quotes and
backslashes.
2016-12-18 00:37:48 -08:00
Mark Rushakoff 15ba7958f8 Use strings.Replacer to escape string field
benchmark                                        old ns/op     new ns/op     delta
BenchmarkEscapeStringField_Plain-4               167           65.3          -60.90%
BenchmarkEscapeString_Quotes-4                   167           165           -1.20%
BenchmarkEscapeString_Backslashes-4              211           184           -12.80%
BenchmarkEscapeString_QuotesAndBackslashes-4     413           397           -3.87%

BenchmarkExportTSMStrings_100s_250vps-4     33833611      27381442           -19.07%
BenchmarkExportWALStrings_100s_250vps-4     34977761      29222717           -16.45%

benchmark                                        old allocs     new allocs     delta
BenchmarkEscapeStringField_Plain-4               4              1              -75.00%
BenchmarkEscapeString_Quotes-4                   4              3              -25.00%
BenchmarkEscapeString_Backslashes-4              5              3              -40.00%
BenchmarkEscapeString_QuotesAndBackslashes-4     9              5              -44.44%

BenchmarkExportTSMStrings_100s_250vps-4     201605          76938              -61.84%
BenchmarkExportWALStrings_100s_250vps-4     225371         100728              -55.31%

benchmark                                        old bytes     new bytes     delta
BenchmarkEscapeStringField_Plain-4               56            16            -71.43%
BenchmarkEscapeString_Quotes-4                   56            48            -14.29%
BenchmarkEscapeString_Backslashes-4              104           80            -23.08%
BenchmarkEscapeString_QuotesAndBackslashes-4     208           160           -23.08%

BenchmarkExportTSMStrings_100s_250vps-4     10872629       6062048           -44.24%
BenchmarkExportWALStrings_100s_250vps-4     10094933       5269980           -47.80%
2016-12-17 23:46:58 -08:00
Mark Rushakoff 9effe6f364 Update CHANGELOG 2016-12-17 20:34:04 -08:00
Mark Rushakoff ff78c84b0f Improve export performance
Benchmark improvements with this change:

benchmark                                   old ns/op     new ns/op     delta
BenchmarkExportTSMFloats_100s_250vps-4      23206480      10279106      -55.71%
BenchmarkExportTSMInts_100s_250vps-4        17995000      5762310       -67.98%
BenchmarkExportTSMBools_100s_250vps-4       17067605      4235467       -75.18%
BenchmarkExportTSMStrings_100s_250vps-4     54846997      34682568      -36.76%
BenchmarkExportWALFloats_100s_250vps-4      23459937      10436297      -55.51%
BenchmarkExportWALInts_100s_250vps-4        18747150      6236062       -66.74%
BenchmarkExportWALBools_100s_250vps-4       17988273      4814358       -73.24%
BenchmarkExportWALStrings_100s_250vps-4     59700802      35815739      -40.01%

benchmark                                   old allocs     new allocs     delta
BenchmarkExportTSMFloats_100s_250vps-4      201442         51738          -74.32%
BenchmarkExportTSMInts_100s_250vps-4        201442         51728          -74.32%
BenchmarkExportTSMBools_100s_250vps-4       201441         51638          -74.37%
BenchmarkExportTSMStrings_100s_250vps-4     404092         201584         -50.11%
BenchmarkExportWALFloats_100s_250vps-4      250322         75627          -69.79%
BenchmarkExportWALInts_100s_250vps-4        250323         75617          -69.79%
BenchmarkExportWALBools_100s_250vps-4       250321         75527          -69.83%
BenchmarkExportWALStrings_100s_250vps-4     452868         225291         -50.25%

benchmark                                   old bytes     new bytes     delta
BenchmarkExportTSMFloats_100s_250vps-4      5170539       2351789       -54.52%
BenchmarkExportTSMInts_100s_250vps-4        5143189       2331276       -54.67%
BenchmarkExportTSMBools_100s_250vps-4       3724951       2143780       -42.45%
BenchmarkExportTSMStrings_100s_250vps-4     17131400      10796281      -36.98%
BenchmarkExportWALFloats_100s_250vps-4      4487868       1468109       -67.29%
BenchmarkExportWALInts_100s_250vps-4        4458395       1452359       -67.42%
BenchmarkExportWALBools_100s_250vps-4       2838719       1258755       -55.66%
BenchmarkExportWALStrings_100s_250vps-4     16787201      10010700      -40.37%

Also, after improving those benchmarks, I did a time-filtered export on
a 450MB TSM file to a 21GB plain text output, with and without the
bufio.BufferedWriter.

Without buffering, it took about 263s, and with buffering, it took about
60s, for a delta of about -77%.
2016-12-17 20:15:39 -08:00
Mark Rushakoff da45aab52c Clean up export code, add tests and benchmarks
The export code was moved around a bit, particularly to ease testing
export of a single TSM or WAL file. The functionality should not have
changed.
2016-12-17 18:17:18 -08:00
Jonathan A. Sternberg a645dff54e Merge pull request #7730 from influxdata/js-zap-proper-import
Use a dev copy of zap which consistently uses the proper imports
2016-12-16 10:00:04 -06:00
Mark Rushakoff b22b2c618a Merge pull request #7717 from influxdata/mr-sample-local-rng
Use local RNG in SampleReducer
2016-12-15 13:37:37 -08:00
Jonathan A. Sternberg 913028eddc Use a dev copy of zap which consistently uses the proper imports 2016-12-15 14:43:11 -06:00
Mark Rushakoff a29781286b Use local RNG in SampleReducer
The reducers already had a local RNG but mistakenly did not use it when
sampling points.

Because the local RNG is not protected by a mutex, there is a slight
speedup as a result of this change:

benchmark                          old ns/op     new ns/op     delta
BenchmarkSampleIterator_1k-4       418           418           +0.00%
BenchmarkSampleIterator_100k-4     434           422           -2.76%
BenchmarkSampleIterator_1M-4       449           439           -2.23%

benchmark                          old allocs     new allocs     delta
BenchmarkSampleIterator_1k-4       3              3              +0.00%
BenchmarkSampleIterator_100k-4     3              3              +0.00%
BenchmarkSampleIterator_1M-4       3              3              +0.00%

benchmark                          old bytes     new bytes     delta
BenchmarkSampleIterator_1k-4       304           304           +0.00%
BenchmarkSampleIterator_100k-4     304           304           +0.00%
BenchmarkSampleIterator_1M-4       304           304           +0.00%

The speedup would presumably increase when multiple sample iterators are
used concurrently.
2016-12-15 12:33:19 -08:00
Edd Robinson 049f9b42e9 Merge pull request #7729 from influxdata/er-attributes
Remove .gitattributes
2016-12-15 17:25:03 +00:00
Edd Robinson 2f95a97ea9 Remove .gitattributes 2016-12-15 17:12:12 +00:00
Jonathan A. Sternberg a015996c3e Merge pull request #7728 from influxdata/js-zap-proper-import
Use proper uber-go/zap import path
2016-12-15 11:01:55 -06:00
Jonathan A. Sternberg ec57108520 Use proper uber-go/zap import path
It looks like the real import path to the project is go.uber.org/zap
instead of github.com/uber-go/zap since the example in the project
references that path.
2016-12-15 08:54:14 -06:00
Edd Robinson b0a1e91ad1 Merge pull request #7633 from influxdata/er-cache
Improve TSM1 cache performance
2016-12-14 18:56:21 +00:00
Edd Robinson 799e5f41a4 Update dependency 2016-12-14 18:23:36 +00:00
Edd Robinson ec27c57127 Further optimisations and a race fix 2016-12-14 18:23:36 +00:00
Edd Robinson 05ec6ad9ad Add to index safely 2016-12-14 18:23:36 +00:00
Edd Robinson d78ca1a0f3 Fix some races 2016-12-14 18:23:36 +00:00
Edd Robinson d2923c7bf9 Add hints as to how to pre-allocate entry values
Currently, whenever a snapshot occurs the Cache is reset and so many
allocations are repeated, as the same type of data is re-added to
the Cache.

This commit allows the stores to keep track of the number of values
within an entry, and use that size as a hint when the same entry needs
to be recreated after a snapshot.

To avoid hints persisting over a long period of time they are deleting
after every snapshot, and rebuilt using the most recent entries only.
2016-12-14 18:23:36 +00:00
Edd Robinson f2b5c7f5be Reduce contention when adding entries 2016-12-14 18:23:36 +00:00
Edd Robinson 98f0392ca6 Update size using atomic 2016-12-14 18:23:36 +00:00
Edd Robinson 66edb32182 Sharded Cache using a hash ring 2016-12-14 18:23:36 +00:00
Edd Robinson d3e6d4e7ca Add benchmarks 2016-12-14 18:21:50 +00:00
Jonathan A. Sternberg 75f3b7df3f Merge pull request #7723 from influxdata/js-remove-gomaxprocs-override
Remove the override of GOMAXPROCS
2016-12-14 12:17:59 -06:00
Mark Rushakoff eceecf4cfa Merge pull request #7721 from influxdata/mr-fix-flaky-port-tests
Bind to random port in service open/close tests
2016-12-14 10:03:26 -08:00
Jonathan A. Sternberg 74d474594f Remove the override of GOMAXPROCS
This was needed when we were on go 1.4 but hasn't been needed since go
1.5. It was kept because we weren't sure if we were going to have to
rollback to an older version of Go at that time and we kept it so we
wouldn't forget to readd it.

Now that we are on go 1.7 with go 1.4 deprecated, there is no going back
so we might as well remove this so people can set GOMAXPROCS to a custom
value using environment variables.
2016-12-14 12:00:40 -06:00
Jonathan A. Sternberg 76df3622b0 Merge pull request #7671 from influxdata/js-7036-structured-logging
Switch logging to use structured logging everywhere
2016-12-14 11:59:46 -06:00
Jonathan A. Sternberg 21502a39e8 Switch logging to use structured logging everywhere
The logging library has been switched to use uber-go/zap. While the
logging has been changed to use structured logging, this commit does not
change any of the logging statements to take advantage of the new
structured log or new log levels. Those changes will come in future
commits.
2016-12-14 10:45:15 -06:00
Mark Rushakoff ede3144300 Bind to random port in service open/close tests
These tests have been flaky on Circle in the past due to those specific
ports being in use. Binding to port 0 will pick a random, available
port.
2016-12-14 08:29:29 -08:00
Jason Wilder 855c567c67 Merge pull request #7705 from influxdata/jw-dedup
Optimize Values.Deduplicate
2016-12-09 08:55:52 -07:00
Jason Wilder 4f28c90b54 Optimize Value.Deduplicate
Deduplicate is called from various places in the engine and can cause
a lot of garbage to get created.  It first creates a map and then
adds each value to the map in order (1st alloc).  It then creates a
new slice (2nd alloc) and appends everything from the map to the slice.
Finally, it sorted the new slice (3rd alloc).

This switches the algorithm to use stable sorting and resuing the existing
slice to avoid allocations.
2016-12-08 21:10:56 -07:00
Cory LaNou eee64ee07f Merge pull request #7701 from influxdata/corylanou-pr-task-docs
Add Documentation Task to Pull Request Template
2016-12-08 09:59:34 -06:00
Edd Robinson f44c6a9601 Merge pull request #7673 from allenpetersen/ap_7615
Reject invalid subscription urls
2016-12-08 15:13:57 +00:00
Allen Petersen 5b25a93b45 Clean error and log messages 2016-12-07 12:54:41 -08:00
Allen Petersen da9941b9a9 Reject invalid subscription urls
The url must have a scheme of udp,http,https and a port number.
CREATE SUBSCRIPTION will fail if there are invalid destinations.

Additionally Service.createSubscription fail invalid destinations are detected.

Fixes #7615
2016-12-07 12:54:41 -08:00
Cory LaNou 6f027ac60e Merge pull request #7702 from influxdata/cjl-6527-cli-precision-case-sensitive
fix precision being case sensitive in cli
2016-12-07 12:15:34 -06:00
Cory LaNou dddc3c6690
fix precision being case sensitive in cli 2016-12-07 12:04:19 -06:00
Cory LaNou d9f7fe156e Merge pull request #7699 from influxdata/cjl-7396-tabs-to-spaces-cli-output
use spaces instead of tabs for CLI column output format
2016-12-07 12:01:06 -06:00