Commit Graph

13152 Commits (b36b9f109f2da91c8941679caf5356e08eee0b2b)

Author SHA1 Message Date
Ben Johnson b36b9f109f
Merge pull request #9324 from influxdata/bj-tsi-log-entry-short-buffer
Fix LogEntry.UnmarshalBinary() short buffer check.
2018-01-16 18:42:09 -07:00
Jason Wilder 5f45208752
Merge pull request #9326 from influxdata/er-series-cardinality
Use bitsets to calculate series cardinality
2018-01-16 16:53:55 -07:00
Edd Robinson bd762380b0 Use bitsets to calculate series cardinality 2018-01-16 23:22:52 +00:00
Ben Johnson 960b6f8ba5
Merge pull request #9325 from influxdata/bj-tsi-partition-close-check
Add tsi1.Partition closing check before compaction.
2018-01-16 16:19:36 -07:00
Jason Wilder f7e554ed52
Merge pull request #9323 from influxdata/jw-fields-corrupt
Rebuild corrupted fields index when necessary
2018-01-16 13:35:49 -07:00
Ben Johnson 3937fed7a1
Add tsi1.Partition closing check before compaction. 2018-01-16 13:32:44 -07:00
Ben Johnson 5f9d53b586
Fix LogEntry.UnmarshalBinary() short buffer check. 2018-01-16 13:14:26 -07:00
Jason Wilder 1c8676b4a3 Rebuild corrupted fields index when necessary
If the fields.idx was corrupted in someway, it would cause the shard
to fail to load.  Deleting the file will allow it to be rebuilt.

This change handles this automatically so it's rebuilt if necessary
without user intervention.
2018-01-16 11:31:07 -07:00
Edd Robinson fd80af3117
Merge pull request #9319 from influxdata/er-shard-rollover
Remove series when shard rolls over
2018-01-16 16:23:48 +00:00
Edd Robinson ceb3abd118 Remove series when shard rolls over
Series should only be removed from the series file when they're no
longer present in any shard. This commit ensures that during a shard
rollover, the series local to the shard are checked against all other
series in the database.

Series that are no longer present in any other shards' bitsets, are then
marked as deleted in the series file.
2018-01-16 15:58:20 +00:00
Edd Robinson ba3fcea53e
Merge pull request #9316 from influxdata/er-assign-unassign
Cleanup Shard assignment/unassignment
2018-01-16 15:57:41 +00:00
Edd Robinson 7ff3f67243
Merge pull request #9321 from influxdata/er-series-lock
Ensure no double Rlocking occurs in IndexSet
2018-01-16 15:56:32 +00:00
Edd Robinson 338f284bc9 Simplify series set Merge logic 2018-01-16 14:56:54 +00:00
Edd Robinson e902998f4e All closes are now fast 2018-01-16 14:56:54 +00:00
Edd Robinson d890f29fcb Remove redundant index methods
Now that each shard-local index is maintaining a bitset of series ids,
tracking the series present in the local shard's tsm engine, there is no
need to track shards in the `inmem` index.

This commit removes the methods associated with tracking those
series/shard relationships.
2018-01-16 14:56:54 +00:00
Edd Robinson 8039165ab4 Ensure no double r-locking occurs in IndexSet
use. However, because the reference counting was implemented via
mutexes, it was possible to double `RLock` the series file mutex. This
allows a `Lock` to arrive in-between the two `RLock`s, (such as when
deleting the database), causing deadlock.

This commit addresses this by ensuring that from within `IndexSet`
methods, when calling other `IndexSet` methods, that they're all
unexported, and that those unexported methods never take a lock on the
series file.

Keeping series file locking in exported `IndexSet` methods only, allows
one to see any future races more easily.
2018-01-16 14:56:34 +00:00
Edd Robinson 5bfd94787b
Merge pull request #9101 from mjs/faster-unescaping
pkg/escape: Preallocate output in Unescape
2018-01-15 22:21:45 +00:00
Menno Finlay-Smits acaf5f097a pkg/escape: Add benchmarks for all bytes escape/unescape funcs 2018-01-16 11:12:47 +13:00
Menno Finlay-Smits b0e871876a pkg/escape: Preallocate output in Unescape
Preallocating the capacity of the output is faster and uses less
memory than letting append() do its own (over)allocation.
2018-01-16 09:37:37 +13:00
Ben Johnson 1b2301cc15
Merge pull request #9318 from influxdata/bj-inmem-insert-batch
In-mem Batch Insert
2018-01-15 12:22:42 -07:00
Ben Johnson e1aff89299
Fix data race. 2018-01-15 11:53:49 -07:00
Ben Johnson d0429dc582
Batch insert series for inmem index. 2018-01-15 11:13:59 -07:00
Edd Robinson e9ecb75a5b
Merge pull request #9315 from influxdata/er-delete-with-bitmap
Implement DROP/DELETE semantics in indexes
2018-01-15 18:13:14 +00:00
Edd Robinson 6d43bd6978 increase race timeout 2018-01-15 16:19:02 +00:00
Edd Robinson 9866a2d6f5 Skip expensive test in race mode 2018-01-15 15:32:37 +00:00
Ben Johnson cc30abcae6
Fix TSI MeasurementExists() test. 2018-01-15 08:28:53 -07:00
Edd Robinson ee8d9e41f0 Update test with new DELETE method format 2018-01-15 13:27:05 +00:00
Edd Robinson a2ece0a49a Pass series id in via Index API 2018-01-15 12:00:31 +00:00
Ben Johnson 47851f4b7d Fix tag value auth check iterator. 2018-01-15 12:00:31 +00:00
Ben Johnson d295f30686 Remove series id check during deletion. 2018-01-15 12:00:31 +00:00
Ben Johnson 1c4ab05c7e Add fast TSI MeasurementHasSeries() check. 2018-01-15 12:00:30 +00:00
Ben Johnson b07e41fa7f Fix partition series set building. 2018-01-15 12:00:30 +00:00
Ben Johnson 9a15130a4c Persist TSI tombstones. 2018-01-15 12:00:30 +00:00
Ben Johnson 69757ccd15 Fix partition series set building. 2018-01-15 12:00:30 +00:00
Edd Robinson 3d153e3808 Don't creation series in partition if none assigned 2018-01-15 12:00:30 +00:00
Edd Robinson 4913f2b4ac Refactor test Index/Series file with correct open 2018-01-15 12:00:30 +00:00
Edd Robinson 96d55c4471 Fix reference bug 2018-01-15 12:00:30 +00:00
Edd Robinson bb6bfad5ea Ensure inmem index updated properly 2018-01-15 12:00:30 +00:00
Edd Robinson b9d0a39131 Skip empty series keys 2018-01-15 12:00:30 +00:00
Edd Robinson 7f244cb29f Use models series key for partition allocation
There are two series key formats: the `models` package format, which is
also line-protocol format, and the `tsdb` package format, which is used
by the series file when serialising series keys.

When writing to a series, rather than taking a `models` format key from
the `coordinator` package and then converting it to a `tsdb` package
format, it would be cheaper to keep the key in the `models` format
before hashing it to determine which partition the key lives in.
2018-01-15 12:00:30 +00:00
Edd Robinson a4bef3a4bc Refactoring delete tests 2018-01-15 12:00:30 +00:00
Edd Robinson 74481b9415 Fix shard tests 2018-01-15 12:00:30 +00:00
Edd Robinson b0e6aeb64c Add some series file testing 2018-01-15 12:00:30 +00:00
Jason Wilder ba9a5af7eb Mark series deleted in series file
This commit adds the ability to correctly mark a series as deleted in
the global series file. Whenever a shard engine determines that a series
should be deleted, it checks with each shard's bitset for series that
are to be deleted and are no longer contained in any shard-local
bitsets.

These series are then removed from the series file.
2018-01-15 12:00:30 +00:00
Edd Robinson cd0c420dce Add more random test cases 2018-01-15 12:00:30 +00:00
Edd Robinson d659d23e26 Add specific failing test cases 2018-01-15 12:00:30 +00:00
Edd Robinson e2e0581b12 Add randomised deletion test
This commits adds a randomised deletion test, which aims to test the
correctness of deletions and drops in the index and series file.

The test works by maintaining its own index of points, series and
measurements, tracking the presence or absence or series.

There are four commands that can be randomly executed:

  - insert a series at a random time
  - drop an entire measurement
  - drop an entire series
  - delete series across a time range

After every invocation of one of these commands, `SHOW SERIES` is
executed on the server, and the results are compared to what the
test's series tracker believes should be present. If the results
differ then the test fails.

On failure, the last 100 queries executed, as well as the series
we expected, and the series returned by `SHOW SERIES`, are returned.
2018-01-15 12:00:30 +00:00
Edd Robinson 286c8f4c09 Return to original DELETE/DROP SERIES semantics
This reverts commit 59afd8cc90.
2018-01-15 12:00:30 +00:00
Jason Wilder 2169ad680e
Merge pull request #9311 from influxdata/jw-delete-error
Don't return error for non-existent series file
2018-01-14 17:24:17 -07:00
Jason Wilder 874d5839da Don't return error for non-existent series file
When dropping series, if the series file does not exists we returned
and error.  This breaks compatibility with prior versions that would
not return an error if the series do not exists.
2018-01-14 12:53:26 -07:00