Commit Graph

7917 Commits (40ff4f4a86f4512e3cf05a90734b17bb9c219018)

Author SHA1 Message Date
Paul Dix 40ff4f4a86 Change default to bz1 2015-10-06 15:30:34 -07:00
Jason Wilder 41e3294d4a Fix panic: assignment to entry in nil map
Closing the store did not properly return an error for in-flight
writes because the closing channel was set to nil when closed.  A
nil channel is not selectable so writes continue on past the guard
checks and trigger panics.
2015-10-06 14:03:52 -06:00
Paul Dix be477b2aab Fix cursor bug on index 2015-10-06 12:26:45 -07:00
Paul Dix 27d0db33c1 Merge branch 'pd-storage-engine' of github.com:influxdb/influxdb into pd-storage-engine 2015-10-05 20:12:36 -04:00
Paul Dix 267f34b94e Updates based on PR feedback 2015-10-05 20:09:56 -04:00
Paul Dix 26a93ec23e Fix deletes not kept if shutdown before flush on tsm1 2015-10-05 20:09:56 -04:00
Paul Dix bb398daf75 Updates based on @otoolp's PR comments 2015-10-05 20:09:56 -04:00
Jason Wilder c6f2f9cec2 Avoid duplicating values slice when encoding 2015-10-05 20:09:56 -04:00
Jason Wilder cb28dabf62 Make DecodeBlock panic if block size is too small
Should never get a block size 9 bytes since Encode always returns the min
timestampe and a 1 byte header.  If we get this, the engine is confused.
2015-10-05 20:09:56 -04:00
Jason Wilder b0449702e5 Fix comment typos 2015-10-05 20:09:56 -04:00
Paris Holley 36898f9451 do not include empty tags in hash 2015-10-05 20:09:56 -04:00
Paul Dix d9f94bdeeb Add db crash recovery 2015-10-05 20:09:56 -04:00
Jason Wilder 1d754db00b Propogate all encoding errors to engine
Avoid panicing in lower level code and allow the engine to decide what
it should do.
2015-10-05 20:09:56 -04:00
Jason Wilder 4c54c78009 Move compression encoding constants to encoders
Will make it less error-prone to add new encodings int the future
since each encoder has it's set of constants.  There are some placeholder
contants for uncompressed encodings which are not in all encoder currently.
2015-10-05 20:09:56 -04:00
Jason Wilder b1a57e1628 Fix go vet errors 2015-10-05 20:09:56 -04:00
Jason Wilder 5d9b89d601 Disable copier test
Not implemented for tsm1 engine
2015-10-05 20:09:56 -04:00
Jason Wilder ab791ba913 Fix TestStoreOpenShardCreateDelete
Shard path can be a directory.
2015-10-05 20:09:56 -04:00
Paul Dix d47ddb5454 Cleanup after pd1 -> tsm1 name change. 2015-10-05 20:09:55 -04:00
Paul Dix 594253cbba Rename storage engine to tsm1, for Time Structured Merge Tree! 2015-10-05 20:09:55 -04:00
Paul Dix 0a11a2fdbc Add deletes to new storage engine 2015-10-05 20:09:55 -04:00
Paul Dix 4beca1a245 Implement reverse cursor direction on pd1 2015-10-05 20:09:55 -04:00
Jason Wilder dbf6228817 Fix go vet 2015-10-05 20:09:55 -04:00
Jason Wilder d9499f0598 Remove zig zag encoding from timestamp encoder
Not needed since all timestamps will be sorted in ascending order.  Negatives
are not possible.
2015-10-05 20:09:55 -04:00
Paul Dix a2b139e006 Fix compaction and multi-write bugs.
* Fix bug with locking when the interval completely covers or is totally inside another one.
* Fix bug with full compactions running when the index is actively being written to.
2015-10-05 20:09:55 -04:00
Jason Wilder 2366baaf0b Handle partial reads when loading WAL
If reading into fixed sized buffer using io.ReadFull, the func can
return io.ErrUnexpectedEOF if the read was short.  This was slipping
through the error handling causing the shard to fail to load.
2015-10-05 20:09:55 -04:00
Paul Dix 3332236527 Fix bugs with writing old data and compaction. 2015-10-05 20:09:55 -04:00
Jason Wilder 5d938d0a8b Add test with duplicate timestamps
Should not happen but makes sure that the same values are encoded
and decoded correctly.
2015-10-05 20:09:55 -04:00
Jason Wilder c47d14540d Add compressed string encoding
Uses snappy to compress multiple strings into a block
2015-10-05 20:09:55 -04:00
Paul Dix 861a15b3e6 Fix panic when data file has small index 2015-10-05 20:09:55 -04:00
Paul Dix be011b8da9 Add logging to pd1 2015-10-05 20:09:54 -04:00
Paul Dix c1213ba367 Update WAL to deduplicate values on Cursor query.
Added test and have failing section for single value encoding.
2015-10-05 20:09:54 -04:00
Jason Wilder 9f9692acdf Rename float encoding tests 2015-10-05 20:09:54 -04:00
Jason Wilder a4d92162ef Add documentation about compression 2015-10-05 20:09:54 -04:00
Jason Wilder 2da52ec4fe Fix deadlock in pd1_test.go
The defer tx.Rollback() tries to free the queryLock but the defer e.Cleanup() runs
before it and tries to take a write lock on the query lock (which blocks) and prevents
tx.Rollback() from acquring the read lock.
2015-10-05 20:09:54 -04:00
Jason Wilder 7e0df18e1a Update simple8b api usage 2015-10-05 20:09:54 -04:00
Jason Wilder cb23f5ac53 Add a compressed boolean encoding
Packs booleans into bytes using 1 bit per value.
2015-10-05 20:09:54 -04:00
Jason Wilder 1196587dc4 Keep track of the type of the block encoded
Allowes decode to decode an arbitrary block correctly.
2015-10-05 20:09:54 -04:00
Jason Wilder 731ae27123 Remove unnecessary allocations from int64 decoder
The decoder was creating a large slice and decoding all values when
instead, it could decode one packed value as needed.
2015-10-05 20:09:54 -04:00
Jason Wilder 95046c1e37 Add test assertions for time encoding type 2015-10-05 20:09:54 -04:00
Jason Wilder e42d8660d0 Fix run length encoding check
Values were run length encoded even when they should not have been
2015-10-05 20:09:54 -04:00
Jason Wilder 092689c131 Reduce memory allocations
Converting between different encoders is wasting a lot of memory allocating different
typed slices.
2015-10-05 20:09:54 -04:00
Jason Wilder ce1d45ecda Use zigzag encoding for timestamp deltas
Previously were using a frame of reference approach where we would
transform the (possibly negative) deltas into positive values from
the minimum.  That required an extra pass over the values as well
as a large slice allocation so we could encode the originals in uncompressed
form if they were too large.

This switches the encoding to use zigzag encoding for the deltas which
removes the extra slice allocation as well as the extra loops.

Improves encoding performane by ~4x.
2015-10-05 20:09:54 -04:00
Jason Wilder 4a37ba868d Add int64 compression
This is using zig zag encoding to convert int64 to uint64s and then using simple8b
to compress them, falling back to uncompressed if the value exceeds 1 << 60.  A
patched encoding scheme would likely be better in general but this provides decent
compression for integers that are not at the ends of the int64 range.
2015-10-05 20:09:53 -04:00
Jason Wilder 42e1babe7f Add time and float compression
Time compression uses an adaptive approach using delta-encoding,
frame-of-reference, run length encoding as well as compressed integer
encoding.

Float compression uses an implementation of the Gorilla paper encoding
for timestamps based on XOR deltas and leading and trailing null suppression.
2015-10-05 20:09:53 -04:00
Jason Wilder 112a03f24c Fix go vet errors 2015-10-05 20:08:58 -04:00
Jason Wilder 88248f3f81 Ensure we have files when iterating in cursor
Prevents index out of bounds panic
2015-10-05 20:08:58 -04:00
Paul Dix 12e14f105b Update stress to use second timestamps and less random floats. 2015-10-05 20:08:58 -04:00
Paul Dix db4ad33f3c Update tests to use transactions. Add test for single series 10k points. 2015-10-05 20:06:22 -04:00
Paul Dix 0b33a71bb7 Add recover to maintenance. Change snapshot writer to not use bolt on shard. 2015-10-05 20:06:22 -04:00
Paul Dix 0fd116d1f2 Ensure data files can't be deleted while query is running.
Also ensure that queries don't try to use files that have been deleted.
2015-10-05 20:06:22 -04:00