Commit Graph

79 Commits (3db5a85139db5e632c094d3e56c0b6e67c612e47)

Author SHA1 Message Date
Jason Wilder df70a1c8ce Update tests to use Direction enum 2015-09-04 09:00:11 -06:00
Jason Wilder e767feb8d9 Fix order by desc with aggregate function not return any values 2015-09-03 22:31:58 -06:00
Jason Wilder 7fa3d445f7 Support reverse iteration for b1 engine 2015-09-03 22:31:58 -06:00
Jason Wilder 2725757dba Simplify WAL cursor seek movement logic 2015-09-03 22:31:58 -06:00
Jason Wilder 5a6b0afc4b Replace cursor direction with a type 2015-09-03 22:31:48 -06:00
Jason Wilder 7c67e60c4f Add bz1 reverse cursor test 2015-09-03 22:28:36 -06:00
Jason Wilder 5e481181bc Add WAL reverse cursor test 2015-09-03 22:28:36 -06:00
Jason Wilder 266bdc1c2b Support sort by time DESC in wal and bz1 engines 2015-09-03 22:28:36 -06:00
Cory LaNou 6592dcc699 EnableLogging -> LoggingEnabled 2015-09-03 16:56:07 -05:00
Ben Johnson deff06f850 add copier service
This commit adds the copier service which allows one server to
copy shards from another server. This will be used for moving
shards in the cluster.
2015-09-03 13:07:35 -06:00
Ben Johnson b63ebb72a5 limit bz1 quickcheck tests to 10 iterations on CI
This commit checks the `CI` environment variable in the bz1
test suite and limits the quickcheck runs if the value is `true`.
2015-09-02 11:27:11 -06:00
Ben Johnson d52fe89035 add WAL lock to prevent timing lock contention
This commit adds a lock to the WAL log to prevent timing how long
it takes to obtain the Bolt write lock.
2015-09-01 11:08:39 -06:00
Paul Dix 040fa060df Add more detailed logging for compactions 2015-09-01 09:52:20 -04:00
Jason Wilder af2531b373 Use read lock to check current memory size of partition
A write lock was being taken to read the memory size to determine if writes
should be paused.  What happens is that writers get blocked indefintely when
trying to acquire a write lock which makes writes pause (or stop) for long periods
of time.
2015-08-28 15:11:30 -06:00
Jason Wilder 6ba17eca36 Reduce lock contention on Log.WritePoints
The log was deferring the release of the read lock on the WAL.  This had
the affect that a read-lock was held until after the partition finished writing
(which maintains it's own locks).  The read lock is only needed around the call
to pointsToPartions so it can get a consistent copy of the points to write.  After
that calls returns, a lock is not needed so free it immediatedly.
2015-08-28 15:11:30 -06:00
Jason Wilder f5f8f04116 Fix panic in addToCache
addToCache is called in a goroutine and can panic if the server is closed while opening.  If
part of the open func errors, it returns an error and immediately calls close.  close sets
p.cache to nil which causes the goroutine trying to initialized the cache to panic as well.  The
goroutine should run under a write lock to avoid this race/panic.
2015-08-28 13:01:17 -06:00
Jason Wilder eb4a8d4f4a Fix panic when logging error in WAL
If LoadMetadataIndex() tries to log an error, it causes a panic because the
logger is not set until Open() is called, which is after LoadMetaDataIndex() returns.
Instead, just set the logger up when the WAL is created.
2015-08-28 12:59:38 -06:00
Ben Johnson 3ce001929c Use 4KB default block size for bz1
This commit changes the default block size from 64KB to 4KB for
bz1. This was lowered because small blocks were being uncompressed,
merged, recompressed, and inserted for a large portion of updates.
This became slower and slower over time until it reached the 64KB
threshold. We moved to the 4KB threshold in order to lower the
impact of this recompression.
2015-08-26 11:05:01 -06:00
dgnorton 2cf6233cbc Merge pull request #3808 from influxdb/dmq-show-measurements2
convert SHOW MEASUREMENTS to a distributed query
2015-08-26 11:43:38 -04:00
Paul Dix d903cc351e Merge pull request #3845 from influxdb/pd-fix-wal-meta-panic
Fix metafile so it doesn't get trampled by other goroutines.
2015-08-25 18:35:03 -04:00
Paul Dix 0d744dafed Fix metafile so it doesn't get trampled by other goroutines.
Fixes #3832 and fixes #3833
2015-08-25 18:23:24 -04:00
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
David Norton 6f0ba18904 fix TestDropMeasurementStatement 2015-08-25 10:01:38 -04: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