Commit Graph

9067 Commits (13e32f68802890e10daab8d3591c124ac1ff80d8)

Author SHA1 Message Date
Fazal Majid 0f889a77d1 fix tsm1 for Solaris #4787, passes unit tests now 2015-12-07 17:14:26 -08:00
liang@qiniu.com c13f8e9128 Fix wrong results of distributed aggregative query 2015-12-08 07:08:46 +08:00
Jason Wilder 4f30d396ae Merge pull request #5026 from influxdb/jw-mintime
Optimize TSM queries with time filter
2015-12-07 15:49:58 -07:00
Philip O'Toole 940b4e2a0c Merge pull request #5023 from influxdb/agg_math_nit
Test and variable rename for aggregate math
2015-12-07 14:43:44 -08:00
Jason Wilder a2583d2be1 Reduce lock contention when planning TSM queries 2015-12-07 15:42:36 -07:00
Jason Wilder 948973292b Update influx_inspect to handle min time removed from blocks 2015-12-07 15:42:36 -07:00
Jason Wilder 4da20c49e9 Optimize TSM file scanning for time queries
Move the index locations planning to be lazily created after the first
seek when we know what time and direction we're searching for.  This
allows files and blocks to be skip before having to scan the files index.

This improves queries times with time filters wherne there are many TSM
files on disk.
2015-12-07 15:42:36 -07:00
Philip O'Toole 99fa678932 Test and variable rename for aggregate math
Fixes nits from https://github.com/influxdb/influxdb/pull/5013.
2015-12-07 14:18:49 -08:00
Philip O'Toole 5d5afcbe50 Merge pull request #5013 from mengjinglei/fix-math-panic
fix aggregate math query
2015-12-07 14:07:48 -08:00
Nathaniel Cook ae4140d384 Merge pull request #5000 from influxdb/nc-issue#4849
Update Derivative for PositionPoint objects
2015-12-07 13:59:15 -07:00
Paul Dix 93d6afec97 Merge pull request #5019 from influxdb/jw-mintime
Remove min time from TSM blocks
2015-12-07 15:00:12 -05:00
Paul Dix 19f2a75229 Merge pull request #5011 from influxdb/pd-compaction-settings
Update TSM, remove old version, add config
2015-12-07 15:00:00 -05:00
Nathaniel Cook 7ffbbc1072 make fill previous for count() queries work 2015-12-07 12:51:40 -07:00
Nathaniel Cook 06bc25d64b add integration tests for derivative calls and all other valid functions, convert PositionPoint to float64 2015-12-07 12:51:39 -07:00
Paul Dix 8096c6b845 Update TSM, address PR #5011 comments
* Moved TSM file extension to a constant
* Fixed typos
* Changed group.size() back to being a uint64 since it can have multiple files up to 4GB each.
2015-12-07 14:47:17 -05:00
Paul Dix 820b0d31d6 Update TSM to delete from the WAL/cache
* Update cache loader to delete entries from cache
* Add cache.Delete()
* Update delete to look at keys in the Cache in addition to the FileStore
* Update cache compaction to never happen if the cache is empty
2015-12-07 14:35:48 -05:00
Jason Wilder cf341eaa6a Remove MinTime from blocks
MinTime is not in the index for each block so storing it in the block
header is redundant.  The encodings also store it in their header so
we are actually storing it 3 times.

Removing this is an incompatible change with the current tsm1 file format.
2015-12-07 11:26:58 -07:00
Adarsha 5482c6de03 Avoid closing the handle in mmap
Added mmap implementation for Windows. It uses MapViewOfFile similar to Bolt's implementation. MapViewOfFile  returns a pointer and not a byte array. Bolt changed their data structure to support it. 

Instead of changing the implementation of tsm data structure, I used a trick shown in https://groups.google.com/forum/#!topic/golang-nuts/g0nLwQI9www to use SliceHeader to convert the pointer into a slice.

Bolt's implementation also closes the file handle in mmap itself. It was resulting in a timeout, so implemented https://github.com/edsrzf/mmap-go/blob/master/mmap_windows.go logic to keep file handle open until munmap
2015-12-07 23:30:19 +05:30
Paul Dix 440a8a8a1f Change all TSM file sizes to uint32 2015-12-07 10:12:24 -05:00
Paul Dix 937233d988 Update TSM compaction planning logic
* Update Plan to do a full compaction if cold for writes
* Remove MaxFileSize as a config variable from Compactor. Should be a set constant
* Update Plan to keep track of if the last check was fully compacted so we can skip future planning calls
* Update compact min file count to 3 so that compactions run more frequently
2015-12-07 08:26:30 -05:00
mengjinglei 5111676646 fix aggregate math query 2015-12-07 16:55:20 +08:00
Paul Dix 1bee7d1512 Update TSM, remove old version, add config
* remove rolloverTSMFileSize constant that is no longer used
* remove the maxGenerationFileCount since it is no longer a limitation that's necessary with the new compaction scheme. We no longer read WAL segments as part of the compaction so memory is only used as we read in each individual key
* remove minFileCount and switch to a user configurable variable
* remove the mutex from WALSegmentWriter. There's never more than one open in the WAL at one time and it's not exported through any function so the lock on the WAL should be used. This simplified keeping track of the last write time and removed a bunch of unnecessary locks.
* update WALSegmentWriter.Write to take the compressed bytes so that encoding and compression can occur before the call to write (while we don't hold the WAL lock)
* remove a bunch of unnecessary locking in WAL.writeToLog
* Add check for TSM file magic number and vesion
* Remove old tsm, log, and unused cursor code
* Remove references to tsm1dev everywhere except in the inspector
* Clean up config options for compaction and snapshotting
* Remove old TSM configuration options
* Update the config.sample.toml with TSM options
* Update WAL compact to force if it has been cold for writes for a configurable period of time (1h by default)
2015-12-06 18:50:39 -05:00
Paul Dix bcc1ad0d3f Merge pull request #5006 from influxdb/wal_corruption_2
Handle tsm2 WAL corruption
2015-12-06 13:42:19 -05:00
Philip O'Toole 2a70ba73c1 Merge pull request #5010 from influxdb/fix_cdw
Fix string version of CREATE DATABASE ... WITH
2015-12-06 09:43:47 -08:00
Philip O'Toole e9088b2cf8 Bring test timeout back to 5 minutes
Testing has improved a lot over the past few months, so if an individual test doesn't complete in 5 minutes, something is wrong.
2015-12-06 09:38:06 -08:00
Philip O'Toole 317e6dde8c Fix string version of CREATE DATABASE ... WITH
Whitespace needed around keywords.
2015-12-06 09:35:31 -08:00
Philip O'Toole 6e88547a5e Support shutting down engine goroutines
This was causing races in the code, when the cache was being reloaded,
because back-to-back open-and-closing of the engine during testing left
goroutines running. With this change the engine is completely shutdown
when Close() is called on it.
2015-12-06 09:16:38 -08:00
Philip O'Toole 0d0b919144 Integrate CacheLoader with tsm2 engine 2015-12-05 22:13:57 -08:00
Philip O'Toole fe7b3ad134 Add CacheLoader
The CacheLoader loads a given cache from a slice of segment files.
2015-12-05 22:13:57 -08:00
Philip O'Toole 4b5fb8db72 WALSegmentReader counts bytes read without error 2015-12-05 22:13:57 -08:00
Philip O'Toole c67831bc79 Remove double-checking of error when reading WAL 2015-12-05 22:13:57 -08:00
Paul Dix 40e606cb14 Merge pull request #5003 from influxdb/jw-compaction
Update compaction planning
2015-12-05 16:49:54 -05:00
Philip O'Toole eaa9c4867f Correct version and build instructions
[ci skip]
2015-12-05 12:47:50 -08:00
Jason Wilder 33a33e6a23 Fix 32bit int overflow of constant value 2015-12-05 13:09:18 -07:00
Jason Wilder 41b24995a7 Compcation fixes 2015-12-05 12:19:28 -07:00
Philip O'Toole 5a6d07e434 Merge pull request #4998 from influxdb/tsm2_circle
Switch Circle testing of tsm1 to tsm2
2015-12-05 08:43:03 -08:00
Philip O'Toole 4a5f8c88d1 Switch Circle testing of tsm1 to tsm2 2015-12-05 08:30:15 -08:00
Philip O'Toole 7296de1fac Merge pull request #4999 from influxdb/cache_sort
Always copy the Cache values for query and merge with snapshot
2015-12-05 08:15:13 -08:00
Philip O'Toole 1b12ff9c1c Only take write-lock for Values when necessary 2015-12-05 08:06:01 -08:00
Jason Wilder 6592615958 Updated compaction strategy
This changes compacting files to merge sequences of files in lower generations
up to later generations
2015-12-04 23:30:39 -07:00
Philip O'Toole 789ab10658 Merge hot cache values with snapshots
This change starts by building the sequence of entries, which also
allows the required size of destination buffer to be calculated. Then
the buffer is allocated up-front in 1 call.

Each snapshot and hot value-set is appended to the buffer. If ordering
is violated at anytime, set the 'needSort' flag. Sorting, if necessary,
is performed just before returning the data.
2015-12-04 20:58:02 -08:00
Philip O'Toole 859877fd09 Move all sort logic to entry type 2015-12-04 20:21:16 -08:00
Philip O'Toole 6e91679fab Always copy the Cache values for query 2015-12-04 15:37:45 -08:00
Paul Dix 9637446ba9 Merge pull request #4990 from influxdb/pd-loadmetadata-wal
Update TSM engine, WAL and encoding
2015-12-04 18:21:47 -05:00
Michael Desa 14b5ed3001 Merge pull request #4961 from influxdb/md-stress-cluster
Add cluster support to stress test
2015-12-04 15:20:31 -08:00
Nathaniel Cook bb111574ce Merge pull request #4996 from influxdb/nc-issue#4404
Stub out DELETE in parser to return better error
2015-12-04 15:01:16 -07:00
Nathaniel Cook 3227951069 Stub out DELETE in parser to return better error 2015-12-04 14:47:44 -07:00
Paul Dix 33506e4d3e Update TSM cache and engine LoadMetadataIndex 2015-12-04 16:40:01 -05:00
Paul Dix b0f3dcc8cc Update TSM metadata loading and write snapshot
* Update WriteSnapshot to always call synchronously
* Update LoadMetadataIndex to load WAL metadata from the cache
2015-12-04 16:03:17 -05:00
Jason Wilder 357b88c439 Increment sequence of max generation when compaction files 2015-12-04 13:46:28 -07:00