Commit Graph

1706 Commits (f42c1e28baf627f50a98df061b4b025f243cc44a)

Author SHA1 Message Date
Jonathan A. Sternberg bb8c4efa95 Do not automatically reset the shard duration when using ALTER RETENTION POLICY 2016-09-28 12:26:03 -05:00
Jonathan A. Sternberg 3afdf3cd94 Merge tag 'v1.0.1' 2016-09-27 17:53:33 -05:00
Jonathan A. Sternberg 6660bf5cba Removing bad changelog entries added in 39ade11 2016-09-27 15:18:57 -05:00
Jason Wilder 8b354f7295 Update 1.0.1 changelog 2016-09-26 09:15:33 -06:00
Cory LaNou 4f952ad483 export wal files when exporting shard data 2016-09-23 15:09:17 -05:00
Joe LeGasse 2cbd411a9a client: updated README for UDP point splitting 2016-09-23 15:13:40 -04:00
Jonathan A. Sternberg dbc4a9150f Prevent manual use of system queries
Manual use of system queries could result in a user using the query
incorrect. Rather than check to make sure the query was used correctly,
we're just going to prevent users from using those sources so they can't
use them incorrectly.
2016-09-23 10:00:18 -05:00
Jason Wilder 39ade11944 Unload index before closing shard
When deleting a shard, the shard is locked and then removed from the
index.  Removal from the index can be slow if there are a lot of
series.  During this time, the shard is still expected to exist by
the meta store and tsdb store so stats collections, queries and writes
could all be run on this shard while it's locked.  This can cause everything
to lock up until the unindexing completes and the shard can be unlocked.

Fixes #7226
2016-09-22 11:16:45 -06:00
Jason Wilder d06b28992d Unload index before closing shard
When deleting a shard, the shard is locked and then removed from the
index.  Removal from the index can be slow if there are a lot of
series.  During this time, the shard is still expected to exist by
the meta store and tsdb store so stats collections, queries and writes
could all be run on this shard while it's locked.  This can cause everything
to lock up until the unindexing completes and the shard can be unlocked.

Fixes #7226
2016-09-16 12:01:50 -06:00
Jonathan A. Sternberg edd32908fe More man pages for the other tools we package
Updating the package to compress the man pages fully and removes the
filename and timestamp from being stored in the man page. Lintian
complains that the packages aren't compressed using the best compression
method.

https://lintian.debian.org/tags/manpage-not-compressed.html
2016-09-15 08:35:05 -05:00
Cory LaNou 71f0c7e1e9 return appropriate error if overflowing duration when parsing 2016-09-14 09:27:38 -05:00
Todd Persen b8192d079e Regenerate static assets and update CHANGELOG for PR #7286. 2016-09-13 23:38:36 -07:00
Jonathan A. Sternberg 0b94f5dc1a Skip past points at the same time in derivative call within a merged series
The derivative() call would panic if it received two points at the same
time because it tried to divide by zero. The derivative call now skips
past these points. To avoid skipping past these points, use `GROUP BY *`
so that each series is kept separated into their own series.

The difference() call has also been modified to skip past these points.
Even though difference doesn't divide by the time, difference is
supposed to perform the same as derivative, but without dividing by the
time.
2016-09-13 16:57:36 -05:00
Jonathan A. Sternberg dbb8c5570c Duplicate parsing bug in ALTER RETENTION POLICY
Return an error when we encounter the same option twice in ALTER
RETENTION POLICY and remove the `maxNumOptions` number from the parsing
loop. The `maxNumOptions` number would need to be modified if another
option was added to the parsing loop and it didn't correctly prevent
duplicate options from being reported as an error anyway.
2016-09-13 15:56:13 -05:00
Jonathan A. Sternberg 954445efd2 Read an invalid JSON response as an error in the influx client 2016-09-13 15:39:26 -05:00
Jonathan A. Sternberg aae88fc3c3 Support ON and use default database for SHOW commands
Normalize all of the SHOW commands so they allow both using ON to
specify the database and using the default database. Some commands would
require one and some would require the other and it was confusing when
using the query language.

Affected commands:

* SHOW RETENTION POLICIES
* SHOW MEASUREMENTS
* SHOW SERIES
* SHOW TAG KEYS
* SHOW TAG VALUES
* SHOW FIELD KEYS
2016-09-13 15:36:59 -05:00
Jonathan A. Sternberg 35b7460ad3 Use consistent column output from the CLI for column formatted responses
There were three different outputs that could be output with columns
that were rather strange depending on if there was a name and if there
were tags with the response.

Normalized output now has the dashes always under the column names and
no dashes anywhere else for consistency.
2016-09-13 14:20:49 -05:00
Jonathan A. Sternberg 8b07e9dd55 Merge pull request #7257 from influxdata/js-7013-dollar-sign-accepted-as-whitespace
Fix the dollar sign so it properly handles reserved keywords
2016-09-13 14:14:04 -05:00
Edd Robinson 2a99ef751d Emit fieldsCreated stat in shard measurement 2016-09-13 16:41:11 +01:00
sdtsui 6471986eb1 Lint influx_tsm; Relates to #4098
- Single commit, PR follows conventions laid out by @Gouthamve in #5822
* main.go: struct field CpuFile should be CPUFile
* influx_inspect: loop equivalent to `for key := range...`
* adds comments to exported fields and consts
* fixes typo in `CHANGELOG.md`: text for #4702 now matches number
2016-09-12 18:35:14 -07:00
Jonathan A. Sternberg ab4bca8495 Report cmdline and memstats in /debug/vars
When we refactored expvar, the cmdline and memstats sections were not
readded to the output. This adds it back if they can be found inside of
`expvar`.

It also stops trying to sort the output of the statistics so they get
returned faster. JSON doesn't need them to be sorted and it causes
enough latency problems that sorting them hurts performance.
2016-09-09 14:32:43 -05:00
Jonathan A. Sternberg 4326da0820 Implement time math for lazy time literals
When attempting to reduce the WHERE clause, the time literals had not
been converted from string literals yet. This adds the functionality to
have it handle the same time math when the time literal is still a
string literal.
2016-09-09 13:34:56 -05:00
Andy Feller 28f702667e Fixing typo within example configuration file 2016-09-09 09:57:13 -05:00
Jason Wilder 95682faec2 Merge branch '1.0' into jw-merge-10 2016-09-08 09:00:51 -06:00
Paul Dix c02611f68b Update CHANGELOG for 1.0 release! 2016-09-08 10:36:27 -04:00
Jason Wilder df61117848 Update 1.0.0 release date 2016-09-07 11:54:20 -06:00
Jason Wilder 1a35c0a3fc Fix neverending full compactions
The full compaction planner could return a plan that only included
one generation.  If this happened, a full compaction would run on that
generation producing just one generation again.  The planner would then
repeat the plan.

This could happen if there were two generations that were both over
the max TSM file size and the second one happened to be in level 3 or
lower.

When this situation occurs, one cpu is pegged running a full compaction
continuously and the disks become very busy basically rewriting the
same files over and over again.  This can eventually cause disk and CPU
saturation if it occurs with more than one shard.

Fixes #7074
2016-09-03 17:35:14 -06:00
Jonathan A. Sternberg 04c59b8941 Fix the dollar sign so it properly handles reserved keywords
The dollar sign would sometimes be accepted as whitespace if it was
immediately followed by a reserved keyword or an invalid character. It
now reads these properly as a bound parameter rather than ignoring the
dollar sign.
2016-09-02 15:32:46 -05:00
Jonathan A. Sternberg dc2527ce86 Merge branch '1.0' 2016-08-31 14:45:57 -05:00
Jonathan A. Sternberg 964341eb20 Optimize queries that compare a tag value to an empty string
The behavior for querying tag values with an empty string was originally
fixed in #6283, but it also added a performance problem when the
cardinality of the tag was high. Since a call to `Union()` or `Reject()`
would happen for every series key and it would be called N times for N
cardinality, the comparisons against a blank string were unnecessarily
slow with large memory allocations.

This optimizes these queries so it doesn't use those methods anymore.
Those methods are still useful and used when combining AND and OR
clauses, but they aren't useful when finding the series ids for a single
clause. These methods were unnecessary anyway because the series ids for
the tags were unique anyway and didn't have to be merged as a set.
2016-08-31 14:03:23 -05:00
Jonathan A. Sternberg 23f2d50ecb Use defaults from `meta` package for `CREATE DATABASE`
Instead of having the parser set the defaults, the command will set the
defaults so that the constants for that are actually used. This way we
can also identify which things the user provided and which ones we are
filling with default values.

This allows the meta client to be able to make smarter decisions when
determining if the user requested a conflict or if the requested
capabilities match with what is currently available. If you just say
`CREATE DATABASE WITH NAME myrp`, the user doesn't really care what the
duration of the retention policy is and just wants to use the default.
Now, we can use that information to determine if an existing retention
policy would conflict with what the user requested rather than returning
an error if a default value ever gets changed since the meta client
command can communicate intent more easily.
2016-08-30 13:23:49 -05:00
Jonathan A. Sternberg 0d63889847 Allow blank lines in the line protocol input 2016-08-30 09:25:55 -05:00
Jason Wilder 2d16f8b8d1 Fixup changelog 2016-08-29 15:16:45 -06:00
Jason Wilder 3d411371f2 Merge pull request #7233 from influxdata/jw-stats2
Write path stats
2016-08-29 10:15:23 -06:00
Jason Wilder fa8f982686 Update changelog 2016-08-29 09:46:11 -06:00
Jason Wilder b31bf798f1 Fix runtime: goroutine stack exceeds 1000000000-byte limit
Fixes #7225
2016-08-29 09:26:48 -06:00
Jonathan A. Sternberg b8a70105aa Fix alter retention policy when all options are used
We added `SHARD DURATION` as an extra option, but forgot to increase the
maximum number of allowable options from 3 to 4. So if 4 options were
used, the last one was ignored. This was commonly `DEFAULT`, but it
could have been any of the options.
2016-08-26 11:25:18 -05:00
Jonathan A. Sternberg 8b234546a8 Merge pull request #7204 from influxdata/1.0
Merge 1.0 branch to master
2016-08-25 15:20:30 -05:00
Jonathan A. Sternberg 10029caf2f Support negative timestamps in the query engine
Negative timestamps are now supported. We also now refuse two
nanoseconds that are at the edge of the minimum time window. One of the
nanoseconds we do not accept is because we need MinInt64 to be used for
some internal comparisons in the TSM engine and it was causing an
underflow when we subtracted one from the minimum time. The second is so
we can have one minimum time that signifies the default minimum that
nobody can write to (so we can implicitly rewrite the timestamp on
aggregate queries) but still use the explicit timestamp if it is given
to us by the user. We aren't able to tell the difference between if the
user provided it or if it was implicit without those values being
different.

If the default minimum time is used with an aggregate query, we rewrite
the time to be the epoch for backwards compatibility since we believe
that's more important than supporting that extra nanosecond.
2016-08-25 12:52:41 -05:00
Jonathan A. Sternberg 5130cd703b Update changelog 2016-08-24 13:00:58 -05:00
Ben Johnson cc628a1097
Fix mmap dereferencing
Adds a missing dereference call to `Close()` as well as fixes
a tag copy issue.
2016-08-24 10:48:07 -06:00
Edd Robinson a2fcafd5c0 Merge pull request #7187 from influxdata/er-stat-fix
Fix base64 encoding issue in stats
2016-08-23 16:57:41 +01:00
Yaser Alraddadi 0402b3ae22 Update issue link to "Remove IF EXISTS/IF NOT ..." 2016-08-23 15:37:01 +03:00
Jason Wilder a2470c9f94 Update changelog 2016-08-22 14:38:27 -06:00
Edd Robinson 90ff713f21 Fix base64 encoding issue in stats
Fixes #7177.
2016-08-22 15:21:31 +01:00
Jonathan A. Sternberg a0004b6857 Merge pull request #7153 from influxdata/js-7152-delete-series-causes-incorrect-measurement-statistic
Decrement number of measurements only once when deleting the last series from a measurement
2016-08-15 14:21:35 -05:00
Jonathan A. Sternberg 6b5b24a3e3 Decrement number of measurements only once when deleting the last series from a measurement 2016-08-15 13:57:08 -05:00
Edd Robinson cebeda817c Update jwt-go to v3 2016-08-12 17:35:57 +01:00
Jonathan A. Sternberg 87f7c66b8a Merge pull request #7119 from influxdata/js-create-database-use-defaults
Use defaults from `meta` package for `CREATE DATABASE`
2016-08-11 10:34:22 -05:00
Jonathan A. Sternberg 0efed4f6cf Update changelog 2016-08-10 15:36:15 -05:00
Jonathan A. Sternberg a4e49963f5 Implement text/csv content encoding for the response writer
CSV doesn't offer a way to separate different sheets from each other and
it doesn't really have a standard format. We separate sheets with a
newline so they can be imported into something like Excel or LibreOffice
more easily.

The number of columns for each sheet is inferred from the first returned
row in each statement since they should all be the same.
2016-08-10 15:15:33 -05:00
Jonathan A. Sternberg ab049d7f0a Support mixed duration units
It is now possible to use a mixed duration unit like `1h30m`. The
duration units can be in whatever order as long as they are connected to
each other.

There is a change to the scanner. A token such as `10x` will be scanned
as a duration literal, but will then fail to parse as an invalid
duration. This should not be a breaking change as there is no situation
where `10m10` was a valid order of tokens for the parser.

Fixes #3634.
2016-08-10 13:34:19 -05:00
kun 6945655be2 add support for unix socket binding service 2016-08-11 02:20:54 +08:00
Jonathan A. Sternberg 3959656968 Add additional statistics to query executor
The query executor would only store the number of active queries and the
query duration so it was impossible to determine how many queries were
actually executed during that timeframe because quick queries would be
gone before the call to gather statistics was made.

This adds two new statistics so track when queries start and when
queries finish and doesn't decrement the counter so the number of
executed queries can be obtained using `derivative()` and
`difference()`.
2016-08-10 11:35:06 -05:00
Jonathan A. Sternberg 9621bee195 Drop time when used as a tag or field key
The "time" field and tags are unqueryable so we prevent those from being
written so we don't have unreadable data.
2016-08-10 10:02:01 -05:00
Jonathan A. Sternberg 530b00bd76 Use defaults from `meta` package for `CREATE DATABASE`
Instead of having the parser set the defaults, the command will set the
defaults so that the constants for that are actually used. This way we
can also identify which things the user provided and which ones we are
filling with default values.

This allows the meta client to be able to make smarter decisions when
determining if the user requested a conflict or if the requested
capabilities match with what is currently available. If you just say
`CREATE DATABASE WITH NAME myrp`, the user doesn't really care what the
duration of the retention policy is and just wants to use the default.
Now, we can use that information to determine if an existing retention
policy would conflict with what the user requested rather than returning
an error if a default value ever gets changed since the meta client
command can communicate intent more easily.
2016-08-09 12:00:06 -05:00
Ben Johnson 55b3e63ced
concurrent series limit
This commit fixes the `MaxSelectSeriesN` limit which was broken by
the implementation of lazy iterators. The setting previously limited
the total number of series but the new implementation limits the
concurrent number of series being processed.
2016-08-09 08:58:01 -06:00
Mark Rushakoff 7787703ca8 Ensure gzip writer closed in influx_inspect export
Previously, the gzip writer may have had unflushed data when the
underlying writer was closed, and the output stream would have been
truncated early.
2016-08-08 08:52:22 -07:00
David Norton 064db3c5b3 Merge pull request #7095 from influxdata/dgn-cardinality-limits
feat #6679: add series limit config setting
2016-08-05 16:34:25 -04:00
David Norton 43809b0799 update CHANGELOG.md 2016-08-05 15:54:34 -04:00
Jonathan A. Sternberg 4cdfc3280d Move the CQ interval by the group by offset
This will make the period selected by the CQ system work correctly for a
query with an offset.
2016-08-05 14:39:52 -05:00
Jonathan A. Sternberg 0879d43b74 Do not run continuous queries that have no time span 2016-08-05 14:39:52 -05:00
Ben Johnson 6c7d56d4bc
limit shard concurrency
This commit limits queries to only process one shard at a time.
However, within a shard, multiple series can still be processed in
parallel. Shard iterators are lazily instantiated during query
execution to limit the amount of memory a given query uses.
2016-08-05 09:45:57 -06:00
Jonathan A. Sternberg ccd1bd91f4 Copy tags in influx_stress to avoid a concurrent write panic on a map
Removing lock from the same object as that object never does anything
except for having attributes read.
2016-08-01 13:18:21 -05:00
Jonathan A. Sternberg 2c739c0532 Fix parseFill to check for fill ident before attempting to parse an expression
The previous parseFill would try to parse an expression and only unscan
one token when it failed. This caused it to not put back the correct
number of tokens with some expression.

Now it has been modified to check for the fill ident ahead of time and
then use ParseExpr() to parse the call. If the expression fails to parse
into a call, it will send an error instead of trying to continue with an
invalid parser state.

Fixes #6543.
2016-08-01 11:38:44 -05:00
David Norton 0c4559722c feat #6679: add series limit config setting 2016-08-01 08:28:46 -04:00
Cory LaNou 1117526873 remove IF EXISTS/IF NOT EXISTS from influxql language 2016-07-29 12:58:05 -05:00
Jason Wilder c1840be88d Update changelog 2016-07-28 20:25:37 -06:00
Jason Wilder d432aaa84d Fix panic with parsing empty key
Fixes #6990
2016-07-28 18:38:17 -06:00
Jonathan A. Sternberg 23ef9484a4 Support wildcards in aggregate functions 2016-07-28 17:56:32 -05:00
Edd Robinson 9a2efafa13 Ensure CQ id names can't clash 2016-07-28 16:26:05 +01:00
Cameron Sparr d688676266 Update UDP buffer setting doc to 25MB 2016-07-28 12:02:56 +01:00
David Norton e3328117a9 fix #7081: hardcode auto gen RP name 2016-07-27 16:49:46 -04:00
David Norton b1079c9080 revert previous DefaultRetentionPolicyName change 2016-07-27 11:38:42 -04:00
David Norton 8fbfdc5616 fix #7068: use DefaultRetentionPolicyName from cfg
Use DefaultRetentionPolicyName from the config instead of passing
through meta data.
2016-07-26 18:53:55 -04:00
Jason Wilder cab84ae279 Prevent concurrent compactions from stepping on each other
Normally, compactions do not conflict on the files they are compacting.
If the full cold threshold is set very low, it can cause conflicts where
two compactions compact the same files.  The full compaction was the
only place this could happen as it's planning is greedy.

To make this safer for concurrent execution, the compaction tracks which
files are current being compacted and prevents any new compactions from
starting if the file set overlaps.

Fixes #6595
2016-07-26 12:58:25 -06:00
Cory LaNou 71085e9a39 update changelog 2016-07-22 14:33:20 -05:00
Jonathan A. Sternberg e50850da5b Update pull request template to reference man pages and update changelog 2016-07-22 10:34:40 -05:00
Cory LaNou 968d322d6d finish tsm file exporter 2016-07-21 17:20:51 -05:00
Jason Wilder 822f409b31 Allow queries to complete before closing TSM files
If a query was running against a file being compacted, we close the file
and the query would end wherever it had read up to.  This could result
in queries that randomly lost data, but running them again showed the
full results.

We now use a reference counting approach and move the in-use files out
of the way in the filestore and allow the queries to complete against
the old tsm files.  The new files are installed and new queries will
use them.

Fixes #5501
2016-07-21 12:13:04 -06:00
Jonathan A. Sternberg 4bdf57534b Log the CQ execution time when continuous query logging is enabled 2016-07-21 12:16:53 -05:00
Cory LaNou fd86670518 remove limiter from walkShards 2016-07-21 11:23:31 -05:00
Edd Robinson ff9d38540f Update release notes and sample config 2016-07-21 11:50:21 +01:00
Edd Robinson f37e726869 Add trace logging statements to tsdb 2016-07-21 11:14:29 +01:00
Jason Wilder c31f0c25b4 Fix duplicate series getting created
There was a race where the same series would get added to the in-memory
index for a measurement more than once.  This would result in the same
series being returned more than once during queries causing duplicate
results.  The issue was that we check for the series under the read
lock, but did not check again under the write lock where there was
a small window where the series could be added by another goroutine.

We now check for the series under the write lock.

Fixes #6946
2016-07-18 16:46:36 -06:00
Jason Wilder 5686e9e36a Update changelog 2016-07-14 17:31:34 -06:00
Jason Wilder 3c67d12d42 Update changelog 2016-07-14 11:51:41 -06:00
Jonathan A. Sternberg f6ff8a572d Run continuous query for multiple buckets rather than one per bucket 2016-07-14 11:23:05 -05:00
Ross McDonald c769639e88 Packaging fixes:
* Removes sysvinit-tools as an RPM package dependency.

* Update init script to not rely on sysvinit utils for backwards
  compatibility.

* Minor overall improvements to init script (improved error messages,
  comments, check for root privileges).

* Adds SLES support to post-installation script.
2016-07-12 09:22:57 -05:00
Cory LaNou 8871f5bf8c update connection settings when changing hosts in cli 2016-07-08 11:35:42 -05:00
Jonathan A. Sternberg 83caeec3a4 Support loading a folder for collectd typesdb files 2016-07-07 20:57:57 -05:00
Jonathan A. Sternberg 7a3bd19926 Properly use the 401 and 403 HTTP status codes
According to the HTTP standard, a lack of authentication credentials or
incorrect authentication credentials should send back a 401
(Unauthorized) with a `WWW-Authenticate` header with a challenge that
can be used to authenticate. This is because a 401 status should be sent
when an authentication attempt can be retried by the browser.

The 403 (Forbidden) status code should be sent when authentication
succeeded, but the user does not have the necessary authorization.
Previously, the server would always send a 401 status code.
2016-07-07 20:30:04 -05:00
Jonathan A. Sternberg 12a33fe0d3 Add stats and diagnostics to the TSM engine
Track the number of TSM files in the file store and keep engine
statistics related to the number of TSM compactions.
2016-07-07 19:35:55 -05:00
Jonathan A. Sternberg 036bf7d2d1 Allow any variant of the help option to trigger the help 2016-07-07 16:54:26 -05:00
Jonathan A. Sternberg bd24dc7135 Merge pull request #6970 from influxdata/js-6968-load-default-configuration-file
Always use the demo config when outputting a new config
2016-07-07 16:51:08 -05:00
Jonathan A. Sternberg ad97903a20 Always use the demo config when outputting a new config
Updating the help formatting for all of the commands for consistency.
Removed tabs from the output in favor of using spaces so it is more
clear how the output is intended to look.
2016-07-07 16:29:24 -05:00
Jonathan A. Sternberg 837a9804cf Refactoring the monitor service to avoid expvar
Truncate the time interval output of the monitor service to be on even
time intervals rather than on every minute based on the start time. This
normalizes the output from the monitor service.
2016-07-07 11:13:58 -05:00
Jonathan A. Sternberg 93dda3a65d Drop writes from before the retention policy time window 2016-07-05 12:29:14 -05:00
Jason Wilder 2f82d9a525 Truncate the slice when merging the caches 2016-07-05 12:12:21 -05:00
Jonathan A. Sternberg bb060a60c6 Fix regex binary encoding for a measurement
Previously, it encoded the text representation of the regex literal
which included the surrounding slashes used in the query language. The
binary encoding should only include the exact string used to create the
regular expression.
2016-07-05 11:39:41 -05:00
Todd Persen 0fc2593868 Merge pull request #6939 from ThatCoalGuy/favicon-6938
Added favicon to admin UI
2016-07-01 11:48:55 -07:00
Cole Mackenzie 6d926722b5 added favicon.ico and regenerated statik.go 2016-07-01 08:53:56 +00:00
Jonathan A. Sternberg 3bd51d3537 Fix fill(previous) when used with math operators 2016-06-29 09:54:12 -05:00
Jason Wilder 5aae28e14f Merge pull request #6922 from influxdata/jw-6829
Fix panic: runtime error: index out of range
2016-06-28 09:38:19 -06:00
Jason Wilder fdf0bac717 Fix panic: runtime error: index out of range
Fixes #6829
2016-06-27 18:50:48 -06:00
Cameron Sparr 98360c50d5 Trim BOM from config file for windows support
Default windows text editor (Notepad) adds a BOM to the beginning of the
file. This needs to be trimmed otherwise we will get an "invalid toml"
error.

see https://github.com/influxdata/telegraf/issues/1378
and http://utf8everywhere.org/#faq.boms
2016-06-24 07:50:13 +01:00
Jonathan A. Sternberg b8e52ce39a Merge pull request #6889 from influxdata/js-update-config-options
Update help and remove unused config options from the configuration file
2016-06-23 11:49:10 -05:00
Jason Wilder ca6bfac01a Fix out of order blocks returned during query
If there were blocks in later TSM files that were for overwritten
points or writes into the past, they could be returned more than
once or out of order causing the cursor values to be unsorted.

One effect of this is that graphs in graphana would render with
the line going all over the place in spots.

This might also cause duplicate data to be returned.

Fixes #6738
2016-06-22 17:34:44 -06:00
Jack Zampolin e39dcaf8f0 Clean up code, fix struct and file names to fit with golang convention 2016-06-22 13:13:36 -07:00
Jonathan A. Sternberg 1d20498273 Allow a non-admin to call "use" for the influx cli
Previously, a non-admin could not call "use" in the influx cli since the
`SHOW DATABASES` command requires admin permissions to run. The correct
solution to this is likely to allow non-admins to call `SHOW DATABASES`,
but only see the databases they should be capable of seeing.

Since we don't have this kind of fine-grained authorization yet and
plans for it are still in the works, we do need someway to not
arbitrarily cripple non-admins attempting to use the cli program. This
is a temporary solution that will ignore any authorization errors from
`SHOW DATABASES` if authorization has been set. A warning message will
be printed and the database will be switched. This should be enough to
ensure that there is some warning that you may not have switched to a
valid database while not crippling non-admin users.

A temporary solution for #6397.
2016-06-22 08:15:18 -05:00
Jonathan A. Sternberg 22173acb70 Update help and remove unused config options from the configuration file
Normalize the output for the various help options so they all follow the
same format and display all relevant options.

Removing some of the unused config options from the configuration file
and updating the help documentation. Removing some remaining references
to clustering within the open source version.
2016-06-21 14:06:05 -05:00
Jonathan A. Sternberg 2a1e6533b7 Rename dumptsmdev to dumptsm in influx_inspect
Removes the old implementation of `dumptsm`. It was for an older version
of the tsm1 files that is no longer used and now just panics when used
on a tsm1 file. dumptsmdev has been renamed to `dumptsm`, but the old
`dumptsmdev` command still works for compatibility.
2016-06-21 10:31:05 -05:00
Jonathan A. Sternberg 8812bc8a93 Remove a double lock in the tsm1 index writer 2016-06-20 17:32:34 -05:00
Jonathan A. Sternberg 1d03151631 Remove FieldCodec from tsdb package
Updated `influx_inspect` to use the `FieldDimensions` method instead
(more reliable anyway). The `influx_tsm` program used its own vendored
copy of `FieldCodec` so it is not affected by this change. `FieldCodec`
was only used for the `b1` and `bz1` engines which were removed in 0.12,
but the code that created the field codec was never removed. This
limited the maximum number of fields to 255 even though that restriction
was removed with the `tsm1` engine.

Fixes #6869.
2016-06-19 21:38:43 -05:00
Jonathan A. Sternberg 551cb61d9e Merge pull request #6860 from influxdata/js-6859-condition-nil-iterator-panic
Set the condition cursor instead of aux iterator when creating a nil condition cursor
2016-06-17 15:13:39 -05:00
Jonathan A. Sternberg 6e205ce135 Set the condition cursor instead of aux iterator when creating a nil condition cursor
A copy/paste error had nil cursors destined for a condition cursor get
set to the auxiliary cursor instead. When the number of conditions
exceeded the number of auxiliary fields, this would result in a stack
trace in some situations. When the number of conditions was less than or
equal to the number of auxiliary fields, it means that an auxiliary
cursor may have been overwritten with a nil cursor accidentally and a
leak might have happened since it was never closed.

Fixes #6859.
2016-06-17 14:54:48 -05:00
Jonathan A. Sternberg 6c7b670821 Remove 1.0.0-beta1 section and merge with the 1.0.0 section 2016-06-17 14:18:47 -05:00
Jonathan A. Sternberg 55a58aaaca Remove systemd output redirection
Let systemd handle the output so the journal can be used. This also
let's the user configure if the journal stores the output of this
service to a file instead of setting the location.

Fixes #6824.
2016-06-17 13:00:00 -05:00
Jonathan A. Sternberg 8e1b036b0a Modify the max nanosecond time to be one nanosecond less
The highest time represented by a nanosecond needs to be used for an
exclusive range, so the maximum time needs to be one less than the
possible maximum number of nanoseconds representable by an int64 so that
we don't lose a point at that one time.

Previously worked in the open source version because the timestamp used
for finding a shard would be truncated by the retention policy so the
lookup time didn't run into this edge case because it didn't rest on the
truncation boundary. Since that point didn't really belong in that shard
group and was placed there by mistake, it's best to fix this bug since
the timestamp used to create the shard group should be capable of
retrieving it.
2016-06-16 12:15:41 -05:00
Jack Zampolin 910e9fc2e0 Add changelog entry 2016-06-14 14:06:17 -07:00
Jonathan A. Sternberg 779fcea06f Merge pull request #6835 from influxdata/js-sysvinit-tools-on-redhat
Include sysvinit-tools as an rpm dependency
2016-06-14 09:09:55 -05:00
Cameron Sparr b9a3f2e1e5 Make httpd logger closer to Common Log Format
changes the httpd log lines from this:

    [httpd] 2016/06/08 14:06:39 ::1 - - [08/Jun/2016:14:06:39 +0100] POST /write?consistency=any&db=telegraf&precision=s&rp= HTTP/1.1 204 0 - InfluxDBClient d6aa01fc-2d79-11e6-8024-000000000000 2.751391ms

to this:

    [httpd] ::1 - - [08/Jun/2016:14:06:39 +0100] "POST /write?consistency=any&db=telegraf&precision=s&rp= HTTP/1.1" 204 0 "-" "InfluxDBClient" d6aa01fc-2d79-11e6-8024-000000000000 2751

So it changes a few things:

1. Remove the logger timestamp at the beginning which isn't very relevant anyways
2. adds quotes around "METHOD URI PROTOCOL", because this is part of the
common log format.
3. adds quotes around "AGENT" and "REFERRER" because this is part of the
"combined" log format.
4. Puts the response time in integer microseconds, because this is
consistent with apache's %D config mod option.

Compared with CLF, our logs now look like this:

    [httpd] %{COMMON_LOG_FORMAT} "<agent>" "<referrer>" <request_uuid> <response_time_µs>

For reference, see:
https://en.wikipedia.org/wiki/Common_Log_Format
http://httpd.apache.org/docs/current/mod/mod_log_config.html
2016-06-14 14:48:24 +01:00
Jonathan A. Sternberg fed8fd385f Include sysvinit-tools as an rpm dependency 2016-06-13 20:08:18 -05:00
Jonathan A. Sternberg 32472026a3 Merge pull request #6564 from influxdata/js-4532-show-tag-values-with-regex
Support regex selection in SHOW TAG VALUES for the key
2016-06-13 10:16:56 -05:00
Jonathan A. Sternberg 2e36c27b15 Merge pull request #6801 from influxdata/js-6771-duplicate-series-with-same-tag-set
Fix the point validation parser to identify and sort tags correctly
2016-06-13 10:09:06 -05:00
Jonathan A. Sternberg 9837de793c Support regex and other operations for selecting the key in SHOW TAG VALUES
This adds support for using regex expressions in SHOW TAG VALUES when
selecting the key. Also supporting the `!=` operation for the
comparison. Now you can do any of the following:

    SHOW TAG VALUES WITH KEY != "region"
    SHOW TAG VALUES WITH KEY =~ /region/
    SHOW TAG VALUES WITH KEY !~ /region/

It also adds a new SetLiteral AST node that will potentially be used in
the future to allow set operations for other comparisons in the future.

Fixes #4532.
2016-06-13 10:03:14 -05:00
Jonathan A. Sternberg 3bd9425edb Fix the point validation parser to identify and sort tags correctly
Fixes #6771.
2016-06-13 09:45:10 -05:00
Ben Johnson 7d4bea7153
add node id to execution options
This commit changes the `ExecutionOptions` and `SelectOptions` to
allow a `NodeID` for specifying an exact node to query against.
2016-06-10 09:20:44 -06:00
Jonathan A. Sternberg 4f37bc5a40 Support specifying a retention policy for the graphite service
The graphite service will attempt to create the retention policy and use
it. If the retention policy doesn't exist, it will be created with the
default options.

Fixes #5655.
2016-06-08 17:01:44 -05:00
Paul Dix 6fa52441de Update CHANGELOG.md 2016-06-07 07:24:24 -07:00
Jonathan A. Sternberg b8e22d9d79 Merge pull request #6586 from influxdata/js-3733-rename-default-retention-policy
Modify the default retention policy name and make it configurable
2016-06-06 15:05:29 -05:00
Rubycut a849f42cc2 Lock auth properly, code suggested by @jwilder 2016-06-04 09:05:10 +02:00
Jonathan A. Sternberg 5c7bcda82c Set X-Influxdb-Version header on every request (even 404 requests)
Fixes #6756.
2016-06-03 10:29:50 -05:00
David Norton 62f3b4486a batch SELECT INTO writes 2016-06-01 12:05:23 -04:00
Edd Robinson 003c30989a Check for no values 2016-05-31 16:28:17 +01:00
Jason Wilder ca13cb9932 Update changelog 2016-05-27 10:43:37 -06:00
Joe LeGasse f2fd988ab9 Delay parsing of date/time strings until needed
The current code would compare every string literal it crossed and tried
to coerce them to time literals if the _looked_ like date/time strings.

The only time the TimeLiteral was used is when comparing to the the
'time' value in a where clause. This change moves the string parsing
code until we attempt to compare 'time' to a string, at which point we
know we need/want a TimeLiteral, and not just an ordinary string.

Fixes #6727
2016-05-27 09:43:45 -04:00
Alex Russell-Saw 7edb14bffd assign engine to shard after engine is initialized 2016-05-27 13:45:16 +01:00
Edd Robinson f4fc905fa9 Reject timestamps too far in future 2016-05-27 11:07:48 +01:00
Edd Robinson 39f3480f28 Ensure points with trailing whitespace are accepted 2016-05-26 19:00:24 +01:00
Jonathan A. Sternberg 907c88d4b5 Truncate the shard group end time if it exceeds MaxNanoTime
Related to #6599.
2016-05-25 21:25:10 -04:00
Jason Wilder 7d50970631 Fix continous compaction edge case
The level planner would keep including the same TSM files to be
recompacted even if they were already quite compacted and split
across several TSM files.

Fixes #6683
2016-05-25 10:36:24 -06:00
Jonathan A. Sternberg cebe256773 Merge pull request #6706 from influxdata/js-remove-deprecated-features
Remove features that were deprecated for 1.0
2016-05-25 11:56:18 -04:00
Jonathan A. Sternberg baaa782c95 Modify the default retention policy name and make it configurable
The default retention policy name is changed to "autogen" instead of
"default" since it ends up being ambiguous when we tell a user to check
the default retention policy, it is uncertain if we are referring to the
default retention policy (which can be changed) or the retention policy
with the name "default".

Now the automatically generated retention policy name is "autogen".

The default retention policy is now also configurable through the
configuration file so an administrator can customize what they think
should be the default.

Fixes #3733.
2016-05-24 09:51:23 -04:00
Jonathan A. Sternberg 6a3f7f5ded Remove support for fixing [[collectd]] and [[opentsdb]] sections 2016-05-24 09:50:15 -04:00
Jonathan A. Sternberg 32e42b93ae Merge pull request #6705 from influxdata/js-6701-duplicate-points-with-select
Filter out sources that do not match the shard database/retention policy
2016-05-24 09:48:31 -04:00
Edd Robinson 853a95e0b3 Reduce allocations on Query's io.Stringer implementation
A query's String method is called multiple times per query. This commit
ensures all calls to query.String share use of a strings.NewReplacer.

This approximately halves the number of allocations for the benchmarked
query.
2016-05-24 14:27:38 +01:00
Jason Wilder 0752ca8d29 Merge pull request #6686 from influxdata/jw-timestamp
Optimize timestamp run-length decoding
2016-05-23 15:24:30 -06:00
Jonathan A. Sternberg 5e7e0bd19b Filter out sources that do not match the shard database/retention policy
If you use a statement like this:

    SELECT value FROM one..cpu, two..cpu

It will access both the `one` and `two` databases as if you had selected
the `cpu` measurement twice for both of them. Updated the `tsdb.Shard`
create iterator function to filter out any sources that do not apply to
that shard so this duplication doesn't happen.

Fixes #6701.
2016-05-23 17:05:33 -04:00
David Norton 9d5c4a0f41 fix #6702: return correct required privileges
Change SelectStatement to return required privileges for all Sources.
2016-05-23 16:44:23 -04:00