Commit Graph

90 Commits (8ed55e72b85b0807c97d3d1d7d12e9f07c9737e9)

Author SHA1 Message Date
Stuart Carnie ecbb5987a6 feat: add v1 auth set-password command to set token passwords
* Added capability to HTTP API to search for tokens by ID or Token
2020-10-29 08:21:38 -07:00
Stuart Carnie 4e96f30f8d fix: V1 user authentication tokens no longer require SHA256
Remove remnants of previous token implementation

* As of #19840, V1 API tokens will be authorized using bcrypt passwords
2020-10-29 08:21:38 -07:00
Stuart Carnie 6bc4158a46 feat(authorization): Add bcrypt password support to v1 authorizations
This commit extends the `v1/authorization` package to support
passwords associated with a token.

The summary of changes include:

* authorization.Service implements influxdb.PasswordsService
* Setting passwords for authorizations
* Verifying (comparing) passwords for a given authorization
* A service to cache comparing passwords, using a weaker hash
  that will live in memory only. This implementation is copied
  from InfluxDB 1.x
* Extended HTTP service to set a password using
  /private/legacy/authorizations/{id}/password

Closes #
2020-10-28 13:03:42 -07:00
Faith Chikwekwe 5e1cdda597 feat(storage): enable window agg mean pushdown 2020-10-27 12:53:54 -07:00
Christopher M. Wolff 790165b05a
refactor: allow newIndexSeriesCursor() to accept an influxql.Expr (#19833)
* refactor: allow newIndexSeriesCursor() to accept an influxql.Expr

In order to let TagKeys and TagValues get the right answer,
sometimes they will need to examine their predicate and
see if using the index is possible, or if a block scan is needed.
For those cases we want to examine the predicate before creating
the index series cursor. This change allows us to create an
index series cursor with an already-deserialized influxql.Expr.
2020-10-27 09:31:46 -07:00
Stuart Carnie 5c63c2163d feat(authorization): Create a v1 authorization service
This service is a private API for managing authorization tokens
for v1 API requests.

Note that this commit does not hook up the service to the v1
`/query` and `/write`, which will occur in a subsequent PR.

Closes #19812
2020-10-27 08:26:10 -07:00
vlastahajek 8763bb1af9 feat(upgrade): upgrade databases 2020-10-08 09:39:30 -07:00
Jonathan A. Sternberg 025319c387
fix(services/storage): multi measurement queries return all applicable series (#19566)
This fixes multi measurement queries that go through the storage service
to correctly pick up all series that apply with the filter. Previously,
negative queries such as `!=`, `!~`, and predicates attempting to match
empty tags did not work correctly with the storage service when multiple
measurements or `OR` conditions were included.

This was because these predicates would be categorized as "multiple
measurements" and then it would attempt to use the field keys iterator
to find the fields for each measurement. The meta queries for these did
not correctly account for negative equality operators or empty tags when
finding appropriate measurements and those could not be changed because
it would cause a breaking change to influxql too.

This modifies the storage service to use new methods that correctly
account for the above situations rather than the field keys iterator.

Some queries that appeared to be single measurement queries also get
considered as multiple measurement queries. Any query with an `OR`
condition will be considered a multiple measurement query.

This bug did not apply to single measurement queries where one
measurement was selected and all of the logical operators were `AND`
values. This is because it used a different code path that correctly
handled these situations.
2020-09-17 14:28:24 -05:00
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() (#19546)
* refactor: Replace ctx.Done() with ctx.Err()

Prior to this commit we checked for context cancellation with a select
block and context.Context.Done() without multiplexing over any other
channel like:

  select {
    case <-ctx.Done():
      // handle cancellation
    default:
      // fallthrough
  }

This commit replaces those type of blocks with a simple check of
ctx.Err().  This has the following benefits:

* Calling ctx.Err() is much faster than entering a select block.

* ctx.Done() allocates a channel when called for the first time.

* Testing the result of ctx.Err() is a reliable way of determininging if
  a context.Context value has been canceled.

* fix: Fix data race in execDeleteTagValueEntry()
2020-09-16 12:20:09 -04:00
Stuart Carnie 8576d1df99 feat: Implement DELETE FROM and DROP MEASUREMENT
Closes #19416
2020-09-11 11:37:43 -07:00
Stuart Carnie 7e16da8f74 chore: Consolidate `v1/internal` to `internal`
Take the opportunity to combines duplicated types in both packages
under the root `internal` package
2020-09-11 11:37:43 -07:00
Stuart Carnie 6f0cf049ca feat: Port shard precreation service from InfluxDB 1.x
Provides new configuration parameters:

```
--storage-shard-precreator-advance-period
--storage-shard-precreator-check-interval
```

Closes #19520
2020-09-09 13:34:22 -07:00
Stuart Carnie e265f60b55 fix: Improvements in response to PR feedback
* Pass context.Context to Service.Open
* Remove redundant comments
* Bind to retention.Config configuration to be consistent with 1.x
2020-09-09 10:32:06 -07:00
Stuart Carnie 7c2be6e780 feat: Port 1.x retention policy enforcement service
Configuration of the check interval is available via

```
--storage-retention-check-interval
```

Closes #19309
2020-09-09 10:32:06 -07:00
Stuart Carnie 7f94b0d5db
fix: Rewrite predicate to remove _field from schema physical operations
Fixes #19488
2020-09-02 11:10:40 -07:00
Stuart Carnie b3138d2ead
fix: Ensure TemporaryEngine returns new inner TSDB store 2020-09-01 10:50:44 -07:00
Brett Buddin b917d8d9b0
chore(influxdb): Placate the linter. 2020-08-27 15:46:32 -04:00
Stuart Carnie dee8977d2c
chore: move v2/v1/tsdb → v2/tsdb 2020-08-26 10:46:47 -07:00
Stuart Carnie 8bebf9cbeb
fix(coordinator): Return correct data types for stand-in RP values
Future work is required to ensure the retention policy information
is appropriately retrieved from the bucket service and / or meta client
2020-08-25 16:26:16 -07:00
Stuart Carnie afd5120221
fix(storage): Ensure _field tag key has special handling
Fixes #19120
2020-08-21 13:06:00 -07:00
Stuart Carnie 2b8d6ca14a
fix(influxql): Fix broken unit tests 2020-08-14 15:09:40 -07:00
Stuart Carnie 8a7dcc21fb
feat(influxql): Initial implementation of InfluxQL query engine
* Some tests are broken or do not pass; follow up PRs will resolve that
2020-08-14 12:37:30 -07:00
Stuart Carnie a29ec693df
fix(tsdb): MaxSeriesPerDatabase is only supported by the inmem index 2020-08-12 09:12:16 -07:00
Stuart Carnie 9b76352f74
fix(tsdb): MaxValuesPerTag is only supported by the inmem index type 2020-08-11 15:02:22 -07:00
Stuart Carnie 381ea6ec85
fix(tsi1): Update SQLIndexExported expected output 2020-08-03 17:10:51 -07:00
Stuart Carnie 840d0a994f
fix(inspect): Add export-index command for tsdb 1.x 2020-08-03 15:17:17 -07:00
Stuart Carnie 6b0fffe17a
fix: Default to TSI1 index for new shards 2020-08-03 15:13:01 -07:00
Stuart Carnie d67b034868
fix(storage): Fix panic when no shards exists 2020-08-03 10:26:32 -07:00
Stuart Carnie 21c3733464
fix(storage): meta.Client persists to kv and updates via BucketService
Includes initial migration to add metadata bucket
2020-08-03 09:21:02 -07:00
Stuart Carnie e772333b6b
feat(meta): Use kv.Store abstraction to read and write to files or kv 2020-08-03 09:20:51 -07:00
Stuart Carnie 89532f0c29
refactor: move v2/v1/models to v2/models 2020-08-03 09:20:51 -07:00
Stuart Carnie d32709ed16
chore: More cleanup 2020-08-03 09:20:50 -07:00
Stuart Carnie 7c225cb3ac
chore: More cleanup 2020-08-03 09:20:50 -07:00
Stuart Carnie 26c18ac0a5
chore: Converging on 1.x tsdb 2020-08-03 09:20:48 -07:00
Edd Robinson 2b175291be
refactor: WIP removing tsbd 2020-08-03 09:18:34 -07:00
Stuart Carnie 05007a7df6
chore: Remove unused flux package from 1.x 2020-08-03 09:18:34 -07:00
Stuart Carnie a97ec1f34e
feat: Initial commit with working reads 2020-08-03 09:18:34 -07:00
Edd Robinson 89efcb3d74
refactor: writes work 2020-08-03 09:18:34 -07:00
Edd Robinson 8c4bb1d65f
refactor: strip contents of storage engine 2020-08-03 09:17:24 -07:00
Stuart Carnie 92efddbfbe
chore(tsdb): Initial commit of tsdb package
* pulls in 1.x tsdb, compiles and passes test
2020-08-03 09:17:23 -07:00