Commit Graph

42 Commits (4dc15a833e55dc017a3aaae1c1cfcfe2431de503)

Author SHA1 Message Date
Ben Johnson de1f9a3736 refactor tsdb tests into test package 2015-07-22 11:07:06 -06:00
Alexander Morozov 675eacbf2c Fix style issues with else
In go it's better to just continue flow without "else", if it is return in
"if" statement.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-17 11:10:23 -07:00
Jason Wilder f4f0373579 Sort points after appending if needed
Writing points that were not sorted by time could cause very high
CPU usages and increased latencies because each point inserted would
cause the in-memory cache to be resorted.  The worst case would be
writing a large batch of N points in reverse time order which would
invoke N sorts of the slice.

This patch keeps track of which slices need to be sorted and sorts
them once at the end.  In the previous example, the N sorts becomes
one.  There is still a pathalogical case that would require N/2 sorts.
For example, 10000 points split across 5000 series.  Each series has two
points that are in reverse time order.  This would incur 5000 sorts still.

Fixes #3159
2015-07-13 10:51:58 -06:00
Philip O'Toole 7a87fbc58a Flush WAL as fast as possible on start-up
This addresses complaints of long start-up times when there is lots of
data sitting in the WAL.
2015-07-08 17:14:28 -06:00
Philip O'Toole ca86fa2633 Allow WAL inter-flush time to be configurable 2015-07-02 10:40:26 -04:00
Philip O'Toole babc63d941 Use typed error for "field not found" 2015-06-30 14:17:04 -04:00
Philip O'Toole 7a284885f2 Add helper to decode specific field by name 2015-06-30 14:16:54 -04:00
Philip O'Toole fde3d1f6a2 Remove unused, unexported function 2015-06-30 13:28:56 -04:00
Jason Wilder eb71f78afb Merge pull request #3167 from influxdb/jw-2608
Fix panic when droppping measurement while writing to it concurrently
2015-06-29 14:05:42 -06:00
Jason Wilder 7232e6ea7c Fix panic when droppping measurement while writing to it concurrently
Fixes #2608
2015-06-29 14:01:07 -06:00
Joseph Crail 5fccee3d16 Fix spelling errors in comments and strings. 2015-06-28 02:54:34 -04:00
Ben Johnson b574e2f755 Add write ahead log
This commit adds a write ahead log to the shard. Entries are cached
in memory and periodically flushed back into the index. The WAL and
the cache are both partitioned into buckets so that flushing doesn't
stop the world as long.
2015-06-25 15:47:13 -06:00
Philip O'Toole 17be1e2f67 Remove measurement from shard index on a DROP
Fixes issue #2955
2015-06-16 12:14:33 -07:00
Jason Wilder 20fe5b0218 Add measurement name to type conflict error messages
Fixes #2948
2015-06-11 16:16:07 -06:00
Ben Johnson bc31783a00 Refactor backup and restore
This commit updates the snapshot code as well as the "backup" and
"restore" command to work with the new architecture.
2015-06-10 22:07:01 -06:00
Paul Dix 325ca4ab4b Merge pull request #2885 from influxdb/datatype-refactor
change influxql DataType from string to int
2015-06-10 21:06:08 -07:00
Philip O'Toole 6d26f9c8a8 Merge pull request #2856 from influxdb/rv_fixes
Series was not already dropped, return false (and other fixes)
2015-06-10 20:57:46 -07:00
Jason Wilder 0d9a2a5053 Fix wrong value used for incorrect type error message
Would result in saying that the field type was always a string which
is incorrect.  The field key is a string but the value may not be.

Fixes #2700
2015-06-10 15:57:27 -06:00
Jason Wilder 999f4a4c41 Return field type errors as client write errors
Fixes #2849
2015-06-10 14:52:26 -06:00
David Norton 29777f2a8e change influxql DataType from string to int 2015-06-10 16:02:26 -04:00
Jason Wilder bc7e1f6fd6 Fix panic when adding new fields
Fixes #2869

When adding a new field to an existing measurment, Shard.validateSeriesAndFields
would also encode the fields as a side-effect.  In the case of a new field
that needed to be created, the encoding would fail because the field type
had not been created for the measurement yet.  The fields are re-encoded
after validateSeriesAndFields returns and after the field encoding have been
setup properly so this additional encoding during
validation isn't necessary.
2015-06-10 10:30:14 -06:00
Philip O'Toole 8a5b337ae5 There is no more metastore, so correct comment 2015-06-09 14:57:19 -07:00
Paul Dix f39cddebf6 Fix locking on write path for getting measurement field encoding. 2015-06-07 11:09:47 +02:00
Ben Johnson b925e1c1af Multi-node clustering.
This commit adds the ability to cluster multiple nodes together to share
the same metadata through raft consensus.
2015-06-05 14:41:19 -06:00
Paul Dix 408bc3f81e Ensure proper locking of index structures on writes and queries. 2015-06-04 14:50:32 -04:00
Paul Dix 9c4da3002c Wire up DROP MEASUREMENT
* Add deleteMeasurement to store and shard
* Add DropMeasurement to DatabaseIndex
* Update ErrMeasurementNotFound and ErrDatabaseNotFound to not include the first line of the stack trace.
2015-06-03 11:32:50 -04:00
Paul Dix 6f76a4774b Update UnmarshalBinary comment to be correct 2015-06-03 07:36:39 -04:00
Paul Dix 2d9c63f3bd Update metadata storage in the shard to use protobuf for serialization. 2015-06-02 19:08:48 -04:00
Paul Dix 4a1ce77090 Wire up DROP SERIES.
* Pulled over updates to ast and parser from master
* Updated store and shard to be able to drop series
* Pulled updates to database.go from master into tsdb/meta.go
2015-06-02 11:20:20 -04:00
Paul Dix 15d37fd388 Make store open every shard on load. Fix shard to set measurementFields on load.
Fixes issue where queries wouldn't be able to hit anything because the index does't load until the shard is open.

Fix an issue where field codecs weren't populated in the shard when loading.
2015-05-30 11:53:53 -04:00
Cory LaNou f66afc23bb merging alpha1, fix vet errors 2015-05-29 15:28:08 -06:00
Paul Dix 072dacc1ab Update tx.go to work with tsdb 2015-05-29 14:59:57 -06:00
Jason Wilder 4e7c8bdad2 Add ParsePointsWithPrecision to handle precision write argument 2015-05-29 11:18:40 -06:00
Jason Wilder 9a9bb736f7 Add text protocol parsing and serialzation for points
This changes the implementation of point to minimize the extra
processing needed to parse and marshal point data though the system.
2015-05-29 11:18:40 -06:00
Jason Wilder 21bfb150a1 Wire up new write path
This allows the new write path to be hooked up if you start the
server with `INFLUXDB_ALPHA1=1`.  When set, writes will go though
the coordinator and be stubbed out to write to a single local data
node with one shards.  The write will be logged and written to
disk .

The env var is used so that the current write path is not completely
broken which would break many of the tests that depend on writes.

Note that queries are not currently working w/ the this change.
2015-05-26 12:07:56 -06:00
Paul Dix 6c80108f63 Change Database to DatabaseIndex, remove leftover warn statement 2015-05-24 07:39:45 -04:00
Paul Dix c3ab88a715 Make the metadata index shared across shards while keeping field types and encoding local to each shard. 2015-05-23 18:06:07 -04:00
Jason Wilder 1076153a00 Convert Point to interface
Should be possible to replace the implementation with a more
optimized version now.
2015-05-22 15:39:55 -06:00
Jason Wilder 528f47e093 Convert Point.Fields to Point.Fields() 2015-05-22 15:22:03 -06:00
Jason Wilder f8d599cda9 Convert Point.Tags to Point.Tags() 2015-05-22 15:12:34 -06:00
Jason Wilder 5dcab443dc Move data.Point to tsdb.Point 2015-05-22 15:00:51 -06:00
Paul Dix 8f937cae87 Initial implementation for writing data to a shard. 2015-05-22 16:11:18 -04:00