Commit Graph

2138 Commits (3108eea3307f4b0d46aa9ffc7c74c590bad9832e)

Author SHA1 Message Date
Edd Robinson 42ba4831ba Update Digest test 2017-12-15 18:45:20 +00:00
Edd Robinson c476a0b4a1 Merge branch 'master' into er-tsi-index-part 2017-12-15 18:31:24 +00:00
Edd Robinson 73fcf894b6 Fix shard races when accessing index 2017-12-15 18:19:55 +00:00
Edd Robinson d59f79338b Update series map threshold 2017-12-15 15:58:01 +00:00
Edd Robinson 3bfe525705 Add 32-bit support to series file
This commit ensures that the series file should work appropriately on
32-bit architecturs. It does this by reducing the maximum size of a
series file to 512MB on 32-bit systems, which should be fully
addressable.

It further updates tests so that the series file size can be reduced
further when running many tests in parallel on 32-bit architectures.
2017-12-15 15:47:26 +00:00
Jason Wilder 2d85ff1d09 Adjust compaction planning
Increase level 1 min criteria, fix only fast compactions getting run,
and fix very large generations getting included in optimize plans.
2017-12-14 22:41:34 -07:00
Jason Wilder 749c9d2483 Rate limit disk IO when writing TSM files
This limits the disk IO for writing TSM files during compactions
and snapshots.  This helps reduce the spiky IO patterns on SSDs and
when compactions run very quickly.
2017-12-14 22:02:32 -07:00
Edd Robinson 7e662a1294 Fix some races 2017-12-15 01:18:36 +00:00
Edd Robinson 289d1f8d44 Allow iterators to return if shard is closing 2017-12-15 00:46:43 +00:00
Edd Robinson 59afd8cc90 Return to original DELETE/DROP SERIES semantics
Since possibly v0.9 DELETE SERIES has had the unwanted side effect of
removing series from the index when the last traces of series data are
removed from TSM. This occurred because the inmem index was rebuilt on
startup, and if there was no TSM data for a series then there could be
not series to add to the index.

This commit returns to the original (documented) DROP/DETETE SERIES
behaviour. As such, when issuing DROP SERIES all instances of matching
series will be removed from both the TSM engine and the index. When
issuing DELETE SERIES only TSM data will be removed.

It is up to the operator to remove series from the index.

NB, this commit does not address how to remove series data from the
series file when a shard rolls over.
2017-12-15 00:02:06 +00:00
Edd Robinson 9e3b17fd09 Ensure deleted series are not returned via iterators 2017-12-14 21:29:35 +00:00
Jason Wilder 6e3602c937 Revert "Increase cache-snapshot-memory-size default"
This reverts commit 171b427a1b.
2017-12-13 13:18:08 -07:00
Jason Wilder 7dc5327a0a Adjust snapshot concurrency by latency
This changes the approach to adjusting the amount of concurrency
used for snapshotting to be based on the snapshot latency vs
cardinality.  The cardinality approach could use too much concurrency
and increase the number of level 1 TSM files too quickly which incurs
more disk IO.

The latency model seems to adjust better to different workloads.
2017-12-13 13:17:56 -07:00
Edd Robinson 7080ffcaaa Fix MANIFEST test 2017-12-13 15:55:49 +00:00
David Norton 253ea7cc5e feat #9212: fix file in use bug on Windows 2017-12-13 09:29:07 -05:00
David Norton 98ebad951f feat #9212: move reader/writer tests over 2017-12-13 09:28:34 -05:00
David Norton 4e13248d85 feat #9212: add ability to generate shard digests 2017-12-13 09:28:34 -05:00
Edd Robinson f1bcc97e89 Fix auth tests 2017-12-12 21:25:35 +00:00
Edd Robinson 077cbba0e8 Fix index tests 2017-12-12 21:25:35 +00:00
Edd Robinson 0844f20dc4 Engine tests 2017-12-12 21:25:35 +00:00
Adam af2918a193
fix file_store path bug that affects windows users (#9219) 2017-12-11 17:31:33 -05:00
Ben Johnson 288c5217e8
Fix tsi1 tools. 2017-12-08 16:12:33 -07:00
Edd Robinson 7d13bf3262 merge master 2017-12-08 17:21:58 +00:00
Edd Robinson f6835632e7 Merge master into branch 2017-12-08 17:11:07 +00:00
Edd Robinson 3318c94a2f Clean up 🛁: 2017-12-08 11:38:53 +00:00
Ben Johnson 0e0e7cfc08
Fix tests. 2017-12-07 09:59:39 -07:00
Adam a0b2195d6b
Pulled in backup-relevant code for review (#9193)
for issue #8879
2017-12-07 11:35:20 -05:00
Ben Johnson 37803d6803
Fixed 'tests' pkg. 2017-12-07 08:33:47 -07:00
Jason Wilder 9f2a422039 Use disk based TSM index more selectively
The disk based temp index for writing a TSM file was used for
compactions other than snapshot compactions.  That meant it was
used even for smaller compactiont that would not use much memory.
An unintended side-effect of this is higher disk IO when copying
the index to the final file.

This switches when to use the index based on the estimated size of
the new index that will be written.  This isn't exact, but seems to
work kick in at higher cardinality and larger compactions when it
is necessary to avoid OOMs.
2017-12-06 13:45:43 -07:00
Jason Wilder 0a85ce2b73 Schedule compactions less aggressively
This runs the scheduler every 5s instead of every 1s as well as reduces
the scope of a level 1 plan.
2017-12-06 13:45:43 -07:00
Jason Wilder 56d8f05f12 Cap concurrent compactions when large number of cores exists
The default max-concurrent-compactions settings allows up to 50%
of cores to be used for compactions.  When the number of cores is
high (>8), this can lead to high disk utilization.  Capping at
4 and combined with high snapshot sizes seems to keep the compaction
backlog reasonable and not tax the disks as much.  Systems with lots
of IOPS, RAM and CPU cores may want to increase these.
2017-12-06 13:45:08 -07:00
Jason Wilder e584cb6842 Increase cache-snapshot-memory-size default
With the recent changes to compactions and snapshotting, the current
default can create lots of small level 1 TSM files.  This increases
the default in order to create larger level 1 files and less disk
utilization.
2017-12-06 09:39:03 -07:00
Jason Wilder 9c1d7d00a9 Switch O_SYNC to periodic fsync
O_SYNC was added with writing TSM files to fix an issue where the
final fsync at the end cause the process to stall.  This ends up
increase disk util to much so this change switches to use multiple
fsyncs while writing the TSM file instead of O_SYNC or one large
one at the end.
2017-12-06 09:35:24 -07:00
Ben Johnson c36817fffc
Fix retain/release hang issues. 2017-12-06 09:09:41 -07:00
Ben Johnson f9807a635c
Merge branch 'er-tsi-index-part' of https://github.com/influxdata/influxdb into er-tsi-index-part 2017-12-05 12:10:17 -07:00
Ben Johnson 493c1ed0d1
inmem tests passing. 2017-12-05 10:49:58 -07:00
Edd Robinson ca1cfe4b81 Refactor File mock 2017-12-05 16:17:15 +00:00
Ben Johnson f5f85d65f9
Fixing more tests. 2017-12-04 10:29:04 -07:00
Ben Johnson e0df47d54f
Fixing up tests. 2017-12-02 16:52:34 -07:00
Jason Wilder 909a2fb6cc Fix deletes removing index for invalid time ranges
If a delete for a time that does not exist was run, we would not
remove the series key from the slice of series to remove from the
index.

This could be triggered by running somethin like "delete from cpu where
time = 0" and if there was no data at time 0, the series would still
be removed from the index.
2017-11-30 15:01:01 -07:00
Jason Wilder b6096414c2 Fix compactions aborting early
If there were many individual deletes to a series that ended up
deleting every value in the block and the tombstone timestamps
were not contigous, it was possible for the TSMKeyIterator to
return false for Next incorrectly.  This causes the compaction to
drop any remaining data in the file.

Normally, if all the data is deleted via tombstones, we remove the
whole key from the TSM index.  In this case, we're not able to determine
that the key is fully deleted until the block is decode and tombstones
are applied.

This changes the TSMKeyIterator to detect this condition and continue
to the next key instead of aborting.
2017-11-30 14:38:09 -07:00
Edd Robinson 68de5ca24f 🔥 little endianness 2017-11-30 17:57:16 +00:00
Edd Robinson a46f186118 Tweak constants 2017-11-30 17:23:03 +00:00
Edd Robinson 1e891b5fbc Change logging level 2017-11-30 14:08:44 +00:00
Ben Johnson f1cf55ca99
Merge branch 'er-tsi-index-part' of https://github.com/influxdata/influxdb into er-tsi-index-part 2017-11-30 05:45:40 -07:00
Andrew Hare 761a8f8bec Schedule a full compaction after a successful import 2017-11-29 13:50:38 -07:00
Jason Wilder 5cf7d52694 Ensure series keys are sorted
The Measurement added series keys from a map where the iteration
order is non-deterministic.  The keys should be returned in sorted
order.
2017-11-29 11:24:10 -07:00
Ben Johnson ca09f18e65
intermediate: tsdb compile 2017-11-29 11:20:18 -07:00
Jason Wilder 8633e38549 Fix removing series from index
The loop to check if a series still exists in a TSM file was wrong
in that it 1) exited early after one iteration and 2) had an off
by one error that causes the wrong series to be marked as existing.

This fixes both of these cases which can cause the index to become
inconsistent with the data store on disk.
2017-11-29 10:45:04 -07:00
Edd Robinson c2f7f0f430
Merge pull request #8491 from influxdata/er-tsi-restore
Add support for TSI shard streaming and shard size
2017-11-29 15:40:52 +00:00
Jason Wilder 887bca752e Skip flaky test on windows 2017-11-28 16:43:45 -07:00
Edd Robinson 81976bca59 Refactor based on new design 2017-11-28 17:54:29 +00:00
Jason Wilder e62f6d7cdf Fix Cache.DeleteRange not deleting all data
This fixes a regression in the Cache introduced in ca40c1ad3c where
not all the values in the cache entry would be removed.  Previously,
calling Exclude did not require the values to be sorted.  The change
in ca40c1ad3c relies on the values being sorted so it was possible for
it to find the wrong indexes in when calling FindRange and leave some
data that should be deleted.

Fixes #9161
2017-11-28 10:39:21 -07:00
Edd Robinson b10249a9b3 Fix rebase 2017-11-28 15:58:35 +00:00
Edd Robinson 041a3837be Ensure index can track fields 2017-11-28 15:57:03 +00:00
Edd Robinson 38e0dd695f Allow concurrent access to Engine Index 2017-11-28 15:57:03 +00:00
Edd Robinson abae36f992 Ensure all index fields set 2017-11-28 15:57:02 +00:00
Edd Robinson 368420c670 Fix test due to index changes 2017-11-28 15:57:02 +00:00
Edd Robinson 67c67aeb34 Update test for Windows 2017-11-28 15:57:02 +00:00
Edd Robinson 12a2ff7fac Add support for TSI shard streaming and shard size
This commit firstly ensures that a shard's size on disk is accurately
reported when using the tsi1 index, by including the on-disk size of the
tsi1 index in the calculation.

Secondly, this commit add support for shard streaming/copying when using
the tsi1 index. Prior to this, a tsi1 index would not be correctly
restored when streaming shards.
2017-11-28 15:57:02 +00:00
Jason Wilder 5032a802d6
Merge pull request #9168 from influxdata/jw-delete-sort
Ensure series keys are sorted before searching
2017-11-28 08:51:38 -07:00
Jason Wilder b59858e529 Ensure series keys are sorted before searching
The Cache.ApplyEntryFn iterates keys according to the partitions
and hashed values.  This can cause the deleteKeys slice to contain
unsorted keys when deleting series.  The code uses a binary search
on this slice later on and this can fail to detect that the series
should still exists.  The series is then removed from the index
even though it has data still.

Fixes #9116
2017-11-27 17:06:03 -07:00
Jonathan A. Sternberg a73c3a1965 Fix race condition in the merge iterator close method
If the close happens when next is being called, it can result in a race
condition where the current iterator gets set to nil after the initial
check.

This also fixes the finalizer so it runs the close method in a goroutine
instead of running it by itself. This is because all finalizers run on
the same goroutine so a close that takes a long time can cause a backup
for all finalizers. This also removes the redundant call to
`runtime.SetFinalizer` from the finalizer itself because a finalizer,
when called, has already cleared itself.
2017-11-27 16:55:41 -06:00
Stuart Carnie d361d7a659 rename current key index and key index count fields for clarity 2017-11-27 13:26:59 -07:00
Stuart Carnie e1ec331048 improve startup performance
* replaces coordinating goroutines for single k-way heap merge iterator
* removes contention sending keys across buffered channels

startup time from 46s -> 28s for iterating 1MM keys across 14 shards
2017-11-27 12:44:58 -07:00
Edd Robinson 6dbb070ce9 Fix race on sfiles in Store 2017-11-27 15:41:16 +00:00
Edd Robinson e6b7140d65
Merge pull request #9143 from influxdata/er-show-tag-key-perf
SHOW TAG KEYS with high cardinality and many shards
2017-11-27 15:04:15 +00:00
Ben Johnson cc22134d8f
Merge branch 'er-tsi-index-part' of https://github.com/influxdata/influxdb into er-tsi-index-part 2017-11-27 07:52:39 -07:00
Ben Johnson 01491ca4f4
intermediate 2017-11-27 07:52:18 -07:00
Edd Robinson 4831545830 Add PR typo/doc changes 2017-11-27 14:05:30 +00:00
Stuart Carnie 7cdfd95966 initial opentrace implementation for ifql interface
NOTE: does not include a default tracer until configuration across
projects is standardized
2017-11-22 14:42:26 -07:00
Jason Wilder 279f82a72e Remove dead code 2017-11-22 11:17:34 -07:00
Jason Wilder cacb55fac4 Fix typos 2017-11-22 11:17:34 -07:00
Jason Wilder b674311830 Add magic number to fields index file 2017-11-22 11:17:34 -07:00
Jason Wilder dd1c030815 Remove limit count param on fields
It's not used anymore.
2017-11-22 11:17:34 -07:00
Jason Wilder c14b0e81b7 Save field types to speed up startup
This persists the field types in a shard to avoid having to scan
all the TSM files at startup.
2017-11-22 11:17:34 -07:00
Jason Wilder c8b24b7939 Remove MANIFEST 2017-11-22 11:17:34 -07:00
Ben Johnson fc966a1b67
Add series file backup/restore. 2017-11-22 08:55:54 -07:00
Edd Robinson 68dd5e27c8 Improve performance of TagKeys 2017-11-21 17:16:47 +00:00
Jason Wilder 50b6ace75f Fix wait reused while disabling compactions 2017-11-20 14:55:47 -07:00
Edd Robinson 5ff96d9193
Merge pull request #9127 from influxdata/er-fga
Implement FGA on SHOW COMMANDS
2017-11-20 14:51:58 +00:00
Jason Wilder 0551849298 Reduce calls to time.Now()
These were showing up in profiles during heavy write load.
2017-11-17 14:23:02 -07:00
Edd Robinson a5af19fc06 Address PR feedback 2017-11-17 12:43:48 +00:00
Edd Robinson bff69f7a82 Refactor inmem implementation 2017-11-17 11:06:43 +00:00
Edd Robinson 25f0fedd6f Fix MeasurementNamesByExpr in tsi1 2017-11-17 11:06:43 +00:00
Edd Robinson 3967e78885 Consolidate tests to tsdb package 2017-11-17 11:06:43 +00:00
Edd Robinson b3407c5d46 Correct authorisation on inmem SHOW MEASUREMENTS 2017-11-17 11:06:43 +00:00
Edd Robinson d4cecd7cc7 Add index authorisation test coverage 2017-11-17 11:06:43 +00:00
Edd Robinson 6851db3fc9 Add FGA support to SHOW MEASUREMENTS 2017-11-17 11:06:43 +00:00
Edd Robinson 5298339f21 Add test coverage for FGA on Tag Keys/Values 2017-11-17 11:06:43 +00:00
Edd Robinson aa17ef55f9 Implement FGA on SHOW SERIES 2017-11-17 11:06:43 +00:00
Edd Robinson 8acab9b5ac Fix existing bug where database was empty 2017-11-17 11:06:43 +00:00
Jason Wilder aa99a56bf1
Merge pull request #9129 from influxdata/jw-cursor-deletes
Fix KeyCursor not returning remaing blocks
2017-11-16 16:58:30 -07:00
Jason Wilder 02dbe6dbd3 Fix KeyCursor not return remaing blocks
If the first block that needs to be read was partially deleted such
that the trailing end has no values, it was possible for the query
cursor end early.

This was caused by the KeyCursor.ReadFloatBlock returning no values instead
of checking the remaing blocks.
2017-11-16 15:23:34 -07:00
Stuart Carnie 2c2244b79c remove empty file 2017-11-16 09:02:31 -08:00
Ben Johnson ede3fcf98e
intermediate 2017-11-15 16:09:25 -07:00
Jason Wilder e2cb1d0ff4
Merge pull request #9114 from influxdata/jw-force-full-plan
Add capability to force a full compaction
2017-11-15 10:45:00 -07:00
Jason Wilder ef06773d5b Fix panic: runtime error: slice bounds out of range
A panic could occur if an invalid time range was passed to
Exclude/Include, etc.
2017-11-15 08:18:53 -07:00
Jason Wilder 97e0d496a6 Add capability to force a full compaction
This adds the capability to the engine to force a full compaction
to be scheduled.  When called, it snapshots any data in the cache,
aborts running compactions and prevents level plans from returning
level plans.
2017-11-15 07:14:27 -07:00
Ben Johnson ba4c9e0317
Merge remote-tracking branch 'upstream/master' into er-tsi-index-part 2017-11-14 16:14:13 -07:00