Commit Graph

57 Commits (db2bff682b0293e2592c7a32a6ba093f5350daf9)

Author SHA1 Message Date
Daniel Morsing 71a83b7f9d Remove unused buffer allocation
The buffer allocation in bz1 was unused and I'm fairly certain that it
was harmful to performance if used. For queries that run through a bz1
block, needing to hold on to a 64kb block is expensive. Better to churn
on the allocator and have the blocks be released when they are unused
than to have 64kb hanging around for each series regardless of size.

Thanks to @jwilder for brainstorming this issue with me.
2015-08-25 14:51:17 -06:00
Paul Dix a4735624f8 Merge pull request #3829 from influxdb/pd-fix-missing-data-after-flush
Fix missing data in aggregates with bz1
2015-08-25 16:27:03 -04:00
Paul Dix 8c6af91e93 Fix bug with bz1 where some data would get hidden.
Seeking to the middle of a compressed block wasn't working properly. Fixes #3781
2015-08-25 16:16:59 -04:00
Daniel Morsing 40dab87ac9 Merge pull request #3817 from influxdb/walmem
Walmem
2015-08-25 13:29:42 -06:00
Daniel Morsing 5455851ac7 move allocation outside struct + gofmt 2015-08-24 15:28:30 -06:00
Daniel Morsing 35b6c7867d reuse memory buffers for marshaling wal entries
By using preallocated buffers for marshaling WAL entries, we can
reduce the amount of memory we allocate.

On a run of `influx_stress -series 10000 -points 1000` this cuts
total allocations from 18684.15MB to 15200.73MB
2015-08-24 14:49:25 -06:00
Daniel Morsing b7bbe8b5e0 remove unused backoffcount field 2015-08-24 10:25:38 -06:00
Paul Dix 981d7175fb Improve WAL flush log output. 2015-08-23 11:28:06 -04:00
Paul Dix 15cf803b57 Ensure WAL cache gets sorted when needed.
Fixes #3792
2015-08-21 17:48:42 -04:00
Daniel Morsing 27162dd904 only convert key to string once. 2015-08-21 11:01:34 -07:00
Paul Dix 73f3dc1e14 Update store to properly manage WAL create/delete.
* Update the store to remove the WAL directories associated with a shard or database when they are deleted.
* Fix the Store so that it creates separate WAL directories for databases and retention policies.
2015-08-21 11:22:04 -04:00
Paul Dix 2882ef88dc Merge pull request #3766 from influxdb/pd-close-wal-before-bolt
Make bz1 close the WAL before closing bolt so it can flush
2015-08-20 15:25:51 -04:00
Paul Dix 51c565e461 Ensure partition only closes current segment if its there 2015-08-20 14:37:02 -04:00
Ben Johnson 9e336bacf9 fix wal close deadlock 2015-08-20 11:56:50 -06:00
Paul Dix 9567b2c8a6 Fix logic with closing partitions 2015-08-20 13:53:59 -04:00
Ben Johnson 8f12cef883 Merge pull request #3735 from benbjohnson/append-threshold
Append to small bz1 blocks
2015-08-20 11:47:34 -06:00
Paul Dix 4e7631a135 Merge pull request #3765 from influxdb/pd-fix-wal-io-reads
Fix reads of metadata file in WAL
2015-08-20 13:08:29 -04:00
Ben Johnson e57d60210a Append to small bz1 blocks
This commit changes the bz1 append to check for a small
ending block first. If the block is below the threshold
for block size then it is rewritten with the new data
points instead of having a new block written.
2015-08-20 10:52:52 -06:00
Paul Dix e817036952 Make bz1 close the WAL before closing bolt so it can flush, fix locking on write. 2015-08-20 12:51:47 -04:00
Ben Johnson 6c4297ece5 Add bz1 size benchmarks
This commit add benchmarks to show the size difference between
different block sizes.
2015-08-20 10:22:29 -06:00
Paul Dix 72da8d9741 Merge pull request #3750 from influxdb/pd-fix-wal-logging
Fix WAL logging enable.
2015-08-20 12:05:01 -04:00
Paul Dix 370f008220 Fix reads of metadata file in WAL 2015-08-20 10:52:29 -04:00
Paul Dix 1f21d50005 Fix logging in segments and style on log messages 2015-08-20 10:43:25 -04:00
Paul Dix 13d606eaf6 Fix bug querying data from WAL while compacting.
If a flush is happening and you bring up a cursor for a series, if that series didn't have any data in the cache (after the flush started) then it would return no data. What it should have done instead is return the data that is in the flush cache, which is held in separate area of memory until it is committed to the index.
2015-08-20 09:34:02 -04:00
Paul Dix 564625eef7 Fix WAL logging enable. 2015-08-19 18:45:12 -04:00
Paul Dix 4c1f7110f8 Make the WAL cursor create a copy of the cache 2015-08-19 17:25:44 -04:00
Paul Dix c31b88de60 Merge pull request #3569 from influxdb/pd-wal
Add initial WAL implementation and tests
2015-08-18 20:45:32 -04:00
Paul Dix 028d0a6d7d Fix compaction logging, make default idle flush interval 5 minutes. 2015-08-18 20:41:03 -04:00
Ben Johnson 0f2d66fb70 add WAL recovery 2015-08-18 15:08:01 -06:00
Paul Dix 9df3b7d828 Add WAL configuration options 2015-08-18 16:59:54 -04:00
Paul Dix 30bcd3e0e4 Combine all WAL partition cache maps into one 2015-08-18 10:18:06 -04:00
Paul Dix a3cdf0b97c Ensure that metadata is always loaded out of the index in sorted order 2015-08-18 08:27:09 -04:00
Paul Dix 41cf76f722 Fix vet 2015-08-18 08:15:02 -04:00
Paul Dix a509df0484 Compress metadata, add Delete to WAL.
* All metadata for each shard is now stored in a single key with compressed value
* Creation of new metadata no longer requires a syncrhnous write to Bolt. It is passed to the WAL and written to Bolt periodically outside the write path
* Added DeleteSeries to WAL and updated bz1 to remove series there when DeleteSeries or DropMeasurement are called
2015-08-18 08:10:51 -04:00
Paul Dix 3348dab4e0 Fix bug with new shards not getting series data persisted. 2015-08-16 15:45:09 -04:00
Paul Dix 9a53406e55 remove extraneous debug stuff 2015-08-16 12:46:50 -04:00
Paul Dix 6776014047 Fix bug in stress script, remove extraneous printlns 2015-08-16 12:46:50 -04:00
Paul Dix a77a91933e WIP: fix bug with how bz writes index. fix bug with wal not having index set. 2015-08-16 12:46:50 -04:00
Paul Dix b583b896ce Integrate WAL and BZ1 and make BZ1 the default engine. 2015-08-16 12:46:50 -04:00
Paul Dix 301b014f3f Make WAL flush after inactive for writes for a given interval. 2015-08-16 12:46:50 -04:00
Paul Dix d4b04510ab Make flush check configurable to avoid race in tests 2015-08-16 12:46:49 -04:00
Paul Dix 006403ce1d Add WAL back pressure when over memory threshold 2015-08-16 12:46:49 -04:00
Paul Dix 1bffb70a61 Refactoring and cleanup based on PR comments 2015-08-16 12:46:49 -04:00
Paul Dix eebdd5b7db Add initial WAL implementation and tests 2015-08-16 12:46:49 -04:00
Daniel Morsing 432fa31060 protect engine points cache from concurrent modifications.
Creating a cursor would access the engine cache concurrently with
writes, causing data races. Fix by adding a mutex around cache
accesses.
2015-08-14 14:02:03 -07:00
Ben Johnson 10c1ae782a fix duplicate points in b1/cursor
This commit fixes the b1 cursor so that reads from either the cache
or bolt buffer will check against the previously read key to ensure
that two of the same keys are not returned.

Fixes #3571.
2015-08-11 13:43:44 -06:00
Ben Johnson 25293052b6 add b1 test harness 2015-08-10 12:46:57 -06:00
Ben Johnson 394e9635cf fix bz1 quickcheck bugs
This commit fixes issues found from using a more complex `testing/quick`
implementation of the `WriteIndex()` test. The newer test inserts
multiple sets of random data that's confined to a smaller random space
so there's more chance of overlapping data.

The fixes were primarily around inserting old data or inserting the same
timestamp multiple times for a single write. The block splitting was not
working correctly before and the sorting and deduping was not handled
correctly.
2015-08-06 15:12:48 -06:00
Ben Johnson f7111e037b add bz1 testing/quick coverage 2015-08-04 18:36:14 -06:00
Ben Johnson 4077148245 refactor bz1 to integrate with WAL 2015-08-03 14:32:17 -06:00