Commit Graph

14 Commits (8ab90d335f67d6b9c197c8b237284b27a975a4a2)

Author SHA1 Message Date
Daniel Moran 2920b55e19
fix(http): fix passing of bucket ID by write-handler client (#20679) 2021-02-02 17:34:40 -05:00
Daniel Moran 591866beb7
fix(write): drop empty lines from write batches (#20669) 2021-02-02 10:20:59 -05:00
Pavel Zavora e914f6677a chore(write): refactor batcher to reuse code 2020-10-11 13:25:57 +02:00
Greg fcb70c26d5
fix: add ability to define bucket to write to with a BucketFilter (#19658) 2020-10-05 15:05:49 -06:00
Stuart Carnie b3b8f9e200 fix: Changed per feedback 2020-09-29 13:44:18 -07:00
Stuart Carnie a4fb30d1b4 fix: Allow longer lines than the default for bufio.Scanner
This commit adds a field to Batcher to configure the maximum allowed
line length. If this value is non-zero, the bufio.Scanner buffer
will be configured scan lines up to this length. If a line exceeds
this length an ErrLineToLong error will be returned.

Simplified TestBatcher_read tests and added a test case for this
new scenario and to ensure lines exceeding the default
bufio.MaxScanTokenSize are allowed.
2020-09-29 13:44:18 -07:00
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
David McKay 1b5ae7780b fix(cmd/write): remove shared buffer access that caused race condition on large imports 2020-02-15 00:20:59 +00:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Jeff Wendling 9da6fb3410 fix(write): fix close logic to avoid race from read error
In the case that there is a read error, we would close the lines
channel before sending the error into the read error channel. closing
lines then allows the write goroutine to possibly send in a nil error
before read is able to, causing the main function driving both to
return a nil error. Additionally, it is possible for both reads and
writes to race sending errors into their channels, and the main
goroutine will only read from one, causing the other goroutine to leak.

To fix this, we close lines only after we have sent an error into
the channel, we ensure we read from both errors to make sure that
both have exited, and we unify the channels and add a buffer of size
two to the channel. It is possible for write to exit leaving read blocked
forever, but write only exits with a nil error when read has exited, so
this only happens during an actual write error, just like before.

Channels are hard.
2018-12-29 15:30:38 -07:00
Chris Goller ad50cb1527 refactor(write): reuse timers 2018-10-25 19:13:53 -05:00
Chris Goller 6ce2530003 refactor(write): reuse bytes readers 2018-10-25 19:13:53 -05:00
Chris Goller 7a9f9cc378 test(write): add batcher tests 2018-10-25 19:13:53 -05:00
Chris Goller 9d64d2192b feat(write): add line protocol batch writing 2018-10-25 19:13:53 -05:00