Commit Graph

153 Commits (57fb6ef32760b5da21a6e55a28acc551f8372237)

Author SHA1 Message Date
Jeffrey Smith II fce0d1c863
chore: update to go 1.19 (#24119)
* chore: update to go 1.19.6

* chore: gofmt

* test: fix tests for sort order change

* chore: generate pb

* feat: upgrade flux to v0.188.0 (#23911)

* feat: upgrade flux to 0.171.0

Tests failing, safety commit

First step in https://github.com/influxdata/influxdb/issues/23815

* fix: remove "org" parameter" from writeOptSource

I attempted to implement the "orgOpt" argument in a similar fashion
to f6669f7512. However, it looks like Flux doesn't accept "org" as
a parameter to "load". It responds with:

Error calling function \"load\" @113:16-113:30: error calling function \"to\" @6:19-6:47: unused arguments [org]

This brings us from 194 passing to 570 passing.

* fix: temporarily disable broken flux tests

These tests expect rows to be stored in a certain order. However,
nothing is specifying the sort order. This has been fixed in a
later update to flux: (see 3d6f47ded).

Temporarily disable these tests until we include a fixed
version of the flux tests.

* chore: add tests from a492993012

This fixes "test-flux.sh" so it runs tests within the "flux/"
directory. This uncovered some other issues with the tests
located within "flux/". These also needed to be updated
to match the newer flux API.

* feat: upgrade flux to 0.172.0

This includes changes made in "cbbf4b27da". Since "test.go" in 2.x
diverged from 1.x, some modifications were required to make this
compatible.

* feat: upgrade flux to 0.173.0

* feat: upgrade flux to v0.174.0

* fix: Update the condition when reseting cursor (#23522)

Filters that contain `or` may change between cursor resets so we must remember to update the condition in the read cursor.

```flux
|> filter(fn: (r) => ((r["_field"] == "field1" and r["_value"]==true) or (r["_field"] == "field2" and r["_value"] == false)))
```

Closes https://github.com/influxdata/flux/issues/4804

* feat: upgrade flux to 0.174.1

* feat: upgrade flux to 0.175.0

* chore: remove end-to-end tests

These were removed in a492993 for 2.x. These tests prevent "go test ./..."
from completing. As stated in the original commit, these tests should now be
handled by the "fluxtest" harness.

* feat: upgrade flux to 0.176.0

Some tests needed to be disabled within the flux harness. This is a
result of enabling "Optimize Aggregate Window" in flux@05a1065f.
These tests are not present in 2.x. Therefore, I am unsure if
the breakage is resolved in a later commit.

* feat: upgrade flux to 0.177.0

* feat: upgrade flux to 0.178.0

* feat: upgrade flux to v0.179.0

This removes all invocations of "flux.RegisterOpSpec". According
to flux@e39096d5, "flux.RegisterOpSpec" does nothing in the
current version of flux and was removed.

* chore: update fluxtest skip list (#23633)

* chore: manually backport 785a465e9a

This removes the reference to "flux.Spec".

* build(flux): update flux to v0.181.0 (#23682)

* build(flux): update flux to v0.184.2

* chore: skip more Flux acceptance tests

There are issues for each skip detailed in test-flux.sh.

* feat: upgrade flux to v0.185.0

This adds "FluxTesting" to the "HTTPD" configuration. This option is
hidden and disabled by default. When "FluxTesting" is set, it
enables the default testing flags for "Flux".

These flags allow the "vectorized float tests" and tests requiring
the "removeRedundantSortNodes" and "labelPolymorphism" flag
enabled to work. These changes are based off of d8553c002e.

flux@3d6f47ded is included within this version of Flux. Therefore
we can now include the "group_*" tests.

* feat: upgrade flux to 0.186.0

* feat: upgrade flux to 0.187.0

* feat: upgrade flux to 0.188.0

* fix: re-run ./generate.sh with updated protoc

* fix: restrict cores to match CircleCI documentation

Co-authored-by: davidby-influx <dbyrne@influxdata.com>
Co-authored-by: Markus Westerlind <marwes91@gmail.com>
Co-authored-by: Sean Brickley <sean@wabr.io>
Co-authored-by: Jonathan A. Sternberg <jonathan@influxdata.com>
Co-authored-by: Christopher M. Wolff <chris.wolff@influxdata.com>

---------

Co-authored-by: Brandon Pfeifer <bpfeifer@influxdata.com>
Co-authored-by: davidby-influx <dbyrne@influxdata.com>
Co-authored-by: Markus Westerlind <marwes91@gmail.com>
Co-authored-by: Sean Brickley <sean@wabr.io>
Co-authored-by: Jonathan A. Sternberg <jonathan@influxdata.com>
Co-authored-by: Christopher M. Wolff <chris.wolff@influxdata.com>
2023-03-03 10:05:05 -05:00
davidby-influx 514f024b7d
fix: use copy when a rename spans volumes (#23785) (#23792)
When a file rename fails with EXDEV
(cross device or volume error), copy the
file and delete the original instead

Differs from master branch by overwriting
existing files instead of erring.

closes https://github.com/influxdata/influxdb/issues/22997

(cherry picked from commit 0913276ff0)

* fix: add tests for file rename across volumes (#23787)

Also move shared code from file_unix.go

(cherry picked from commit bc8d9ea9f3)

closes https://github.com/influxdata/influxdb/issues/23791
2022-10-13 11:56:35 -07:00
davidby-influx 07ee889eb3
fix: fully clean up partially opened TSI (#23430) (#23446)
When one partition in a TSI fails to open, all previously opened
partitions should be cleaned up, and remaining partitions
should not be opened

closes https://github.com/influxdata/influxdb/issues/23427

(cherry picked from commit d3db48e93d)

closes https://github.com/influxdata/influxdb/issues/23431
2022-06-13 12:51:34 -07:00
Dane Strandboge 0574163566
build: upgrade to go1.18 (#23250) 2022-03-31 16:17:57 -05:00
Dane Strandboge 06d1df22a2
chore: fix deadlock in `influx_inspect dumptsi` (#22661) 2021-10-20 12:48:59 -05:00
Dane Strandboge 8b38d0e2bf
build: upgrade protobuf library (#22606) 2021-10-15 11:42:47 -05:00
Sam Arnold 611a4370a2
feat: show measurements database and retention policy wildcards (#22388)
* feat: show measurements database and retention policy wildcards

Closes #3318

* chore: run formatter
2021-10-05 09:07:25 -04:00
Sam Arnold 23c3d35aab
chore: update protobuf library versions and remove influx_tsm (#21882)
* chore: update protobufs

* fix: run codegen during build

* fix: fully remove influx_tsm
2021-07-20 09:42:52 -04:00
Sam Arnold c240c7906e
fix: a few suddenly flaky tests involving randomness (#21818)
Closes #21817
2021-07-09 12:17:23 -04:00
Sam Arnold 78724e5c20
chore: Add kit (#21086)
* chore: pull in unchanged kit from v2

* chore: remove v2 from import paths

* chore: update module paths and go.mod for kit

* chore: remove kit/cli again, not needed in 1.x
2021-03-30 13:09:04 -04:00
Sam Arnold df46a86326
fix(tls): Enable configuration of TLS 1.3 (#20939)
Co-authored-by: Gunnar Aasen <gunnar.r.aasen@gmail.com>
2021-03-12 16:35:28 -05:00
Sam Arnold 903b8cd0ea
feat(query): Hyper log log operators in influxql (#20603)
* feat(query): hyper log log counting in query engine

In addition to helping with normal queries, this can improve the 'SHOW CARDINALITY'
meta-queries:

time influx -database mydb -execute 'select count_hll(sum_hll(_seriesKey)) from big'
name: big
time count_hll
---- ---------
0    200767781
influx -database mydb -execute   0.06s user 0.12s system 0% cpu 8:49.99 total
2021-02-08 08:38:14 -05:00
Sam Arnold 8a16bf0531 chore: run goimports -w ./ 2021-01-29 11:40:02 -05:00
Sam Arnold a6152e8ac1 feat(inspect): Add report-disk for disk usage by measurement 2021-01-29 10:51:42 -05:00
Ayan George 2529799abb
refactor: Change ToLower comparisons to EqualFold (#18147)
When comparing strings in a case-insensitive way, strings.EqualFold() is
(almost?) always faster than comparing the results of strings.ToLower().

In addition, strings.EqualFold() never causes an allocation.

This patch replaces case-insensitive string comparisons that use
strings.ToLower() with a strings.EqualFold() call.
2020-05-18 19:46:59 -04:00
Ayan George 3b9be0145c
fix: address static check warning s1039 (#18135)
This commit quiets staticcheck's warnings about "unnecessary use of
fmt.Sprintf" and "unnecessary use of fmt.Sprint".

Prior to this commit we were wrapping simple constant strings without
any formatting verbs with fmt.Sprintf().
2020-05-18 13:55:05 -04:00
Jacob Marble 8f665ec2a7 fix(storage): simple8b passes checkptr (#15512)
* fix(simple8b): disable checkptr on batch decodes

* perf: improve performance of simple8b encoding

```
name                      old time/op    new time/op    delta
EncodeAll/1_bit-24          35.8µs ± 2%    35.8µs ± 2%     ~     (p=0.887 n=10+7)
EncodeAll/2_bits-24         35.7µs ± 4%    35.6µs ± 3%     ~     (p=0.684 n=10+10)
EncodeAll/3_bits-24         36.5µs ± 3%    36.4µs ± 4%     ~     (p=0.780 n=10+9)
EncodeAll/4_bits-24         36.4µs ± 3%    37.8µs ± 2%   +3.71%  (p=0.000 n=10+10)
EncodeAll/5_bits-24         38.0µs ± 3%    38.3µs ± 2%     ~     (p=0.280 n=10+10)
EncodeAll/6_bits-24         39.4µs ± 1%    38.5µs ± 2%   -2.43%  (p=0.001 n=10+9)
EncodeAll/7_bits-24         39.6µs ± 3%    38.9µs ± 3%   -1.83%  (p=0.029 n=10+10)
EncodeAll/8_bits-24         40.3µs ± 3%    40.5µs ± 4%     ~     (p=0.278 n=10+9)
EncodeAll/10_bits-24        42.6µs ± 3%    41.9µs ± 2%     ~     (p=0.075 n=10+10)
EncodeAll/12_bits-24        44.2µs ± 2%    42.8µs ± 2%   -3.11%  (p=0.000 n=10+10)
EncodeAll/15_bits-24        46.0µs ± 1%    46.1µs ± 3%     ~     (p=0.447 n=9+10)
EncodeAll/20_bits-24        51.4µs ± 2%    50.0µs ± 2%   -2.86%  (p=0.000 n=10+10)
EncodeAll/30_bits-24        60.6µs ± 1%    58.1µs ± 2%   -4.02%  (p=0.000 n=10+10)
EncodeAll/60_bits-24        90.2µs ± 2%    85.2µs ± 1%   -5.50%  (p=0.000 n=10+10)
EncodeAll/combination-24     782µs ± 3%     762µs ± 5%     ~     (p=0.063 n=10+10)
Encode-24                   3.08µs ± 2%    3.09µs ± 1%     ~     (p=0.656 n=9+8)
Encoder-24                  4.58µs ± 0%    4.40µs ± 1%   -4.04%  (p=0.000 n=8+8)

```
2019-11-22 07:39:44 -08:00
Jacob Marble f6e9ad40e2
fix(storage): guard against compaction burst throughput limit (#14985) 2019-09-05 15:15:19 -07:00
Jonathan A. Sternberg 31501c9dcf
Upgrade flux to the latest version and remove the platform dependency
This integrates the influxdb 1.x series to the latest version of Flux
and updates the code to use it. It also removes the dependency on
platform and copies the necessary code from storage into the 1.x series
so the dependency is unneeded.

The flux functions specific to 1.x have been moved to the same structure
that flux changed to with having a `stdlib` directory instead of a
`functions` directory. It also adds a `databases()` function that
returns the databases from the meta client.
2019-04-04 10:55:09 -05:00
Jeff Wendling 932521b6ff
Merge pull request #12745 from influxdata/jmw-tls-version-problem
tls: fix incorrect tls1.0 version mapping
2019-04-01 17:45:06 -06:00
Stuart Carnie a43852958d
chore(gen): Back port improvements and changes from OSS 2.0
Specifically:

* renamed files for consistency between versions
* added `time-interval` schema option
* updated schema example documentation

Back port of improvements from #12710
2019-03-20 11:01:50 -07:00
Jeff Wendling e67a0242cc tls: fix incorrect tls1.0 version mapping 2019-03-19 11:59:24 -06:00
Stuart Carnie 75ce049571 chore(influx_tools): Remove platform dependency 2019-02-27 09:21:23 -07:00
Stuart Carnie 4ff74ff971 feedback(influx_tools): Add +ve and -ve test cases for processing schema 2019-02-26 16:51:19 -07:00
Stuart Carnie 9b7ffd36ad feat(influx_tools): Add support for describing schema via a TOML file
The `influx_tools generate` command has a new option, `-schema`, for
specifying a TOML file which describes a desired schema.
2019-02-26 16:51:19 -07:00
Ben Johnson 6e5226437a
Convert TagValueSeriesIDCache to use string fields.
This commit changes `name`, `key`, and `value` to from `[]byte`
to `string`.
2019-02-12 14:22:40 -07:00
KimMachineGun 6afad6e322
Merge branch '1.8' into modify-contextkey 2019-02-04 20:41:11 +09:00
Ben Wells e9bada090f Fix misspelling identified by misspell 2019-02-03 20:27:43 +00:00
Stuart Carnie a4305ddb17 fix(simple8b): Fix incorrect encoding for a run of 119 or 239 1s
If 120th or 240th value is not a 1, k still passes the check in the
switch, causing the last value to be lost. If this value occurs at
the boundary of a block, the max time will be incorrect, resulting in
compaction failing to make forward progress.
2018-11-14 09:13:13 -07:00
Stuart Carnie e9531b7830 feat(encoding): Improve integer and simple8b encoding performance
simple8b EncodeAll improvements should

```
name                     old time/op  new time/op  delta
EncodeAll/1_bit-8        28.5µs ± 1%  28.6µs ± 1%     ~     (p=0.133 n=9+10)
EncodeAll/2_bits-8       28.9µs ± 2%  28.7µs ± 0%     ~     (p=0.068 n=10+8)
EncodeAll/3_bits-8       29.3µs ± 1%  28.8µs ± 0%   -1.70%  (p=0.000 n=10+10)
EncodeAll/4_bits-8       29.6µs ± 1%  29.1µs ± 1%   -1.85%  (p=0.000 n=10+10)
EncodeAll/5_bits-8       30.6µs ± 1%  29.8µs ± 2%   -2.70%  (p=0.000 n=10+10)
EncodeAll/6_bits-8       31.3µs ± 1%  30.0µs ± 1%   -4.08%  (p=0.000 n=9+9)
EncodeAll/7_bits-8       32.6µs ± 1%  30.8µs ± 0%   -5.49%  (p=0.000 n=9+9)
EncodeAll/8_bits-8       33.6µs ± 2%  31.0µs ± 1%   -7.77%  (p=0.000 n=10+9)
EncodeAll/10_bits-8      34.9µs ± 0%  31.9µs ± 2%   -8.55%  (p=0.000 n=9+10)
EncodeAll/12_bits-8      36.8µs ± 1%  32.6µs ± 1%  -11.35%  (p=0.000 n=9+10)
EncodeAll/15_bits-8      39.8µs ± 1%  34.1µs ± 2%  -14.40%  (p=0.000 n=10+10)
EncodeAll/20_bits-8      45.2µs ± 3%  36.2µs ± 1%  -19.97%  (p=0.000 n=10+9)
EncodeAll/30_bits-8      55.0µs ± 0%  40.9µs ± 1%  -25.62%  (p=0.000 n=9+9)
EncodeAll/60_bits-8      86.2µs ± 1%  55.2µs ± 1%  -35.92%  (p=0.000 n=10+10)
EncodeAll/combination-8   582µs ± 2%   502µs ± 1%  -13.80%  (p=0.000 n=9+9)
```

EncodeIntegers:

```
name                             old time/op    new time/op    delta
EncodeIntegers/1000_seq/batch-8    2.04µs ± 0%    1.50µs ± 1%  -26.22%  (p=0.008 n=5+5)
EncodeIntegers/1000_ran/batch-8    8.80µs ± 2%    6.10µs ± 0%  -30.73%  (p=0.008 n=5+5)
EncodeIntegers/1000_dup/batch-8    2.03µs ± 1%    1.50µs ± 1%  -26.04%  (p=0.008 n=5+5)
```

EncodeTimestamps (ran is improved due to simple8b improvements)

```
name                               old time/op    new time/op    delta
EncodeTimestamps/1000_seq/batch-8    2.64µs ± 1%    2.65µs ± 2%     ~     (p=0.310 n=5+5)
EncodeTimestamps/1000_ran/batch-8    64.0µs ± 1%    33.8µs ± 1%  -47.23%  (p=0.008 n=5+5)
EncodeTimestamps/1000_dup/batch-8    9.32µs ± 0%    9.28µs ± 1%     ~     (p=0.087 n=5+5)
```
2018-10-16 12:08:12 +01:00
Stuart Carnie 8008d394d4 chore(simple8b): Add more unit tests and benchmarks 2018-10-16 12:08:12 +01:00
KimMachineGun d8d73f4375 Modify context key type 2018-10-16 11:25:33 +09:00
liukun ee9892dea5 fix the comments error 2018-08-20 17:19:35 +08:00
Jeff Wendling 35645a67f5 pkg/snowflake: be more robust against sequence rollover
it's slightly slower, but the safety is worth it i think.

```
name            old time/op  new time/op  delta
Next-8          30.0ns ± 2%  31.0ns ± 3%   +3.56%  (p=0.002 n=7+8)
NextParallel-8  79.4ns ± 1%  92.5ns ± 1%  +16.58%  (p=0.000 n=8+8)
```
2018-08-16 11:18:06 -06:00
Jeff Wendling d4a08ce5c1 pkg/snowflake: reduce contention in Next calls
use atomics rather than mutexes to synchronize state between calls.

```
name            old time/op  new time/op  delta
Next-8           244ns ± 0%    30ns ± 2%  -87.70%  (p=0.000 n=8+7)
NextParallel-8   215µs ±60%     0µs ± 1%  -99.96%  (p=0.000 n=8+8)
```

The results for NextParallel are around ~80ns/op, but that doesn't
show up in the benchstat output.
2018-08-15 15:12:21 -06:00
Jacob Marble 7bd9b2a627 tsdb: Copy return value of IndexSet.MeasurementNamesByExpr 2018-08-08 23:48:06 -07:00
Jeff Wendling f4c3c04f8f respond to review comments 2018-08-02 16:58:43 -06:00
Jeff Wendling f21d1773af move tls config into pkg
this makes it so you don't have to depend on cmd/influxd/run in
order to share the code with the parsing and stuff.
2018-08-02 14:29:07 -06:00
Jeff Wendling d979518135 inmem: use radix sort for series ids 2018-07-17 12:31:12 -06:00
Stuart Carnie 0841c51d93 pr(tsdb): Feedback items from PR review 2018-07-13 11:42:02 -07:00
Stuart Carnie 75e0bca597 chore(simple8b): Add simple 8b encoder / decoder
* includes additional APIs for batch decoding of byte slices to improve
  performance
* fix for `unpack120` that was decoding 240 values rather than 120
2018-07-13 11:42:02 -07:00
Ben Johnson 0fcab02074
Fix windows mmap on zero length file. 2018-06-29 10:24:16 -06:00
Jeff Wendling e6aec771b0 fix(tsdb): attempt to work on docker on windows
multiple users have attempted to run influxdb in a docker container
with a windows host and a volume mounted from windows. that causes
problems because it apparently uses samba/cifs which does not
support fsync on directories. this patchset will, if it receives an EINVAL
on directory fsync, as is what appears to happen on samba/cifs, then it
will ignore it. this should help.

fixes #9833.
fixes #9630.
2018-06-01 14:57:18 -06:00
Jeff Wendling cb9c3ee509 radix: optimize for our use case
- reduce allocations by making leaf a value type with a bool
- make longestPrefix inlineable and have no bounds checks
- delete any code for functions we don't plan to use
- operate on []byte and only copy when necessary
- inline calls to sort.Search to avoid allocations and indirections
- insert directly in the correct location for addEdge
- reduce allocations during copying with a buffer helper

results:

name              old time/op    new time/op     delta
Tree_Insert-8       1.10ms ± 4%     0.73ms ± 4%  -33.54%  (p=0.000 n=10+10)
Tree_InsertNew-8    3.18ms ± 2%     1.91ms ± 6%  -39.90%  (p=0.000 n=10+10)

name              old speed      new speed       delta
Tree_Insert-8     9.12MB/s ± 4%  13.72MB/s ± 4%  +50.46%  (p=0.000 n=10+10)
Tree_InsertNew-8  3.15MB/s ± 2%   5.24MB/s ± 6%  +66.42%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op    delta
Tree_InsertNew-8    1.62MB ± 0%     1.60MB ± 0%   -1.28%  (p=0.000 n=10+9)

name              old allocs/op  new allocs/op   delta
Tree_InsertNew-8     35.0k ± 0%      15.0k ± 0%  -57.04%  (p=0.000 n=10+10)

MB/sec in this case is 1 byte per key inserted, so it's really millions
of keys inserted per second.
2018-05-11 11:56:11 -06:00
Jason Wilder de58584ce7
Merge pull request #9748 from influxdata/jw-series-type
Prevent series type conflict
2018-05-10 07:05:45 -06:00
Jacob Marble 2dc2b97fb9
tsdb/index: Add Bytes() methods (#9794) 2018-05-04 08:47:05 -07:00
Jason Wilder ede6b2f041 Small performance optimizations
* Remove defer in Get hot path
* Use linear search for small arrays
2018-04-30 17:26:23 -06:00
Jason Wilder 2c8efb2609 Add string/int radix tree
This is a fork of https://github.com/armon/go-radix that changes
a few things from the original:

* Does not allow updates to nodes
* Typed for int values only
* Is concurrent using a big lock on Tree
2018-04-30 17:26:23 -06:00
Jacob Marble 63f0eee472 HLL++: estimate memory footprint bytes 2018-04-24 09:28:25 -07:00
Adam 72bceca888
Fix stream package to allow for renaming the file before writing it to the stream (#9684)
* Fix stream package to allow for renaming the file before writing it to the stream

* updated test to make sure that the final tsm file has more than one block
2018-04-05 16:24:29 -04:00