Commit Graph

136 Commits (933a14e16f0232c5ec883644b7363a59da7bcd90)

Author SHA1 Message Date
Sam Arnold ac96fd45fb
feat: un-revert add total-buffer-bytes config parameter to subscriptions (#21804)
This reverts commit 4d82ed2c07.
2021-07-08 15:00:40 -04:00
Sam Arnold 4d82ed2c07
revert: revert add total-buffer-bytes config parameter to subscriptions (#21803)
Reverts PR #21752

This reverts commit 85abb3af36.
2021-07-07 15:37:37 -04:00
Sam Arnold 85abb3af36
feat: add total-buffer-bytes config parameter to subscriptions (#21752)
* chore: harmonize OSS and Enterprise subscriber initialization

* refactor: chanwriter close blocks until chanwriter is flushed

* refactor: remove redundant state

* test: add test for blocked subscriber during subscription update

* fix: blocked subscriber does not fail subscription update

* fix: only iterate matching subscriptions

* fix: use serialized points in subscriber queues

* feat: add total-buffer-bytes config parameter to subscriptions

* fix: put subscription serialization on the write path

* fix: subscription service only needs regular mutex, not RWMutex

* fix: review comments

* chore: update changelog
2021-07-06 15:56:01 -04:00
davidby-influx a08b69098e
fix: do not send non-UTF-8 characters to subscriptions (#21558)
Added a check for valid UTF-8 strings in measurement names,
tags name, tag values, and field names when writing to subscriptions. 
Do not send the failing points to subscribers, and log the errors if at
debug level logging

Closes https://github.com/influxdata/influxdb/issues/21557
2021-05-26 14:14:36 -07:00
davidby-influx f646cbc540
fix(models): grow tag index buffer if needed (#20137) (#21303) (#21306)
* fix(models): grow tag index buffer if needed (#20137)

(cherry picked from commit cae14176aa)

Co-authored-by: Tristan Su <foobar@users.noreply.github.com>

fixes #21303
2021-04-27 10:44:51 -07:00
Sam Arnold 7210fa6355
chore: Upgrade 1.x to the latest flux (#20767)
* chore: Update flux to 0.67

* chore: Builds against 0.68 flux

* chore: Builds against 0.80.0

* chore: Builds against 0.90.0

* chore: Everything builds on latest flux

* chore: goimports fixed

* chore: fix tests locally

* chore: fix CI dockerfiles

* chore: clean up some unused code

* chore: remove flux repl and Spec in flux query json

* chore: port flux end to end tests from 2.x

* chore: fix up goimports

* chore: remove 32 bit build support
2021-03-03 16:24:49 -05: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
Ben Wells e9bada090f Fix misspelling identified by misspell 2019-02-03 20:27:43 +00:00
Jonathan A. Sternberg a16096cbc4
Merge pull request #9943 from michaelyou/hotfix-typo
Some typo and Wrong position of comment
2018-11-05 12:36:05 -06:00
Jeff Wendling 69dc031a75 Use platform for most of the read service code
This commit deletes most of the code to service reads from influxdb
and pulls it in from platform instead.

Of note, the models.Tag and models.Tags types are now aliases to the
platform models.Tag and models.Tags types. Additionally, many types
in the tsdb package relating to cursors are also aliases to the same
types in the platform cursors package.

This updates the platform and flux repos to the current master in the
Gopkg.lock.
2018-10-10 11:20:25 -06:00
David Norton 01d5805952 fix line protocol parsing panic 2018-08-09 10:56:34 -04:00
Edd Robinson 537da76efd Address PR feedback 2018-07-09 11:51:48 +01:00
Edd Robinson ad388a8fd8 Address PR feedback 2018-07-09 11:51:48 +01:00
Edd Robinson ac0f125db9 Provide an API for re-using tags 2018-07-09 11:51:48 +01:00
michaelyou 88ccbe43b3 Some typo and Wrong position of comment 2018-06-21 10:46:10 +08:00
Jacob Marble 44c5da060b buildtsi: Do not escape measurement names
When `influx_inspect buildtsi` is used to create a new `tsi1` index, spaces in measurement names are escaped, so measurement "a b" is changed to "a\ b".

This change modifies `models.ParseKeyBytes()` and `models.ParseName()` to unescape measurement names. `models.ParseKeyBytes()` returns unescaped tag keys, so this seems like the natural place to unescape measurement names.

Also followed `scanMeasurement()` to see what other code could be problematic, and this should be everything (the result of one other use of `scanMeasurement()` is later escaped).

Removed `tsdb.MeasurementFromSeriesKey()`. These methods are exported, so checked for side effects in other InfluxData repositories.
2018-05-30 15:20:56 -07:00
Ben Johnson 4cb36d5301
Add key sanitization to deletetsm
This commit adds the `-sanitize` flag to `influx_inspect deletetsm`
which will delete all keys that contain invalid, non-printable, or
replacement character unicode.

Usage:

```sh
$ influx_inspect deletetsm -sanitize PATH
```
2018-04-30 13:06:33 -06:00
Edd Robinson a446134d6f
Merge pull request #8034 from dsouzae/br_validate_points
Validate points on input
2018-04-26 10:42:12 +01:00
Edd Robinson 6b350edf59 Ensure correct number of tags parsed
This commit fixes a parsing bug that was causing extra tags to be
generated when the incoming point contained escaped commas.

As an optimisation, the slice of tags associated with a point was
being pre-allocated using the number of commas in the series key as a hint to
the appropriate size. The hinting did not consider literal comma values in
the key though, and so it was possible for extra (empty) tag key and
value pairs to be part of the tags structure associated with a parsed
point.
2018-03-14 13:28:55 +00:00
Stuart Carnie d4282317f3 Add ForEachTag API 2018-03-12 16:23:57 -07:00
Stuart Carnie ceefa7f7b0 Improve MakeKey, HashKey performance 2018-03-12 16:23:57 -07:00
Edd Robinson 67d1fa3972 Cleanup remaining packages 2018-01-21 12:08:25 -08:00
Stuart Carnie 5dfe3b2645 inmem startup improvments
* only call ParseTags when necessary
* remove dependency on inmem.Series in tsdb test package
* Measurement and Series are no longer exported. Their use is restricted
  to the inmem package
* improve Measurement and Series types by exporting immutable
  fields and removing unnecessary APIs and locks

Reduced startup time from 28s to 17s. Overall improvement including
#9162 reduces startup from 46s to 17s for 1MM series across 14 shards.
2017-12-29 07:58:52 -07:00
Jason Wilder de5592cda9 Extract ParseKeyBytes from ParseKey
Allows callers to use []byte and avoid a string allocation
2017-11-13 08:48:03 -07:00
Jason Wilder ed246db55a Fix panic: runtime error: slice bounds out of range
Fixes #8538
2017-11-08 17:00:25 -07:00
Jonathan A. Sternberg e415d0b10f Merge pull request #8835 from influxdata/js-uint-write-protocol
Add uint support into the write protocol
2017-10-09 10:55:16 -05:00
Jonathan A. Sternberg 2f47c3d28f Add support for uint64 in the clients 2017-10-05 09:35:06 -05:00
Jonathan A. Sternberg ff7b576389 Add uint support into the write protocol
This is currently protected behind a conditional compilation flag. Use
`-tags uint` or `-tags uint64` to enable this.
2017-09-19 10:44:26 -05:00
Jason Wilder a8d9eeef36 Reduce lock contention when deleting high cardinality series
Deleting high cardinality series could take a very long time, cause
write timeouts as well as dead lock the process.  This fixes these
issue to by changing the approach for cleaning up the indexes and
reducing lock contention.

The prior approach delete each series and updated every index (inmem)
during the delete.  This was very slow and cause the index to be locked
while it items in a slice were removed one by one.  This has been changed
to mark series as deleted and then rebuild the index asynchronously which
speeds up the process.

There was also a dead lock that could occur when deleing the field set.
Deleting the field set held a write lock and the function it invoked under
the lock could try to take a read lock on the field set.  This would then
deadlock.  This approach was also very slow and caused time out for writes.
It now uses faster approach that checks for the existing of the measurment
in the cache and filestore which does not take write locks.
2017-09-07 11:36:02 -06:00
Ben Johnson 60ab1282ea
Refactor system iterators.
Previously pseudo iterators could be created for meta data such
as series, measurement, and tag data. These iterators were created
at a higher level and lacked a lot of the power of the query engine.

This commit moves system iterators down to the series level and
supports the following:

	- _name
	- _seriesKey
	- _tagKey
	- _tagValue
	- _fieldKey

These can be used as normal fields such as:

	SELECT _seriesKey FROM cpu

This will return all the series keys for `cpu`.
2017-08-16 09:27:29 -06:00
Stuart Carnie eec80692c4 Taught tsm1 storage engine how to read and write uint64 values
* introduced UnsignedValue type
  * leveraged existing int64 compression algorithms (RLE, Simple 8B)
* tsm and WAL can read and write UnsignedValue
* compaction is aware of UnsignedValue
* unsigned support to model, cursors and write points

NOTE: there is no support to create unsigned points, as the line
protocol has not been modified.
2017-07-24 09:03:22 -07:00
lrita 72fcf6283e optimize point split, which reduce unnecessary allocate 2017-06-15 16:28:49 +08:00
Joe LeGasse 815f740f4c initial fga work
wip

wip

fix tests / build
2017-05-26 13:16:27 -07:00
Jason Wilder 5372db6327 Fix point validation to include field key length
The series key stored in TSM files includes the field.  We validated
the series length using only the measurement and tag set which allowed
very large field names to overflow.  This now checks the series key
as the measurement + tagset + field + the tsm field key separator size.
2017-05-24 14:39:54 -06:00
Jason Wilder 2cac46ebbc Convert usage of strings to []byte
Measurement name and field were converted between []byte and string
repetively causing lots of garbage.  This switches the code to use
[]byte in the write path.
2017-05-12 14:05:19 -06:00
Stuart Carnie 2770a17095 Merge pull request #8207 from stuartcarnie/master
Fixes issue #8199
2017-04-26 15:32:09 -07:00
Jason Wilder 5c51ae7319 Merge branch '1.2' into jw-merge-123 2017-04-14 14:36:54 -06:00
Jason Wilder ff1270dfeb Fix dropping fields created data corruption
The Point is intended to be immutable after being parsed since it
is shared by several goroutines.  When dropping a field (e.g. time),
corrupted data can result if one goroutine is delete the field
while another is marshaling the underlying byte slices.

To avoid this, the shard will just skip invalid fields and series
instead of trying to mutate them by deleting them.
2017-04-07 12:58:42 -06:00
Jason Wilder c3e0748bd9 Optimize Point.NewPointFromBytes
There was a check to ensure that fields exists when unmarshalBinary
is called.  This created a map and other garbage just to see if any
fields exist.

This changes it to use a FieldIterator that does not allocate as
much as the other method.
2017-04-06 12:51:45 -06:00
Jason Wilder 1a4b1b3109 Fix delete time fields creating unparseable points
If a field was named time was written and was subsequently dropped,
it could leave a trailing comma in the series key causing it to fail
to be parseable in other parts of the code.
2017-04-04 16:37:51 -06:00
Jason Wilder abaf42fbab Merge pull request #8251 from influxdata/jw-time-delete
Fix delete time fields creating unparseable points
2017-04-04 18:37:00 -04:00
Jason Wilder ca55fff12c Fix delete time fields creating unparseable points
If a field was named time was written and was subsequently dropped,
it could leave a trailing comma in the series key causing it to fail
to be parseable in other parts of the code.
2017-04-04 16:19:11 -06:00
Stuart Carnie 9e69bdbef5 Fixes issue #8199
Benchmarks

```
benchmark              old ns/op     new ns/op     delta
BenchmarkMarshal-8     1216          1007          -17.19%

benchmark              old allocs     new allocs     delta
BenchmarkMarshal-8     4              2              -50.00%

benchmark              old bytes     new bytes     delta
BenchmarkMarshal-8     416           256           -38.46%
```
2017-03-25 13:33:36 -07:00
Ben Johnson 358b1e0b05
Merge remote-tracking branch 'upstream/master' into tsi 2017-03-15 10:13:32 -06:00
Jason Wilder 675d7c9d65 Merge branch '1.2' into jw-merge12 2017-03-06 11:09:05 -07:00
Ben Johnson dffd12319c
Add point.UnmarshalBinary() bounds checking. 2017-03-01 12:01:25 -07:00
Jason Wilder a024003f2c Merge branch '1.2' into jw-merge-12 2017-02-22 12:13:29 -07:00
Ben Johnson 78a9bb2527 Remove Tags.shouldCopy, replace with forceCopy on series creation.
Previously, tags had a `shouldCopy` flag to indicate if those tags
referenced an underlying buffer and should be copied to allow GC.
Unfortunately, this prevented tags from being copied that were
created and referenced the mmap which caused segfaults.

This change removes the `shouldCopy` flag and replaces it with a
`forceCopy` argument in `CreateSeriesIfNotExists()`. This allows
the write path to indicate that tags must be cloned on insert.
2017-02-21 11:13:35 -07:00
Ellery D'Souza 95c5ddc940 Error on unsupported +/- Inf value, validate value client side in NewPoint.
influxdb will give the following errors:
    value=+Inf - invalid boolean
    value=-Inf - invalid number
2017-02-20 13:00:43 -05:00
Edd Robinson 4fbba8234e Add Size to models.Tags 2017-02-08 18:44:48 +00:00