Commit Graph

9632 Commits (4961a4435bf78af17dfb7cd0560d3f8b40a9f341)

Author SHA1 Message Date
Jonathan A. Sternberg cddc1b2241 Fix remote execution for partially replicated clusters
The RPC handler for remote queries would attempt to reuse a closed
connection for certain commands that didn't use pooling. The RPC
commands that close the connection have been fixed to not try reusing
the connection.

When creating an iterator, if there are no points to return, the points
decoder would hit an EOF that it didn't catch and would return that
error back to the client who made the request. It now properly returns
no points by using a `nilFloatIterator` if there are no points to
return.

This fixes remote execution when a cluster has nothing to return.
2016-02-25 17:46:51 -05:00
Ben Johnson 1fb8806616 Merge pull request #5842 from benbjohnson/series-list-marshal
Add SeriesList binary marshaling
2016-02-25 15:38:44 -07:00
Ben Johnson 16eea8eecc add SeriesList marshaling 2016-02-25 15:38:16 -07:00
Jason Wilder 941fe4ce69 Merge pull request #5841 from influxdata/jw-time-int64
Convert time.Time to int64
2016-02-25 15:32:12 -07:00
Jason Wilder 8d70d65a82 Convert time.Time to int64 2016-02-25 15:15:01 -07:00
Jason Wilder 55a503671d Merge pull request #5833 from jonseymour/jss-5832-snapshot-may-not-be-sorted
tsm: cache: need to check that snapshot has been sorted
2016-02-25 15:10:49 -07:00
Mark Rushakoff 56aebebc87 Merge pull request #5810 from influxdata/mr-shard-diagnostics-tags
Add database, RP as tags on shard stats
2016-02-25 13:53:26 -08:00
Mark Rushakoff 40a98e0d55 Add database, RP as tags on shard stats
This commit updates tsdb.Shard to contain a ShardConfig and updates
tsdb.Store to directly reference a map of tsdb.Shard rather than the
previous tsdb.shardLocation abstraction.
2016-02-25 13:41:55 -08:00
Jon Seymour ddcb92c8db Update CHANGELOG for #5832.
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 07:59:18 +11:00
Jon Seymour 11123d2694 Merge #5833 (issue: #5832).
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 07:59:03 +11:00
Jon Seymour 2c7cd06b99 tsm: cache: need to check that snapshot has been sorted.
Previously, the for loop at the end of the method assumed that all entries
had been deduplicated, including the entry discovered in the snapshot.

However, this wasn't actually true. With this change, we make it true.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 07:56:25 +11:00
Jon Seymour 7eabae68de tsm: cache: add a test for the write sequence {6,1,snapshot,7,2}
Consider the write sequence: 6,1,snapshot,7,2.

The hot cache gets deduplicated, so is 2,7.

Now consider the test if 1 >= 2, this is false, so needSort is not set to true.

The problem is the implicit assumption that the snapshot is always sorted
by the time that merged() runs, but this may not be true.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 07:43:50 +11:00
Jason Wilder c6f5aa038f Merge pull request #5834 from Gouthamve/master
Added Pull Request Template
2016-02-25 09:59:37 -07:00
Jason Wilder 6ebc192298 Merge pull request #5678 from jonseymour/typo
doc: typographical, spelling, grammar, word-choice and phrasing improvements.
2016-02-25 09:33:41 -07:00
Jason Wilder 76dc958db0 Update changelog
[ci skip]
2016-02-25 09:20:49 -07:00
Jason Wilder daf68dbbd2 Merge pull request #5701 from jonseymour/js-deduplicate-safety
tsm: cache: improve thread safety of Cache.Deduplicate (see #5699)
2016-02-25 09:18:10 -07:00
Mark Rushakoff e7bb855ab2 Merge pull request #5816 from influxdata/mr-database-stats
Track stats for number of series, measurements
2016-02-25 08:13:04 -08:00
Ben Johnson eaed2aadcf Merge pull request #5811 from benbjohnson/remote-exec-2
Remote Execution
2016-02-25 09:05:17 -07:00
Ross McDonald e8262b306c Merge pull request #5596 from influxdata/ross-build-updates
Build updates
2016-02-25 10:03:44 -06:00
Ross McDonald 2b66f521fa Updated changelog for build updates. 2016-02-25 09:42:20 -06:00
Ben Johnson 0dda9f6608 add remote execution
This commit adds remote execution to the query engine.
2016-02-25 08:41:20 -07:00
Ross McDonald 82970e8dc3 Updated handling of default 'arm' arch build process, removing the
`--pkgarch` and `--goarm` flags from the build.py script. Also
improved `gdm` functionality if the GOBIN path is not on the user's
path.
2016-02-25 09:35:03 -06:00
Ross McDonald 1a62cdbd9a Removed builtTime reference from influxd. Removed default version information from influxd. 2016-02-25 09:35:03 -06:00
Ross McDonald b91008d2c1 Re-added Windows builds to build script. Minor bug fixes. 2016-02-25 09:35:03 -06:00
Ross McDonald 6efd822810 Remove build time linker flag so that we can create reproducible builds. 2016-02-25 09:35:03 -06:00
Ross McDonald ee4743abee Updates to build.py script:
- Merged generalized changes from the Kapacitor build.py script for
  easier porting of features between projects
- Changed the nightly versioning scheme to use a tilde instead of a
  dash for easier upgrade paths.
- Added `go get` call for each platform in case of platform-specific
  build flags.
- Added a `--no-stash` option to prevent uncommitted changes from
  sneaking into packaged builds.
- Better automatic handling of version numbers.
- Removed per-platform go get command (for now).
- Added better build and packaging logic for ARM architectures.
2016-02-25 09:35:03 -06:00
Goutham Veeramachaneni 8ff1143aaa Added Pull Request Template
As we are already making use of the template in Contributing.md, it makes sense to use github's new feature! Check https://github.com/blog/2111-issue-and-pull-request-templates
2016-02-25 20:25:23 +05:30
Jon Seymour 4d98a1cf28 tsm: cache: remove unnecessary lock escalation.
Previously, we needed a write lock on the cache because it was the
only lock we had available to guard updates to entry.values and
entry.needSort.

However, now we have a entry-scoped lock for this purpose, we don't
need the cache write lock for this purpose. Since merged() doesn't
modify the .store or the c.snapshot.sort, there is no need for
a write lock on the cache to protect the cache.

So, we don't need to escalate here - we simply rely on the entry lock
to protect the entries we are iterating over.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 01:31:54 +11:00
Jason Wilder 452d77cbaf tsm: cache: introduce entry locks.
Based on @jwilder's alternative to the 'dirty' slice that featured
in previous iterations of this fix.

Suggested-by: Jason Wilder <jason@influxdb.com>
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-26 00:05:38 +11:00
Jon Seymour eb7eec078d tsm: cache: introduce commit lock to Cache
Currently two compactors can execute Engine.WriteSnapshot at once.

This isn't thread safe since both threads want to make modifications to
Cache.snapshot at the same time.

This commit introduces a lock which is acquired during Snapshot() and
released during ClearSnapshot(), ensuring that at most one thread
executes within Engine.WriteSnapshot() at once.

To ensure that we always release this lock, but only release the
snapshot resources on a successful commit, we modify ClearSnapshot() to
accept a boolean which indicates whether the write was successful or not
and guarantee to call this function if Snapshot() has been called.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-25 12:10:37 +11:00
Jon Seymour 45d025db99 tsm: cache: add a tests to demonstrate thread safety vulnerabilities
There are two tests that show two different one vulnerability.

One test shows that Cache.Deduplicate modifies entries in a snapshot's
store without a lock while cache readers are deduplicating those same
entries while correctly locked.

A second test shows that two threads trying to execute the methods
that Engine.WriteSnapshot calls will cause concurrent, unsynchronized
mutating access to the snapshot's store and entries.

The tests fail at this commit and are fixed by subsequent commits.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-25 12:10:31 +11:00
Jon Seymour d7d81f79da tsm: cache: add a test that demonstrates concurrent reads are safe
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-25 12:06:10 +11:00
Sean Beckett bb378732c0 Update README.md 2016-02-24 16:40:21 -08:00
Jonathan A. Sternberg 2fb3c0c42c Merge pull request #5822 from Gouthamve/master
Linted cmd/ packages. Refs #4098
2016-02-24 18:26:03 -05:00
Goutham Veeramachaneni b1d7e59546 Lint cmd/ packages
Related to #4098

Lint cmd/influxd/

* Errors cannot end with punctuation
* Better comment for exported method
* Better control flow when return is present

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>

Linted cmd/influx_tsm

* Added comments to exported fields
* Removed punctuation at the end of errors

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>

Linted cmd/influx_tsm/b1 and cmd/influx_tsm/bz1

* Added comments to exportes fields

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>

Linted cmd/influx_tsm/tsdb

* Added comments to exported fields
* range k, _ :=  can be written as range k :=
* removed else when return is present
* Added consistency to receiver names in methods

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>

Fix typos

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2016-02-25 01:44:23 +05:30
Jonathan A. Sternberg eb27143422 Merge pull request #5819 from influxdata/js-5814-cqs-with-the-same-name
Fix running multiple CQs with the same name
2016-02-24 14:44:19 -05:00
Jonathan A. Sternberg 0730573e27 Fix running multiple CQs with the same name
Previously, CQs with the same name would be stored in the last run map
the same way. This caused only one of the CQs to run because after the
first one ran it would update the last run time for all CQs with the
same name.

Add the database name to the CQ ID in the last run map to differentiate
between CQs in different databases.

Fixes #5814.
2016-02-24 12:23:52 -05:00
Jonathan A. Sternberg 60e0d16475 Merge pull request #5798 from influxdata/js-5770-remove-dimensions-from-field-wildcards
Remove dimensions from field wildcards
2016-02-24 12:23:00 -05:00
Ben Johnson 23ef15b704 Merge pull request #5753 from influxdata/er-meta-queries
Support mutable meta queries in a cluster
2016-02-24 10:18:50 -07:00
David Norton b30647667b fix MetaExecutor max write connections 2016-02-24 11:24:45 -05:00
David Norton 0022cfe6fd add test for meta.MetaExecutor.ExecuteStatement 2016-02-24 11:24:45 -05:00
David Norton 13b3567449 check number of nodes in meta_executor 2016-02-24 11:24:45 -05:00
Edd Robinson f9c95ad266 More useful error message for node failure 2016-02-24 11:24:45 -05:00
David Norton bb97bb86d4 remove cruft from defer conn close 2016-02-24 11:24:45 -05:00
Edd Robinson 8add49fd96 Ensures meta queries work in clusters.
Fixes #5612, #5573 and #5518.

Using the MetaExecuter, queries that need to run on both data nodes
and optionally the meta store will be executed across all data nodes
in the cluster.
2016-02-24 11:24:45 -05:00
David Norton 4d4e382ddf Add a Meta Executor.
The Meta Executor will make allow data nodes to execute queries
remotely on each other, via RPC calls.
2016-02-24 11:24:22 -05:00
Mark Rushakoff fb83374389 Track stats for number of series, measurements
Per database: track number of series and measurements
Per measurement: track number of series
2016-02-24 08:10:16 -08:00
Jonathan A. Sternberg 3cdb4c1c12 Merge pull request #5797 from influxdata/js-update-toml-dependency
Update toml dependency for slice panic when reading the config
2016-02-24 10:02:21 -05:00
Jason Wilder e32e5ff481 Merge pull request #5807 from jonseymour/jss-5804+5805
tsm: cache: undo statistics regressions #5804, #5805.
2016-02-23 13:46:27 -07:00
Jon Seymour 530b86ba7d tsm: cache: restore the semantics of cachedBytes and memSize stats
Fixes #5805.

This commit undoes a regression introduced by #5789.

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
2016-02-24 06:16:46 +11:00