Commit Graph

151 Commits (f077359f8c900a6787c3c2e157d0c3e73b8e3e88)

Author SHA1 Message Date
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
Jason Wilder 1641c25479 Fix panic parsing floats without decimal
Fixes #3289
2015-07-10 14:18:51 -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
Jason Wilder 6b8d3268e6 Fix code review comments 2015-07-07 11:41:12 -06:00
Jason Wilder cb75de8b7c Use UTC for test assertion data 2015-07-06 21:11:09 -06:00
Jason Wilder 351bc03655 Don't panic if NaN or -/+Inf is used as a field value
These are not supported types but previously it would cause the
point.Fields() func to panic.  This prevents it from panicing
so the values can be ignored if needed.
2015-07-06 16:14:02 -06:00
Jason Wilder 4d511571c5 Serialized unknown types as strings
When creating a point manually, the field values are interface{}
which allows unsupported types to be passed in.  Previously, the
code would panic.  It will now default to string representation of
the value if it's not a known type.
2015-07-06 16:14:02 -06:00
Jason Wilder 736f1c142e Only start flush timer if duration is set
The default of 0 causes the time timer to flush immediately.  If
only a batch size is set but not a time, the batch size setting does
not work.
2015-07-06 16:14:02 -06:00
Jason Wilder a3ab093996 Parse NaN as float
Fixes #3230
2015-07-06 16:14:01 -06:00
Philip O'Toole dd66491f65 stringSet now returns elements in sorted order 2015-07-06 12:03:58 -04:00
Philip O'Toole ca86fa2633 Allow WAL inter-flush time to be configurable 2015-07-02 10:40:26 -04:00
Philip O'Toole 39af8e49de Remove obsolete retention config from tsdb 2015-07-01 09:39:11 -04:00
Philip O'Toole 071c985b5b Remove obsolete retention auto-create from tsdb 2015-07-01 09:37:29 -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 41ae8bdae7 Handle escaped commas in measurement name
Fixes #3183
2015-06-29 15:15:50 -06: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
Jason Wilder 1a5a8d1675 Fix typos in comments 2015-06-26 14:36:19 -06:00
Jason Wilder d33b8bcd6a Return parsing error when tag name is missing
Fixes #2678
2015-06-26 13:47:09 -06:00
Jason Wilder 5081481ca8 Return error when parsing fields with no name
Fixes #3061
2015-06-26 13:39:25 -06: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
Jason Wilder 17432598b1 Prevent out of range ints and floats from being parsed sucessfully
Field values that were out of range for the type would panic the database
when being inserted because the parser would allow them as valid points.
This change prevents those invalid values from being parsed and instead
returns an error.

An alternative fix considered was to handle the error and clamp the value
to the min/max value for the type.  This would treat numeric range errors
slightly differently than other type erros which might lead to confusion.

The simplest fix with the current parser would be to just convert each field
to the type at parse time.  Unfortunately, this adds extra memory allocations
and lowers throughput significantly.  Since out of range values are less common
than in-range values, some heuristics are used to determine when the more
expensive type parsing and range checking is performed.  Essentially, we only
do the slow path when we cannot determine that the value is in an acceptable
type range.

Fixes #3127
2015-06-25 14:49:42 -06:00
Sean Beckett 01440f90e9 Merge pull request #3095 from influxdb/beckettsean-patch-3
more examples for line protocol
2015-06-23 15:20:26 -07:00
Sean Beckett c2a1511e2e Update README.md 2015-06-23 15:19:53 -07:00
Sean Beckett 92b38583f3 more examples for line protocol
showing escape characters and proper string quoting
2015-06-22 17:10:24 -07:00
Sean Beckett 1d9aa31e7b Merge pull request #3072 from influxdb/beckettsean-patch-3
typos, clarifications in line protocol doc
2015-06-22 17:00:31 -07:00
Philip O'Toole cb7baa6d9e Don't group TagSets when tag values are identical
Fixes issue #3059
2015-06-22 16:04:13 -07:00
Jason Wilder 7873ccbb20 Merge pull request #3039 from neonstalwart/line-comments
allow comments in line protocol
2015-06-22 14:09:56 -06:00
Jason Wilder cc7e59a12a Merge pull request #3088 from influxdb/jw-field-values
Fix string field value escaping
2015-06-22 13:48:47 -06:00
Jason Wilder 2854108941 Fix string field value escaping
Commas and quotes could get escaped and parsed incorrectly if they
were both present in a string value.

Fixes #3013
2015-06-22 13:17:35 -06:00
Philip O'Toole 01700f79b0 On DROP DATABASE remove from TSDB index 2015-06-22 11:44:46 -07:00
Jason Wilder cb9a40df64 Fix invalid field value format not parsed correctly
A field value of just a numeric value would be accepted by the line
protocol parser but the value would be set as the field name and
the value would be nil.  Instead, return an error because all field
values need a field name.
2015-06-22 10:35:08 -06:00
Sean Beckett 6911e752af typos, clarifications 2015-06-19 17:58:28 -07:00
Philip O'Toole 72a76e73f3 Add full example of line protocol 2015-06-19 08:14:38 -07:00
Philip O'Toole d6eeb12d67 Merge pull request #2997 from influxdb/jw-line-protocol
Add line protocol doc
2015-06-19 08:09:12 -07:00
Todd Persen b6252868cc Add support for marshaling `uint64` in client. 2015-06-18 15:33:37 -07:00
ben hockey d4a341a5ae allow comments in line protocol 2015-06-18 14:03:27 -05: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 e0bfd827dc Add line protocol doc 2015-06-15 16:47:04 -06:00
Philip O'Toole 014eee6fa1 Remove stats support
This will soon be re-implemented using the expvar package.
2015-06-15 13:33:29 -07:00
Philip O'Toole 05bd0fc53d Check database existence during normalization
Statements were only being normalized if a default database was included
in the query (usually via the query param 'db'). However if no default
database was included, and none was an explicit part of the measurement
name, no database-existence check was run. This result in a later panic
with wildcard expansion.
2015-06-15 11:51:32 -07:00
Philip O'Toole e60645e1a2 Remove unused database param
It is not used by the code -- the database on the measurement object
that determines the target database.
2015-06-15 11:09:16 -07:00
Jason Wilder 36cde5f35e Fix large integers getting converted to floats during remote writes
Fixes #2960

Integers were were written back to line protocol using strconv.FormatFloat
incorrectly.  Large integers are written in scientific notation which
causes their type to change to a float when parsed back.
2015-06-12 11:20:37 -06:00
Jason Wilder 30068561ae Fix parsing negative floats
Fixes #2919
2015-06-12 08:39:17 -06:00
Jason Wilder 861f63e33e Merge pull request #2949 from influxdb/jw-error-responses
Add measurement name to type conflict error messages
2015-06-11 19:59:55 -06:00
Philip O'Toole be5491ea77 Merge pull request #2918 from pradeepchhetri/master
Fixed some typos
2015-06-11 18:28:24 -07:00
Jason Wilder 20fe5b0218 Add measurement name to type conflict error messages
Fixes #2948
2015-06-11 16:16:07 -06:00