Commit Graph

2639 Commits (409de34abfa95f34d48d62ddd1adc0e5cea9ebc9)

Author SHA1 Message Date
David Norton 25381f97c8
Merge pull request #15952 from influxdata/er-verify-tombstone
feat(inspect): add influx_inspect verify-tombstone tool
2020-03-11 15:56:37 -04:00
docmerlin (j. Emrys Landivar) 30dab03310 fix: remove some unsafe marshalling to reduce risk of segfault
We were seing segfaults in Roaring bitmaps sometimes, under very
high load with networked drives.  This may reduce risk of segfault by
forcing marshalling to copy the data.
2020-03-11 13:47:29 -04:00
Ayan George 5f47c388df
chore(influxdb): Forward port 16999 (#17032)
* fix: access tsi active log file with READ lock

The activeLogFile pointer may be altered by other routine so the READ
lock is needed.

* Merge pull request #16384 from foobar/tsi-partition-lock

fix: access tsi active log file with READ lock

Co-authored-by: Tristan Su <sooqing@gmail.com>
Co-authored-by: David Norton <dgnorton@gmail.com>
2020-03-04 16:20:58 -05:00
Edd Robinson c3f4382ed8
Merge pull request #16606 from influxdata/BP-1.8-er-tsm-block-fix
fix(storage): ensure all block data returned
2020-03-03 14:32:15 +00:00
Ben Johnson 7a9eb1420c fix(tsdb): Fix -compact-series-file flag 2020-02-06 13:40:19 -07:00
Gianluca Arbezzano a3e37f417d
Merge pull request #16627 from influxdata/feature/skip-wal-cache
chore(tsm1): skip WriteSnapshot during backup if snapshotter is busy
2020-02-04 21:44:48 +01:00
Gianluca Arbezzano 30621ca9ec chore(tsm1): skip WriteSnapshot during backup if snapshotter is busy
When an InfluxDB database is very busy writing new points the backup
the process can fail because it can not write a new snapshot.

The error is: `operation timed out with error: create snapshot: snapshot in progress`.

This happens because InfluxDB takes almost "continuously" a snapshot
from the cache caused by the high number of points ingested.

This PR skips snapshots if the `snapshotter` does not come available
after three attempts when a backup is requested.

The backup won't contain the data in the cache or WAL.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-02-04 20:09:50 +01:00
Edd Robinson 34c0fdafc0 feat(storage): Offline series file compaction 2020-02-03 13:57:31 -07:00
David Norton 962cf6f4e7
Merge pull request #16595 from influxdata/fix/show-series-cardinality
fix(tsm1): improve series cardinality limit
2020-01-21 18:08:13 -05:00
David Norton 903d2c2d28 fix(tsm1): improve series cardinality limit
Prior to this change, new series would be added to the series file
before checking the series cardinality limit. If the limit was exceeded,
the write was rejected even though the series had already been added to
the series file.
2020-01-21 16:45:13 -05:00
Edd Robinson 22798fa290 fix(storage): ensure all block data returned
This commit prevents multiple blocks for the same series key having
values truncated when they are being read into an empty buffer.

The current cursor reader code has an optimisation that incorrectly
assumes the incoming array will be limited to 1,000 values (the maximum
block size), but arrays can contain values from multiple matching
blocks.
2020-01-21 18:00:11 +00:00
Sean Brickley fe55d728f0 fix(tsm1): Compaction log error 2020-01-13 20:05:05 -05:00
tmgordeeva f1d26652e9
fix(storage): skip TSM files with block read errors (#15885)
* fix(storage): skip TSM files with block read errors

When we find a bad TSM file during compaction, propagate the error up and move
the bad file aside. The engine will disregard the file so the next compaction
will not hit the same error.
2019-12-13 15:05:39 -08:00
Edd Robinson f7f19c5904 refactor(storage): add tombstone extension 2019-11-17 14:43:38 +00:00
Edd Robinson 196e46982b
Merge pull request #15861 from influxdata/BP-1.8-er-tsi-not-equal
fix(tsi1): index defect with negated equality filters
2019-11-13 18:15:01 +00:00
David Norton 102fcd671b fix(tsm1): make Digest() safe for concurrent use
This change adds a lock around digest creation so that it is safe for
concurrent calls. Prior to this change, calls from multiple goroutines
resulted in "Digest aborted, problem renaming tmp digest" errors.
2019-11-12 18:02:41 -05:00
Edd Robinson cac4c8956c fix(tsi1): index defect with negated equality filters
Fixes #15859

This commit fixes a defect in the TSI index where a filter using the
negated equality operator would result in no matching series being
returned for series stored within the `IndexFile` portions of the index.

The root cause of this was due to missing legacy-handling code in the
index for this particular iterator.
2019-11-12 15:10:42 +00:00
Jonathan A. Sternberg 40a7a577fc
Update flux version to v0.50.2
This upgrades the flux version to v0.50.2.

The secret service, which is used for alerts, is not included. The
`to()` function is also still not included.
2019-10-29 16:19:14 -05:00
elbehery a4bb1083f2 fix(storage): Renaming corrupt data files fails
fixes#14107
2019-10-28 17:32:58 +01:00
Ben Johnson 14d45c913c
fix(tsi1): replace TSI compaction wait group with counter 2019-09-18 11:47:37 -06:00
maxunt 021dd3114d
Merge pull request #14245 from influxdata/mu-tsm-clean-1.8-14058
Clean tmp tsm files when replace fails
2019-08-08 17:02:01 -07:00
Jacob Marble b731cc5e60
feat(storage): Limit concurrent series partition compaction (#14240)
* feat(storage): Limit concurrent series partition snapshots

* feat: make concurrency configurable

* fix: integrate review feedback

* refactor: rename config value
2019-07-30 10:34:06 -07:00
Edd Robinson 0ff7fb96b1
Merge pull request #14266 from influxdata/er-fix-fields
fix(storage): Fix issue where fields re-appear
2019-07-09 15:47:47 +01:00
Max U c6c0a5d3b1 change log level from info to error 2019-07-08 14:52:53 -04:00
Mark Rushakoff 2dfafe822c Remove stray fmt.Println in tsm1.StringArrayEncodeAll
It was introduced in #13699.

Updates #14265.
2019-07-05 15:58:53 -07:00
Edd Robinson f4413d726b test(storage): skip flaky test 2019-07-05 15:07:09 +01:00
Edd Robinson 9bfd1119b9 fix(storage): Fix issue where fields re-appear
Fixes #10052

This commit fixes an issue where field keys would reappear in results
when querying previously dropped measurements.

The issue manifests itself when duplicates of a new series are inserted
into the `inmem` index. In this case, a map that tracks the number of
series belonging to a measurement was incorrectly incremented once for
each duplication of the series. Then, when it came time to drop the
measurement, the index assumed there were several series belonging to
the measurement left in the index (because the counter was higher than
it should be). The result of that was that the `fields.idx` file (which
stores a mapping between measurements and field keys) was not truncated
and rebuilt. This left old field keys in that file, which were then
returned in subsequent queries over all field keys.
2019-07-05 12:24:03 +01:00
Max U 9091d72ba7 initial commit for 1.8 2019-07-02 13:18:20 -04:00
Edd Robinson 43e144a923 fix(storage): ensure WAL size correctly set on startup 2019-06-28 16:20:45 +01:00
Edd Robinson ecff62b9e4 test(storage): add test for reproducing #14229 2019-06-28 16:18:32 +01:00
Jonathan A. Sternberg 7ca4e644f1
Update flux version to v0.33.2 (#14208)
The flux in influxdb has been upgraded to use v0.33.2. A lot of
interfaces for the storage engine were changed during this so code had
to change to accomodate the new interfaces and remove the old ones.

Included in this commit is a patch file for the changes that were made.
A patch was generated for the following packages:

* `flux/stdlib/influxdata/influxdb`
* `storage/reads`
* `tsdb/cursors`

These are the three packages that are in common with version 2 of the
database and the first of these packages contains the specific
implementations that are used for version 1.

It is very possible that the next time we upgrade this, the patch will
not apply cleanly just like it wouldn't have applied cleanly to this
update. The patch is mostly meant to document exactly what changed
during the copy over to help ensure we don't forget things when adapting
the interfaces.

Add a patch file to hopefully make this easier in the future
2019-06-27 13:52:02 -05:00
Stuart Carnie a0f7c15b08
chore: Fix constant for 32-bit architecture 2019-06-07 11:00:13 -07:00
Stuart Carnie 86734e7fcd
fix(storage): Don't panic when length of source slice is too large
StringArrayEncodeAll will panic if the total length of strings
contained in the src slice is > 0xffffffff. This change adds a unit
test to replicate the issue and an associated fix to return an error.

This also raises an issue that compactions will be unable to make
progress under the following condition:

* multiple string blocks are to be merged to a single block and
* the total length of all strings exceeds the maximum block size that
  snappy will encode (0xffffffff)

The observable effect of this is errors in the logs indicating a
compaction failure.

Fixes #13687
2019-06-04 17:05:01 -07:00
Stuart Carnie f1e1164e96
fix(storage): Don't panic when length of source slice is too large
StringArrayEncodeAll will panic if the total length of strings
contained in the src slice is > 0xffffffff. This change adds a unit
test to replicate the issue and an associated fix to return an error.

This also raises an issue that compactions will be unable to make
progress under the following condition:

* multiple string blocks are to be merged to a single block and
* the total length of all strings exceeds the maximum block size that
  snappy will encode (0xffffffff)

The observable effect of this is errors in the logs indicating a
compaction failure.

Fixes #13687
2019-05-30 08:23:58 -07:00
Jacob Marble 12a52a0321
fix(series file): Sync series segment after truncate (#13836) 2019-05-09 08:29:25 -07:00
Jonathan A. Sternberg 3406e8c7ff
Merge pull request #13153 from influxdata/deps/upgrade-flux
Upgrade flux to the latest version and remove the platform dependency
2019-04-04 11:41:27 -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 Johnson 2edbc907a1
Add nil check for tagKeyValueEntry.setIDs()
Previously it was possible to set IDs on a `nil` entry which would
in turn cause a panic. If this panic was recovered by the server
then it would result in a mutex in the `inmem` index staying locked
indefinitely.
2019-04-02 10:04:39 -06:00
Jeff Wendling 8e56b3ff1e
Merge pull request #11970 from influxdata/jmw-shard-epoch-races
Fix some more shard epoch races
2019-02-19 10:40:09 -07:00
Edd Robinson 67cfa21732
Merge pull request #10541 from gpomykala/10540
Fix open/close race in SeriesFile
2019-02-19 16:53:25 +00:00
Jeff Wendling 1d9ce868e2 Fix some more shard epoch races
We're not allowed to access the s.epochs map without holding the
mutex against shard creation and deletion, so create a copy of
all of the epoch trackers we will need while we hold the mutex.
2019-02-19 08:59:13 -07:00
Ben Johnson c61db43dc2
Update tagKeyValue mutex to write lock.
This commit changes the read lock to a write lock when calling the
`ids()` function because `ids()` can mutate the underlying series
ids slice.
2019-02-15 09:29:48 -07:00
Jeff Wendling 40d2b70376 Ensure that cached series id sets are Go heap backed 2019-02-12 15:20:24 -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
Ben Johnson aa3dfc0662
Merge pull request #11791 from influxdata/bj-revert-limit-full-compaction-1.8
Revert "Limit force-full and cold compaction size."
2019-02-11 12:50:55 -07:00
Ben Johnson b87605f521
Fix shard epoch race. 2019-02-11 12:15:46 -07:00
Ben Johnson 198f6fde38
Fix deleteSeriesRange() race condition. 2019-02-11 11:29:09 -07:00
Ben Johnson 2dd913d71b
Revert "Limit force-full and cold compaction size."
This reverts commit 40db64d0b9.
2019-02-11 11:07:44 -07:00
Edd Robinson 05e7def600
Merge pull request #10332 from ludweeg/ludweeg/unslice
Simplify s[:] to s where s is a slice
2019-02-11 10:24:43 +00:00
Grzegorz Pomykala 8448cf4a9c build fixed 2019-02-06 16:27:59 +01:00