Commit Graph

2748 Commits (57fb6ef32760b5da21a6e55a28acc551f8372237)

Author SHA1 Message Date
davidby-influx fd0f0ce7cb
fix: prevent world-writable MANIFEST files (#24235) (#24238)
When a new MANIFEST file is created, set
its permissions to 644, not 666

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

(cherry picked from commit aad79e471f)
2023-05-23 17:06:33 -05:00
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 4aa7cd88e8
feat: add type conflict checker to influx_inspect (#23616) (#23617)
adds two commands "check-schema" and
"merge-schema" to influx_inspect.
These test for field type conflicts
in all fields.idx beneath a directory
and merges the derived schemas if
"check-schema" has been run multiple
times on different directories

(cherry picked from commit 84c4f676b0)
2022-08-10 15:14:05 -07:00
davidby-influx 02c1cad6a6
fix: generalize test for Windows (#23580) (#23581)
Also eliminate race condition in tests

(cherry picked from commit 7e37a7ad16)
(cherry picked from commit eb3cc88772)
2022-07-21 14:13:37 -07:00
davidby-influx 823f63d625
fix: restore in-memory Manifest on write error (#23552) (#23577)
Do not update the `FileSet` or `activeLogFile` field in the in-memory
Partition structure if the Manifest file is not correctly saved to
the disk.

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

(cherry picked from commit a8732dcf52)

closes https://github.com/influxdata/influxdb/issues/23555
2022-07-20 16:05:34 -07:00
davidby-influx 4db8ab54f6
fix: add paths to tsi log and index file errors (#23557) (#23576)
Add paths to various TSI errors on opening and unmarshaling files
to help poinpoint the corrupt files.

Closes https://github.com/influxdata/influxdb/issues/23556

(cherry picked from commit 25cea95beb)

closes https://github.com/influxdata/influxdb/issues/23559
2022-07-20 14:38:14 -07:00
davidby-influx 05a0b540dd
fix: create TSI MANIFEST files atomically (#23539) (#23575)
When a MANIFEST file is created in TSI, it
should be written to a temp file, then
atomically renamed, to avoid overwriting
the existing file only to fail on the
later write.

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

(cherry picked from commit 061cf55f2a)

closes https://github.com/influxdata/influxdb/issues/23537
2022-07-20 14:21:21 -07:00
davidby-influx cbfc7c12c3
fix: improve error messages opening index partitions (#23532) (#23573)
Where possible, add the file path path to any errors
on opening, reading, (un)marshaling, or validating
the various files comprising a partition

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

(cherry picked from commit a2dd708a26)

closes https://github.com/influxdata/influxdb/issues/23533
2022-07-20 13:58:27 -07:00
davidby-influx 75ed51b9c3
fix: lost TSI reference / close TagValueSeriesIDIterator in error case (#23461) (#23463)
(cherry picked from commit 8bd4fc502d)

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

Co-authored-by: Dane Strandboge <dstrandboge@influxdata.com>
2022-06-16 11:58:10 -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
davidby-influx d0dd842149
fix: remember shards that fail Open(), avoid repeated attempts (#23437) (#23444)
If a shard cannot be opened, store its ID and last error.
Prevent future attempts to open during this invocation of
influxDB. This information is not persisted.

closes https://github.com/influxdata/influxdb/issues/23428
closes https://github.com/influxdata/influxdb/issues/23426

(cherry picked from commit 54ac7e54ed)

closes https://github.com/influxdata/influxdb/issues/23433
closes https://github.com/influxdata/influxdb/issues/23435
2022-06-13 12:51:19 -07:00
davidby-influx b22fe17061
fix: do not rename files on mmap failure (#23396) (#23421)
If NewTSMReader() fails because mmap fails, do not
rename the file, because the error is probably
caused by vm.max_map_count being too low

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

(cherry picked from commit ec412f793b)

closes https://github.com/influxdata/influxdb/issues/23413
2022-06-10 10:38:44 -07:00
davidby-influx 3635e1c1b1
fix: replace unprintable and invalid characters in errors (#23387) (#23418)
Replace unprintable and invalid characters with '?'
in logged errors.  Truncate consecutive runs of them to
only 3 repeats of '?'

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

(cherry picked from commit 0ae0bd6e2e)

closes https://github.com/influxdata/influxdb/issues/23390
2022-06-09 09:26:23 -07:00
Geoffrey Wossum 160cf678d5
fix: MeasurementsCardinality should not be less than 0 (#23286)
Clamp the value of Store.MeasurementsCardinality so that it can not be less
than 0. This primarily shows up as a negative `numMeasurements` value in
/debug/vars under some circumstances.

refs #23285
2022-04-21 13:32:12 -05:00
Dane Strandboge 0574163566
build: upgrade to go1.18 (#23250) 2022-03-31 16:17:57 -05:00
davidby-influx 7d182158f4
fix: add database to MaxSeriesPerDatabase error message (#23113)
To simplify debugging, print the database name when the
max-series-per-database limit is exceeded in InMem indices.

closes https://github.com/influxdata/influxdb/issues/23112
2022-02-08 11:52:14 -08:00
davidby-influx f27df39c03
fix: add additional testing for MaxSeriesPerDatabase (#23094)
Added test to ensure new code path taken for inmem index
2022-02-02 13:16:09 -08:00
davidby-influx 0c3dca883e
fix: correctly handle MaxSeriesPerDatabaseExceeded (#23091)
Check for the correctly returned PartialWriteError
in (*shard).validateSeriesAndFields, allow partial
writes.

closes https://github.com/influxdata/influxdb/issues/23090
2022-02-01 19:08:51 -08:00
davidby-influx eb3bc7069f
feat: configurable DELETE concurrency (#23055)
Currently, deletion of series or measurements are
serialized. This new feature will add
max-concurrent-deletes to the [data] section of the
 configuration file. Legal values are any positive
 number, defaulting to 1, the current behavior.

 closes https://github.com/influxdata/influxdb/issues/23054
2022-01-13 11:04:57 -08:00
lifeibo 5be1c044c3
fix(tsi): sync index file before close (#21932) 2021-11-24 08:36:03 -05:00
Geoffrey Wossum 91609fdd3f
fix(restore): fix race condition which causes restore command to fail (#22796)
* fix(restore): fix race condition which causes restore command to fail

Fixes a race condition in the restore code path that causes shard data restores
to fail. When the bug occurs, `Error while freeing cold shard resources`
appears in the log files.

fixes issue #15323
2021-11-03 14:21:33 -05:00
davidby-influx af9e89a4d4
fix: detect misquoted tag values and return an error (#22754)
SHOW TAG KEYS FROM "foo" where bar="misquoted" is
erroneous, because the tag value must be enclosed
in single, not double, quotes. Although this
correctly returns no tag keys, it is very
inefficient and has cause out-of-memory failures
at a customer. This fix short-circuits the query.

closes https://github.com/influxdata/influxdb/issues/22755
2021-10-27 11:26:20 -07:00
davidby-influx d9b9e86db9
fix: extend snapshot copy to filesystems that cannot link (#22703)
If os.Link fails with syscall.ENOTSUP, then the file
system does not support links, and we must make copies
to snapshot files for backup. We also automatically make
copies instead of link on Windows, because although it
makes links, their semantics are different from Linux.

closes https://github.com/influxdata/influxdb/issues/16739
2021-10-21 12:53:26 -07: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 59fe8e515e
test: fix DiskSizeBytes flakiness (#22641) 2021-10-08 09:47:12 -04: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
Dane Strandboge b4e781eff6
fix(tsdb): sync series segment to disk after writing (#22566) 2021-09-23 14:10:29 -05:00
davidby-influx 3702fe8e76
fix: for Windows, copy snapshot files being backed up (#22551)
On Windows, make copies of files for snapshots, because
Go does not support the FILE_SHARE_DELETE flag which
allows files (and links) to be deleted while open. This
causes temporary directories to be left behind after
backups.

closes https://github.com/influxdata/influxdb/issues/16289
2021-09-22 10:56:17 -07:00
davidby-influx e53f75e06d
fix: discard excessive errors (#22379)
The tsmBatchKeyIterator discards excessive errors to avoid
out-of-memory crashes when compacting very corrupt files.
Any error beyond DefaultMaxSavedErrors (100) will be
discarded instead of appended to the error slice.

closes https://github.com/influxdata/influxdb/issues/22328
2021-09-03 09:11:05 -07:00
Sam Arnold 38de69cc1c
fix: flux error properly read by cloud (#22348) 2021-08-31 17:43:12 -04:00
davidby-influx 926020e331
fix: correct error return shadowing (#22353) 2021-08-31 11:46:21 -07:00
Sam Arnold 1755b8f6d2
fix: TSI logfile race (#22338)
modTime should be protected by the read lock.

Fixes #22337
2021-08-30 17:43:37 -04:00
Tristan Su e5f6894037
fix(tsm): check write-ahead-log size (#18991) 2021-08-24 11:44:01 -04:00
davidby-influx 7d3efe1e9e
fix: avoid compaction queue stats flutter. (#22195)
When the compaction planner runs, if it cannot acquire
a lock on the files it plans to compact, it returns a
nil list of compaction groups. This, in turn, sets the
engine statistics for compactions queues to zero,
which is incorrect. Instead, use the length of pending
files which would have been returned.

closes https://github.com/influxdata/influxdb/issues/22138
2021-08-16 09:21:07 -07:00
Sam Arnold fd81373937
test: expose tcpaddr for enterprise tests (#22172)
* docs: update comment for series updates

* fix: expose TCP address for Enterprise test harness

* refactor: remove dead RemoteServer code
2021-08-11 17:19:26 -04:00
Sam Arnold 3ae389b359
test: add extra logging when disk size test fails (#22103) 2021-08-07 06:48:42 -04:00
Sam Arnold 444c22b67d
test: fix order of index teardown (#22038) 2021-08-04 16:34:51 -04:00
davidby-influx a989f8f8b6
fix: copy names from mmapped memory before closing iterator (#22040)
This fix ensures that memory-mapped files are not released
before pointers into them are copied into heap memory.
MeasurementNamesByExpr() and MeasurementNamesByPredicate() can
cause panics by copying memory from mmapped files that have been
released. The functions they call use iterators to files which
are closed (releasing the mmapped files) before the memory is
safely copied to the heap.

closes https://github.com/influxdata/influxdb/issues/22000
2021-08-04 13:16:00 -07:00
Sam Arnold e62efaf751
fix: old tsl files should be compacted without new writes (#22006)
* fix: old tsl files should be compacted wihout new writes

* chore: update changelog.md
2021-08-02 13:36:23 -04:00
Sam Arnold b64c2c3dcf
fix: tsi index should compact old or too-large log files (#21943)
* fix: tsi index should compact old log files that are too large

* chore: run automated formatter

* chore: update changelog

* fix: review comments
2021-07-26 17:40:15 -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 6d22e69ef1
fix: hard limit on field size while parsing line protocol (#21843)
Per https://docs.influxdata.com/enterprise_influxdb/v1.9/write_protocols/line_protocol_reference/
we only support 64KB, but 1MB is a more realistic practical limit. Before this commit there was
no enforcement of field value size.

Closes #21841
2021-07-14 17:11:09 -04:00
Tristan Su 108e2600b3
fix(tsi): clean up FileSet fields (#18961) 2021-07-12 10:42:38 -04:00
davidby-influx 73bdb2860e
chore: add logging to compaction (#21707)
Compaction logging will generate intermediate information on 
volume of data written and output files created, as well as 
improve some of the anti-entropy messages related to compaction.

This will also apply to `influx_tools compact`

Closes https://github.com/influxdata/influxdb/issues/21704
2021-06-16 15:28:44 -07:00
davidby-influx aca69e530f
fix: don't access a field in a nil struct (#21693) 2021-06-15 10:23:38 -07:00
davidby-influx bce6553459
fix: Do not close connection twice in DigestWithOptions (#21659)
tsm1.DigestWithOptions closes its network connection
twice. This may cause broken pipe errors on concurrent
invocations of the same procedure, by closing a reused
i/o descriptor. This fix also captures errors from TSM
file closures, which were previously ignored.

Closes https://github.com/influxdata/influxdb/issues/21656
2021-06-10 12:41:42 -07:00
davidby-influx f8202876ad
chore: minor refactor suggested by go lint (#21614)
(cherry picked from commit 7d10228e19)
2021-06-04 14:07:00 -07:00
davidby-influx f64be286be
fix: avoid rewriting fields.idx unnecessarily (#21592)
Under heavy write load creating new fields and measurements
the rewrite of the fields.idx file is a bottleneck. This
enhancement combines multiple writes into a single one and
shares any error return value with all of the combined
invocations. MeasurementFieldSet and the new 
MeasurementFieldSetWriter must both now be explicitly
closed.

Closes #21577
2021-06-04 09:21:33 -07:00
davidby-influx c8da9bafbf
chore(ae): add more logging (#21381) (#21452)
tsdb.Engine.IsIdle and tsdb.Engine.Digest now return a reason string for why the engine & shard are not idle.
Callers can then use this string for logging, if desired. The returned reason does not allocate memory, so the
caller may want to add the shard ID and path for more information in the log. This is intended to be used in
calls from the anti-entropy service in Enterprise.

(cherry picked from commit bf45841359)

fixes https://github.com/influxdata/influxdb/issues/21448
2021-05-11 09:46:45 -07:00