Commit Graph

387 Commits (9775e150b2ff78ce5817a28153d5827937f7c35d)

Author SHA1 Message Date
wiedld ca492b09d2 fix(idpe-17449): accept content-encoding identity for the parseBody 2023-04-13 17:09:21 -07:00
dependabot[bot] e811a69a1e
chore(deps): Bump serde_json from 1.0.95 to 1.0.96 (#7535)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.95...v1.0.96)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 10:07:32 +00:00
kodiakhq[bot] 53ddca45d8
Merge branch 'main' into cn/remove-write-summary 2023-04-12 16:07:35 +00:00
Andrew Lamb 20e9c91866
refactor: Use workspace dependencies for `tonic`, `tonic-build`, etc (#7515)
* refactor: Use workspace dependencies for `tonic`, `tonic-build`, etc

* chore: Run cargo hakari tasks

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-12 16:07:19 +00:00
Carol (Nichols || Goulding) 6387a9576a
fix: Remove the write_summary crate and write info service 2023-04-12 11:31:23 -04:00
Carol (Nichols || Goulding) d025362ce0
fix: Remove old router 2023-04-12 10:15:48 -04:00
Fraser Savage dc6053bfba
refactor(router): Apply further code review changes, clean up docs 2023-04-12 14:40:02 +01:00
Fraser Savage 8a2b88398f
refactor(router): Apply suggestions from code review
Assert an invariant, document existing edge cases and a little cleanup.

Co-authored-by: Dom <dom@itsallbroken.com>
2023-04-12 14:12:12 +01:00
Fraser Savage a6ccb05caf
refactor(router): DML handler tests use helper fn to set-up NS cache 2023-04-11 16:47:48 +01:00
Fraser Savage 728b7293b9
feat(router): Use read-through namespace cache for NamespaceResolver
The NamespaceResolver was using its own very similar look-aside caching
to the DML handlers, this commit leverages the read-through cache
implementation to deduplicate more code and makes the read through
behavioural expectation explicit for namespace autocreation.
2023-04-11 15:38:18 +01:00
Fraser Savage d590d19e3b
feat(router): Use read-through NamespaceCache with DML handlers
This removes the look-aside cache from the retention_validation
and schema_validation DML handlers, instead setting up the new
NamespaceCache decorator and using that to handle cache misses.
2023-04-11 15:38:17 +01:00
Fraser Savage 0bb88dcd4f
refactor(router): Return Result from NamespaceCache, use GAT for Error
This commit refactors the NamespaceCache trait to return a result
instead of an option for calls to `get_schema()`, allowing callers and
decorators to differentiate between cache misses, namespaces not
existing and transient I/O errors. This allows implementations to
interact with backend catalog storage.
2023-04-11 15:38:17 +01:00
Fraser Savage 082e8db9ef
refactor(router): Make NamespaceCache an async_trait
In order to implement a read-through NamespaceCache
decorator the `get_cache()` call will need to interact
with async catalog methods, so this allows implementations
to call await within the `get_cache()` body.
2023-04-11 15:38:16 +01:00
Dom Dwyer 73d44ec9a1
Merge remote-tracking branch 'origin/main' into dom/req-mode-parsing 2023-04-11 13:34:52 +02:00
Martin Hilton d2585002fe
chore(authz): Change "namespace" to "database" (#7502)
Part of the wider effort to consistently use tht term "database"
for the user-facing terminology, update the authorization system.
Whilst this system is technically user-facing, it is unlikely many
users will see it. It is however new enough that the change is
relatively little effort.
2023-04-11 11:04:51 +00:00
wiedld 9a56d08ddc test: add namespace char validation tests, to highlight the current contracts for v1/v2 and MT/CST. Contracts will be iterated with followup issue 7489 2023-04-10 12:59:20 -07:00
wiedld 9288155ac4 test: add multi-tenant missing params test, invalid namespaceError test for v1 single tenant, and v2 single-tenant missing bucket should have consistent message. 2023-04-10 12:59:20 -07:00
Dom Dwyer 306bffb4b7 docs: fix comment
Copy/paste.
2023-04-10 12:59:20 -07:00
Dom Dwyer 7424ad62e1 test: multi-tenant write handler
Adds tests that drive the multi-tenant HTTP write request parser.

Note that in addition to these unit tests, there's still considerable
integration converge of the HTTP write endpoint in multi-tenant mode in
http.rs (test_write_handler!) that asserts the system is unchanged in
the "default" run-mode of multi-tenant.
2023-04-10 12:59:20 -07:00
Dom Dwyer 7fed2ba456 feat(router): single tenancy operational mode
Adds a single-tenant mode (CST) to the IOx routers.

Single-tenancy mode differs in two main ways:

    * V1 write endpoint is partially supported
    * V2 write endpoint ignores "org" parameter

The "normal" mode is "multi tenant" which is the default operational
mode, and all existing behaviour remains unchanged. Single tenant mode
can be enabled by specifying INFLUXDB_IOX_SINGLE_TENANCY=true.

Request parsing is delegated to two implementations of the
WriteParamExtractor trait, one each for CST and MT - the logic of each
"mode" is defined within these files and all other functionality is
common between the two.

This commit also renames some of the error types for clarity
(NoSpecified -> NoOrgBucketSpecified, other NotSpecified ->
NoQueryParams, etc).

Note: single tenant code requires testing
2023-04-10 12:59:20 -07:00
Dom Dwyer 9703719294 test(router): constify test namespace
Define the namespace as a const to make the purpose/magic clear.
2023-04-10 12:59:20 -07:00
Fraser Savage 9fcaee9ac9
Merge branch 'main' into savage/6824-update-namespace-service-limit-api-call 2023-04-05 14:52:44 +01:00
Fraser Savage b53b8c7d76
refactor(namespace): Flatten service protection limits in Namespace proto definition
This commit also cleans up the code formatting for the gRPC handler and
simplifies some of the gRPC handler tests for the new update service
limit API.
2023-04-05 14:46:30 +01:00
dependabot[bot] 66982f988b
chore(deps): Bump object_store from 0.5.5 to 0.5.6 (#7433)
Bumps [object_store](https://github.com/apache/arrow-rs) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG-old.md)
- [Commits](https://github.com/apache/arrow-rs/commits)

---
updated-dependencies:
- dependency-name: object_store
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dom <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-04 08:43:34 +00:00
Fraser Savage 3ad4cbe7a9
feat(router): Add grpc integration tests for namespace limit update
This adds additional testing coverage for updates to service protection
limits to a namespace, and how they affect subsequent writes that
exceed the limits.
2023-03-31 17:35:10 +01:00
Dom Dwyer d322791d12
refactor: tidy NamespaceName construction errors
There was a mix of different ways of returning errors - this commit
unifies them, adds some documentation to the returned errors, and
removes the capitalisation.

Errors should be lower-case so they compose nicely like this:
    "something failed: super important error: inner error"
rather than:
    "something failed: Super important error: Inner error"
2023-03-31 16:27:26 +02:00
Dom Dwyer d3bb75e1b5
perf(router): avoid cloning valid org/bucket value
Changes the org/bucket to NamespaceName calls to move the values into
the constructor, allowing it to reuse them if they do not require
encoding (the common case) instead of forcing them to be cloned to
obtain a 'static NamespaceName.
2023-03-31 16:14:33 +02:00
Dom Dwyer 65034cfaa6
refactor: org & bucket parser on NamespaceName
Moves the function org_and_bucket_to_namespace() to be an associated
method (constructor) on the NamespaceName itself.
2023-03-31 16:12:49 +02:00
dependabot[bot] 275dad704e
chore(deps): Bump futures from 0.3.27 to 0.3.28 (#7397)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.27 to 0.3.28.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.27...0.3.28)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-31 10:44:23 +00:00
Martin Hilton 052e190dd0
feat(service_grpc_flight): optional query authorization (#7351)
* feat(service_grpc_flight): optional query authorization

Add support for requiriing namespace-level authorization for
arrow flight based query requests. These are the flight SQL commands
as well as the IOx-specific SQL over flight and InfluxQL over flight
protocols.

Supports the optional configuration of an authorization sidecar,
in the same manner as is used in the router. If this is configured
then all arrow flight gRPC requests that are implemented will require
a valid authorization token to be supplied in the request. For a
multi-legged operation such as GetFlightInfo + DoGet required for
FlightSQL then a valid authorization is required for every request.

Ideally this support would be implemented using some sort of
interceptor, however the namespace isn't known until the request
processing has been started. The authorization check is performed
as soon as possible once the desired operation is known.

The legacy "storage" API has no authorization checks. Care should
be taken to ensure this API is never exposed to an untrusted network.

* chore(service_grpc_flight): review suggestions

Implement some suggestions from reviewers. The main change is adding
authorization checks to the handshake command.

* chore(service_grpc_flight): remove authorization of handshake

The Handshake call is used by existing clients to verify the
connection. These clients do not send a namespace header with the
request meaning there is nothing to authorize against. Remove this
authorization for now to avoid breaking existing clients.

* refactor: implement Authorizer trait on Option

Based on a suggestion from Dom implement the Authorizer trait on
Option<T: Authorizer> so that the call sites no longer need to check
if an authorizer is configured. This simplifies the code at the
call sites.

To maximise the utility the signature has changed so that a optional
token is now used. When no authorizer is configured this will not
be looked at. When a token is required a new error will be returned
if no token was supplied.

* fix: suggestions from clippy
2023-03-31 07:33:54 +00:00
dependabot[bot] 1ad0160d30
chore(deps): Bump serde_json from 1.0.94 to 1.0.95 (#7348)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.94 to 1.0.95.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.94...v1.0.95)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-28 11:09:59 +00:00
Carol (Nichols || Goulding) 621672b38f
test: Add an e2e test for write replication and fix it because it didn't work 😜 (#7344)
* test: Add an e2e test for write replication

* fix: Pass through rpc_write_replicas configuration to RpcWrite handler

---------

Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-28 09:31:16 +00:00
Dom Dwyer 874325d9ce
refactor(test): generic return iterator
This change allows the MockWriteClient to accept more input types and
internalises the box dyn bits; I got tired of writing "Box::new()"
everywhere.
2023-03-27 13:31:31 +02:00
Dom 6105fd5bb7
refactor: compute n_copies once
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2023-03-27 10:04:17 +01:00
Dom Dwyer 125fef388c
feat: MVP replication support
This commit implements replication for the router's RpcWrite handler.

The desired number of replica copies is specified at startup time, and
each user write will be fanned-out with the specified replication factor
(replicas + 1).

A failure to write to any upstreams returns the write error, but a
failure to obtain enough ACKs (enough successful writes) after at least
1 ACK will return a "partial write" error - this differentiation is
important, as the user's write will be readable after a partial write
error has occurred.

This currently writes to upstreams serially; this is clearly an
opportunity for improvement! A follow-on PR will parallelise writes
across the desired number of replicas while maintaining the "at most one
ack'd write to one host" invariant.

Note that replication is currently hard-coded as disabled.
2023-03-23 17:48:41 +01:00
Dom Dwyer e899dc70c0
feat: meaningful RPC write failure errors
Whenever an RPC write to an upstream ingester fails, it is retried after
an increasing delay, until the RPC_TIMEOUT is hit. Because of this, any
RPC write error would be returned as a "timeout", masking the underling
reason the write actually failed.

This commit pushes down the timeout logic, and retains the most recently
observed RPC write error, returning it to the user instead of the
timeout error.
2023-03-23 16:01:59 +01:00
Dom Dwyer e885eb9061
test(router): RPC error responses from RpcWrite
This PR changes the RpcWrite DmlHandler to facilitate testing using
mocked RPC client circuit breaker states, and assert the error response
for no healthy upstreams.
2023-03-23 16:01:58 +01:00
Dom Dwyer f3d96b6ed1
refactor(mock): iter for MockWriteClient returns
Instead of accepting a finite VecDeque of return values, allow the
MockWriteClient to take any dyn Iterator that yields the required
response type.
2023-03-23 16:01:57 +01:00
Dom Dwyer 68f948c70b
refactor: rename generic type parameter
Rename C -> T, to be consistent with the Balancer, and open up C for
consistent usage between the two.
2023-03-23 16:01:57 +01:00
Dom Dwyer 19021ec3f3
refactor: disallow empty UpstreamSnapshot
This simplifies the semantics of upstream RPC endpoint snapshots; an
empty snapshot will never be returned, and therefore if the caller has a
snapshot, it contains at least one endpoint to attempt an RPC call
against.

This moves the "no upstream" error handling from a write-time error, to
a pre-write error.
2023-03-23 11:31:20 +01:00
Dom Dwyer d4486bef3e
refactor: access upstream count in UpstreamSnapshot
Adds a method to return the number of upstreams in an UpstreamSnapshot.
2023-03-23 11:31:20 +01:00
Marko Mikulicic 6660b86f6c fix: Put authorization header in request extension 2023-03-22 04:12:07 +01:00
Fraser Savage 8e9d0e8e74
refactor(router): Leverage MissingNamespaceAction directly for TestContext
This minimises addition of unnecessary types.
2023-03-21 15:28:00 +00:00
Fraser Savage 22127453da
Merge branch 'main' into savage/router-test-context-builder-pattern 2023-03-21 13:28:06 +00:00
Fraser Savage bf35b951ad
refactor(router): Allow test contexts to specify namespace autocreate retention using a Duration 2023-03-21 11:13:55 +00:00
Fraser Savage 392972a3ad
refactor(router): Simplify builder code patterns
Use more fluent method names and leverage defaulting
to remove the need for an option on the namespace autocreate
policy.
2023-03-21 10:26:23 +00:00
Fraser Savage acdeee62e0
refactor(router): Remove unused catalog field on TestContextBuilder 2023-03-20 17:11:55 +00:00
Fraser Savage 1a2565b45a
refactor(router): Split TestContextBuilder namespace parameters
Most of the test cases set up a context with or without namespace
autocreation, while few set a retention period. This removes the
requirement to pass a retention period when enabling autocreation
or vice versa.
2023-03-20 17:04:14 +00:00
Fraser Savage 32a3c81ce9
refactor(router): Use builder pattern to construct TestContext
Using the builder pattern enables a more ergonomic workflow
for setting optional namespace creation semantics when constructing
the TestContext for the router.
2023-03-20 17:03:40 +00:00
Dom Dwyer 93ebb42fdd
refactor: stateful upstream iter for RPC balancer
Changes the router's RPC balancer to return a iterator of elements
starting from the given offset, that can remove elements from the
infinite/cycling iterator to prevent them from being yielded again.
2023-03-20 17:30:32 +01:00
Dom Dwyer f28ba2381d
test: assert all upstreams are (re)-tried
Adds a test ensuring requests are sent to all upstream ingesters until a
request succeeds.
2023-03-20 17:23:02 +01:00
Martin Hilton 13657d5bcc
feat(authz): authorization service client and write integration (#7216)
* feat(authz): add authorization client.

Add a new authz crate to provide the interface for making authorization
checks from within IOx. This includes the default client that uses
the influxdata.iox.authz.v1 gRPC protocol. This feature is not used
by any IOx component yet.

* feat: optional authorization on write path

Support optionally enabling authorization checks on the /api/v2/write
handler. If an authrorizer is configured then the handler will
attempt to retrieve a token from the request's Authorization header.
If no such token exists then a response with a 401 error code is
returned. If the token is not valid, or does not have write permission
for the requested namespace then a response with a 403 error is
returned.

* chore: add unit test for authz in write handler

Add unit tests that test the correct functioning of the /api/v2/write
handler when an Authorizer is configured.

* chore(authz): use lazy connection

Change the initialization of the authz client to use a lazy connection.
This allows the client to be initialised synchronously.

* chore: Run cargo hakari tasks

* fix(authz): protolint complaints

* fix: authz tests

* fix: benches and lint

* chore: Update clap_blocks/src/authz.rs

Co-authored-by: Marko Mikulicic <mkm@influxdata.com>

* chore: Update authz/src/lib.rs

Co-authored-by: Marko Mikulicic <mkm@influxdata.com>

* chore: Update clap_blocks/src/authz.rs

Co-authored-by: Marko Mikulicic <mkm@influxdata.com>

* chore: review suggestions

* chore: review suggestions

Apply a number of suggestions from review comments. The main
behavioural change is that if the authz service is configured
applictions will perform a probe request to ensure it can communicate
before continuing startup.

* chore: Update router/src/server/http.rs

Co-authored-by: Dom <dom@itsallbroken.com>

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Marko Mikulicic <mkm@influxdata.com>
Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-17 15:20:14 +00:00
Andrew Lamb 28cb56767c
fix: Rename crate `influxdb_line_protocol` to `influxdb-line-protocol` (#7244)
* fix: Rename crate `influxdb_line_protocol` to `influxdb-line-protocol`

* fix: hakari config

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-17 13:19:50 +00:00
Fraser Savage 78926490f9
docs: Update dml_handlers module docs (#7194)
Update the module diagram to reflect kafkaless
changes.

Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-13 13:28:29 +00:00
dependabot[bot] 3a9ca8879b
chore(deps): Bump futures from 0.3.26 to 0.3.27 (#7193)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.26 to 0.3.27.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.26...0.3.27)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-03-13 10:53:59 +00:00
dependabot[bot] 535f3d92a2
chore(deps): Bump serde_json from 1.0.93 to 1.0.94 (#7132)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.93...v1.0.94)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-06 12:12:23 +00:00
dependabot[bot] 3689827793
chore(deps): Bump paste from 1.0.11 to 1.0.12 (#7130)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.11...1.0.12)

---
updated-dependencies:
- dependency-name: paste
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-06 10:40:41 +00:00
dependabot[bot] 3256fcc72e
chore(deps): Bump object_store from 0.5.4 to 0.5.5
Bumps [object_store](https://github.com/apache/arrow-rs) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG-old.md)
- [Commits](https://github.com/apache/arrow-rs/compare/object_store_0.5.4...object_store_0.5.5)

---
updated-dependencies:
- dependency-name: object_store
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-03 02:00:51 +00:00
Dom 9ed7aa7257
Merge branch 'main' into dom/router-docs 2023-03-01 10:28:46 +00:00
dependabot[bot] 90ceb2c896
chore(deps): Bump crossbeam-utils from 0.8.14 to 0.8.15 (#7089)
Bumps [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) from 0.8.14 to 0.8.15.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.8.14...crossbeam-utils-0.8.15)

---
updated-dependencies:
- dependency-name: crossbeam-utils
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dom <dom@itsallbroken.com>
2023-03-01 10:16:09 +00:00
Dom Dwyer 32ce2564dc
refactor: consistent validator/validation
Use a consistent name for the retention validation (matching the schema
validation module).
2023-02-28 14:45:45 +01:00
Dom Dwyer f6c9f9b0e9
docs: update router diagram / overview docs
Updates the router documentation to reflect the "kafkaless"
implementation we'll use going forward.
2023-02-28 14:45:32 +01:00
Carol (Nichols || Goulding) faae5eb438 chore: Rerun cargo hakari manage-deps 2023-02-27 11:56:15 +01:00
dependabot[bot] aa7d458a81
chore(deps): Bump tokio-stream from 0.1.11 to 0.1.12 (#7035)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.11 to 0.1.12.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.11...tokio-stream-0.1.12)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dom <dom@itsallbroken.com>
2023-02-21 16:31:55 +00:00
Dom Dwyer 5ca165b76e
docs: fix two typos
Comments in test code.
2023-02-15 10:49:39 +01:00
Dom Dwyer 61fb92b85c
feat(router): soft-delete RPC handler
This implements the RPC "delete_namespace" handler, allowing a namespace
to be soft-deleted.

Adds unit coverage for all handlers & e2e test coverage for the new
handler (the rest were already covered).

The tests also highlight the caching issue documented here:

    https://github.com/influxdata/influxdb_iox/issues/6175
2023-02-15 10:49:38 +01:00
Dom Dwyer 4a0149a418
test(router): retention change after cache reset
Assert that the new retention period value is used once a router is
restarted and the cache converged.
2023-02-13 14:40:14 +01:00
Dom Dwyer ce12daa96e
refactor(e2e): simulate router restart
Allow a router to be "restarted" within an e2e test.
2023-02-13 14:40:11 +01:00
Carol (Nichols || Goulding) 0e10561ce0
fix: Port router unit tests to the RPC write path (#6956)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-13 12:28:06 +00:00
Dom Dwyer 2d46a364dc
feat: namespace soft-delete support
This commit adds initial support for "soft" namespace deletion, where
the actual records & data remain, but are no longer queryable /
writeable.

Soft deletion is eventually consistent - users can expect to continue
writing to and reading from a bucket after issuing a soft delete call,
until the various components either restart, or have their caches
flushed.

The components treat soft-deleted namespaces differently:

    * router: ignore soft deleted namespaces
    * ingester: accept soft deleted namespaces
    * compactor: accept soft deleted namespaces
    * querier: ignore soft deleted namespaces
    * various gRPC services: ignore soft deleted namespaces

This ensures that the ingester & compactor do not see rows "vanishing"
from the database, and continue to make forward progress.

Writes for the deleted namespace that are buffered in the ingester will
be persisted as normal, allowing us to support "un-delete" operations
where the system is restored to a the state at which the delete was
issued (rather than loosing the buffered data).

Follow-on work is required to ensure GC drops the orphaned parquet files
after the configured GC time, and optimisations such as not compacting
parquet from soft-deleted namespaces seems like a trivial win.
2023-02-13 12:01:35 +01:00
Andrew Lamb 779fb93ce7
refactor: move test builders out of compactor2 code (#6953)
* refactor: move test builders out of compactor2 code

* fix: docs
2023-02-10 18:28:09 +00:00
Dom Dwyer a85dcd745b
refactor(catalog): expose deleted_at on Namespace
Add the new catalog column to the Namespace representation/model.
2023-02-10 14:15:01 +01:00
dependabot[bot] 6327e3d9c0
chore(deps): Bump serde_json from 1.0.92 to 1.0.93 (#6918)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.92 to 1.0.93.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.92...v1.0.93)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-09 10:39:33 +00:00
dependabot[bot] 0ecde75af5
chore(deps): Bump object_store from 0.5.3 to 0.5.4 (#6900)
Bumps [object_store](https://github.com/apache/arrow-rs) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG-old.md)
- [Commits](https://github.com/apache/arrow-rs/compare/object_store_0.5.3...object_store_0.5.4)

---
updated-dependencies:
- dependency-name: object_store
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-08 09:40:11 +00:00
Dom Dwyer bf6ab7fd88
fix: error message typo
columns -> tables for table limit error.
2023-02-06 18:03:26 +01:00
Dom Dwyer 3f2eb54bce
test(router): catalog service limit errors
Assert the service limit error messages from the catalog.
2023-02-06 17:55:09 +01:00
Dom Dwyer 3881e11734
test(router): service limit error messages
Assert the user-facing service limit error messages.
2023-02-06 17:43:37 +01:00
Dom Dwyer 114bafe9a1
perf(router): cached table limit enforcement
Use the namespace schema cache in the router to enforce the
per-namespace table limit (service protection limit), adding O(1)
overhead to the existing column limit evaluation logic.

Prior to this commit, each request that would breach the table limit
would be (potentially partially) applied to the catalog and return an
error. Every subsequent request creating a new table continued to cause
a catalog query, unnecessarily adding load proportional to request
counts.

After this commit, catalog requests are sent when the router instance
can determine (to the best of it's ability, see below) that the request
will not cause the namespace to exceed the table limit.

Because this uses cached schemas, the actual state set of tables may
have changed - this will cause inconsistent enforcement and spurious
errors in the same way it currently does for the column limit. For more
details (and to track a resolution) see:

    https://github.com/influxdata/influxdb_iox/issues/5957
2023-02-06 17:43:26 +01:00
Dom Dwyer dfa4ab2585
perf(router): fast-path column limit for new table
When validating column limits for new tables, skip the column set
generation and union operations against the empty existing column set.
2023-02-06 17:33:56 +01:00
Dom Dwyer a633964f2b
feat(catalog): return max table limit in schema
The maximum number of tables is part of the Namespace, which is already
loaded in its entirety. This commit copies the value into the
NamespaceSchema, making it available for the router to utilise.
2023-02-06 17:33:55 +01:00
dependabot[bot] 6f4e287a3a
chore(deps): Bump serde_json from 1.0.91 to 1.0.92 (#6860)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.92.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.91...v1.0.92)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 08:27:41 +00:00
Carol (Nichols || Goulding) 30fea67701
fix: Move variables within format strings. Thanks clippy!
Changes made automatically using `cargo clippy --fix`.
2023-02-03 13:06:17 -05:00
Dom Dwyer 7f363b55df
test(router): e2e namespace retention coverage
Assert the correct handling of 0 and negative retention periods when
interacting with the namespace create & update gRPC handlers.
2023-02-01 11:49:53 +01:00
dependabot[bot] d0e6b16450
chore(deps): Bump bytes from 1.3.0 to 1.4.0
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 00:30:56 +00:00
dependabot[bot] 875b6a3e99
chore(deps): Bump futures from 0.3.25 to 0.3.26 (#6766)
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.25 to 0.3.26.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.25...0.3.26)

---
updated-dependencies:
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-31 11:33:50 +00:00
Dom Dwyer 0ddef54b09
fix(router): envoy network error translation
Envoy will connect to an endpoint on demand, and return an
application-level error if it fails with a gRPC status code of
"Unavailable".

It also embeds a metadata entry of {"server": "envoy"} - this commit
uses the two signals (error status code + metadata entry) to drive an
immediate reconnection when observed, assuming the connection is bad.
2023-01-30 12:15:38 +01:00
Dom Dwyer 353b1ad575
feat: configurable RPC write request timeout
Allows the user to configure the timeout used for a single RPC write
request, and changes the default to a more sensible value (30 -> 3
seconds).
2023-01-27 14:53:48 +01:00
Dom 5757674d5e
Merge branch 'main' into dom/service-limit-metric-labels 2023-01-27 10:04:56 +00:00
Dom Dwyer 8140313775
test: drive catalog in ns rejection test
Use the actual catalog resolver, not the mock to assert the correct
behaviour with a populated catalog.
2023-01-26 17:55:39 +01:00
Dom Dwyer 0aa5469ac6
test(e2e): explicit namespace creation
Adds an end-to-end test of the router's gRPC NamespaceService covering
creation and reading of new namespaces.
2023-01-26 17:32:12 +01:00
Dom Dwyer 7eaa8f59b0
fix: explicit namespace creation w/ existing ns
Prior to this commit, namespaces that had been created on one router
could not be used on another router until the latter was restarted.
Effectively, newly created namespaces couldn't be used.

After this commit, the catalog is also checked when a cache miss occurs,
ensuring the router discovers new, not-yet-cached namespaces.
2023-01-26 17:32:12 +01:00
Dom Dwyer 105e354299
refactor: clean up namespace errors
The namespace error was poorly refactored and duplicated the prefix
string. The "rejected" case is now also tested.
2023-01-26 17:32:11 +01:00
Dom Dwyer 1a7679bcee
refactor: expose underlying gRPC implementations
Changes the gRPC delegate to return the underlying service (type erased)
implementations instead of the RPC service wrappers.
2023-01-26 17:32:11 +01:00
Dom Dwyer ac8fa293cb
refactor(test): TestContext::write_lp() helper
Adds a helper method to construct the HTTP write request.
2023-01-26 17:32:10 +01:00
Dom Dwyer 6f1869f9dc
test(router): initialise gRPC delegate in e2e
Initialise the "rpc mode" gRPC handlers in the router e2e TestContext.
2023-01-26 17:32:10 +01:00
Dom Dwyer 3efc42baac
refactor(test): dedicated e2e TestContext module
Moves the router's TestContext to its own file/module.
2023-01-26 17:32:10 +01:00
Dom Dwyer c66f4a3d92
fix(router): restore NamespaceService
This was removed in the RPC variant of the router - no idea why, we
definitely should have it!
2023-01-26 15:10:22 +01:00
Dom Dwyer b6018e1c39
feat(metrics): separate service limit counters
Service limits are enforced on two values:

    * Number of tables in a namespace
    * Number of columns in a table

This commit labels the existing service limit hit metric with the type
of limit reached, and adds this information to the log lines emitted.
2023-01-26 14:48:33 +01:00
Dom f0d7ee59c3
Merge branch 'main' into dom/circuit-fuzz 2023-01-25 12:42:43 +00:00
Dom Dwyer 6eb1773ec0
perf(router): faster balancer node recovery
Ensure a "probe" node is always returned as the first candidate, driving
it to recovery faster.

This also includes a fix for the balancer metrics that would report
probe candidate nodes as healthy nodes.
2023-01-25 13:18:24 +01:00
Dom Dwyer f5d4171be0
test: CircuitBreaker recovery property fuzz test
Adds a multi-threaded fuzz test that ensures a circuit breaker can
always transition to the healthy state, regardless of the sequence of
events prior.
2023-01-25 11:53:57 +01:00
Luke Bond caea42665b
Merge branch 'main' into dom/rpc-endpoint-metrics 2023-01-25 10:44:18 +11:00
Dom 442e8a8b79
Merge branch 'main' into dom/ingester-rediscovery 2023-01-24 19:13:02 +00:00
Dom Dwyer 411f4bd08b
fix(router): force rediscovery of nodes
Similar to https://github.com/influxdata/influxdb_iox/pull/6509, this
forces a constant re-querying of the DNS address of an ingester to drive
rediscovery.

Unlike the above PR, this only reconnects when there are errors
observed. This still isn't ideal - something is wrong with the discovery
itself - this just papers over it.
2023-01-24 20:11:53 +01:00
Dom Dwyer 9132343dac
feat(metrics): export RPC upstream health state
Adds a metric with a per-ingester label recording the current health
state of the upstream ingester from the perspective of the router
instance.

Also logs periodically when one or more ingesters are offline.
2023-01-24 19:27:15 +01:00
Dom Dwyer f26b54beec
refactor(router): set sensible RPC timeouts
Copies these over from the client_util package.
2023-01-24 19:22:27 +01:00
Dom Dwyer 87b553fe9d
feat: WARN logs w/ endpoint for unhealthy upstream
Changes the DEBUG log event to a WARN now that it includes the endpoint
to which the event applies.
2023-01-24 19:19:31 +01:00
Dom Dwyer 085de40127
feat: lazy-connect to ingester gRPC endpoints
Lazily establish connections in the background, instead of using tonic's
connect_lazy().

connect_lazy() causes error handling to take a different path in tonic
compared to "normal" connections, and this stops reconnections from
being performed when the endpoint goes away (likely a bug).

It also means the first few write requests won't have to wait while the
connection is dialed, which brings down the P99 as a nice side-effect.
2023-01-24 16:44:55 +01:00
Dom Dwyer 8215f4126e
test: router balancer recovery
Ensure a recovering node is yielded from the balancer.
2023-01-24 15:30:01 +01:00
Dom Dwyer c6d6c50fbf
perf(router): circuit break ingester connections
Adds on-path health checking / recording using the CircuitBreaker
construct, stopping requests to unhealthy upstreams (minus the probe
requests) until they recover.

This removes the horrible gRPC balancer hack I added to get us deployed
ASAP, and should eliminate latency spikes and elevated error responses
observed during deployments as a result.
2023-01-24 15:30:01 +01:00
Dom Dwyer 107006c801
revert: influxdata/dom/rpc-balancer
This reverts commit a3805dbccf, reversing
changes made to bcb1232c5d.
2023-01-24 14:47:05 +01:00
Dom Dwyer b32662ebf2
test: router balancer recovery
Ensure a recovering node is yielded from the balancer.
2023-01-24 13:38:36 +01:00
Dom Dwyer 7596dc0826
perf(router): circuit break ingester connections
Adds on-path health checking / recording using the CircuitBreaker
construct, stopping requests to unhealthy upstreams (minus the probe
requests) until they recover.

This removes the horrible gRPC balancer hack I added to get us deployed
ASAP, and should eliminate latency spikes and elevated error responses
observed during deployments as a result.
2023-01-24 12:38:27 +01:00
Dom Dwyer c3a2ac3a0d
refactor: prevent div by 0
Preserve the error ratio calculation but prevent a div by 0 by ensuring
the divisor is always at least 1.
2023-01-24 12:09:00 +01:00
Dom Dwyer c4b04a16c5
refactor: rename last_probe instant
last_probe was "the instant at which the last set of probes started
being sent" in my head, but Carol saw it as "first_probe - the time at
which probes started being sent".

Hopefully probe_window_started_at is less ambiguous.
2023-01-24 12:08:10 +01:00
Dom Dwyer 2f3fb48091
docs: document error count floor
Describe the floor on the number of errors that must be observed before
the circuit breaker will consider switching to the unhealthy state.
2023-01-24 12:08:09 +01:00
Carol (Nichols || Goulding) caf8dc9032
fix: Rename incorrect usage of 'close' to 'unhealthy' in test helper 2023-01-23 16:08:00 -05:00
Carol (Nichols || Goulding) 081b4f15da
docs: Clarify my understanding of the circuit breaker based on chat with Dom 2023-01-23 16:07:02 -05:00
Dom Dwyer 67b73d90dd
feat: low-overhead circuit breaker
Implements a "circuit breaker", a construct that tracks the error &
success of requests to a remote node, and uses this information to allow
or deny further requests.

This circuit breaker stops sending requests to the remote when the error
count exceeds 80% of requests in a 5 second window. Once this happens,
up to 10 "probe" requests per second are allowed, and when they succeed,
normal operation resumes (though concurrent requests may still be
completing during the probe regime and are counted towards the probe
results).

In the happy path, this circuit breaker is very cheap (lock free; WFPO)
to evaluate and record request results in, minimising the throughput
penalty. Once the breaker enters an unhealthy state (hopefully a rare
occurrence) it uses a mutex to manage the probe state (with a higher
overhead) for simplicity; it's definitely possible to optimise this away
if high latencies are observed during upstream outages when the circuit
breaker is open/unhealthy.
2023-01-23 13:55:12 +01:00
Dom Dwyer 6ef68513d9
fix: gRPC balancer shutdown panic
The gRPC node discovery hack spawns a task that outlives the gRPC
balancer - once the balancer stops, the task should stop too (and not
panic sending on the closed channel).
2023-01-11 16:42:39 +01:00
Dom Dwyer 9ab86fa154
fix(router2): drive ingester node (re)-discovery
The tonic / tower load-balance implementation discards failed nodes,
even when using a static list - this causes nodes that fail once to
never be retried.

This doesn't happen for the last node for some reason, and leads to all
the load from one router hitting a single ingester instead of load
balancing across all ingesters.

This commit adds a hack to constantly tell the load balancer to probe
all nodes, hopefully causing them to re-discover previously failed
nodes. I don't have the time to do this properly :(
2023-01-05 14:06:29 +01:00
Dom Dwyer a5a26f5efb
fix(router2): lazily connect to ingesters
Allow the routers to start up without requiring full availability of all
downstream ingesters. Previously a single unavailable ingester prevented
the routers from starting up.

This has downsides:

  * Lazily initialising a connection will cause the first writes to have
    higher latency as the connection is established.
  * The routers MAY come up in a state that will never work (i.e. bad
    ingester addresses)
  * Using the opaque gRPC load balancing mechanism restricts the
    visibility into which nodes are up/down (hindering useful log
    messages) and prevents us from implementing more advanced circuit
    breaking / probing logic / load-balancing strategies.

This change is a quick fix - it leaves the round-robin handler in place,
load-balancing over a single tonic Channel, which internally
load-balances. This will need cleaning up.
2023-01-05 11:25:35 +01:00
dependabot[bot] 8478d41bcb
chore(deps): Bump paste from 1.0.10 to 1.0.11 (#6430)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.10 to 1.0.11.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.10...1.0.11)

---
updated-dependencies:
- dependency-name: paste
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-19 10:31:05 +00:00
dependabot[bot] 7f2aa8b10c
chore(deps): Bump serde_json from 1.0.89 to 1.0.91
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.89 to 1.0.91.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.89...v1.0.91)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-19 01:44:18 +00:00
dependabot[bot] e108a8b6c9
chore(deps): Bump paste from 1.0.9 to 1.0.10 (#6384)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.9 to 1.0.10.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.9...1.0.10)

---
updated-dependencies:
- dependency-name: paste
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 06:03:05 +00:00
Luke Bond 551bb0ef6a
feat: allow enabling/disabling ns autocreation in router (#6346)
* feat: allow enabling/disabling ns autocreation in router

* fix: missed an import for something behind router2 compile flag
2022-12-07 16:12:00 +00:00
dependabot[bot] 1d38d400f0
chore(deps): Bump object_store from 0.5.1 to 0.5.2 (#6339)
* chore(deps): Bump object_store from 0.5.1 to 0.5.2

Bumps [object_store](https://github.com/apache/arrow-rs) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG-old.md)
- [Commits](https://github.com/apache/arrow-rs/compare/object_store_0.5.1...object_store_0.5.2)

---
updated-dependencies:
- dependency-name: object_store
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Run cargo hakari tasks

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-06 07:53:54 +00:00
Carol (Nichols || Goulding) a51848b361
fix: Use client_util GrpcConnection instead of tonic Channel (#6320)
* fix: Use client_util GrpcConnection instead of tonic Channel

* refactor: include server addr in error

Co-authored-by: Dom <dom@itsallbroken.com>
2022-12-02 15:57:42 +00:00
Carol (Nichols || Goulding) c008219692
feat: Add a feature flag to switch to the router RPC write path (#6247)
* feat: Add a feature flag to switch to the router RPC write path

Fixes #6242.

* refactor: Remove a weird arc clone/rename that's not needed

I'm sure this was needed at some point, but it doesn't make much sense.
I wasn't going to change this, but I'm now trying to minimize the
differences between this function and the write path init function, so
make this one better too.

* fix: Add the namespace autocreation to the RPC write path too

The topic/query pool don't really apply to this case, but use them
anyway to be able to use the existing catalog methods.

Also add a bunch of comments pointing out where the RPC write path
initializer and the old router's initializer are the same and where
they're different, so that perhaps it'll be easier to keep them in sync
while they both exist.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 11:05:39 +00:00
Luke Bond d07658282c
feat: add router config parameter for retention (#6278)
* chore: remove unused/moved ns_autocreation dml handler

* feat(router): expose new ns retention as config

* fix: forgot to set default value for router retention arg

* chore: make new namespace retention param an option
2022-11-30 13:14:39 +00:00
dependabot[bot] caa595a6fc
chore(deps): Bump serde_json from 1.0.88 to 1.0.89 (#6203)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.88 to 1.0.89.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.88...v1.0.89)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-22 09:28:31 +00:00
dependabot[bot] 04c00bbb62
chore(deps): Bump bytes from 1.2.1 to 1.3.0 (#6199)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/commits)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-22 08:23:24 +00:00
dependabot[bot] 52c50c16e1
chore(deps): Bump serde_json from 1.0.87 to 1.0.88
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.87 to 1.0.88.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.87...v1.0.88)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 01:52:18 +00:00
Dom Dwyer af78f0d5db
refactor: remove names from DML init
Fixes conflicts introduced by #6170.
2022-11-18 17:16:33 +01:00
Dom Dwyer 72939f8bf0
feat(router): handler for direct write to ingester
This commit adds the (unused) RpcWrite implementation of the DmlHandler
trait that implements pushing a write over gRPC to a single, arbitrary
ingester. Requests are round-robin'ed across all available ingesters.

This DmlHandler implementation can be swapped out with the
ShardedWriteBuffer to change how writes are propagated to the ingester.
2022-11-18 17:08:20 +01:00
Carol (Nichols || Goulding) 02c3083192
fix: Remove table names from Dml operations 2022-11-18 10:40:38 -05:00
Carol (Nichols || Goulding) a225b81e59
docs: Clarify and make consistent schema validation type comments 2022-11-18 10:39:27 -05:00
Nga Tran 49a9565240
feat: gRPC that creates namespace (#6103)
* feat: create namespace API call in router

Co-authored-by: Nga Tran <nga-tran@live.com>

* chore: treat retention as ns except in CLI

* fix: overflow in nanosecond calc

* fix: retention test after changing it from hours to ns

* chore: comment clarification in cli; better response type for error in ns API

* fix: correct some rebase mistakes

* chore: merge namespace create & create_with_retention; renamed ns create test helper fn & const

* fix: ns autocreation test was wrong after rebase

* fix: mem catalog has default 1hr retention, accidently removed in rebase

* chore: remove mem catalogs default 1hr retention; make it settable in sets & router

Co-authored-by: Luke Bond <luke.n.bond@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-18 13:02:12 +00:00
Nga Tran 6f7b1e2e26
feat: reject writes that are outside the retention period (#6148)
* feat: reject writes that are outside the retention period

* feat: add retention validator into handler stack

* chore: Apply suggestions from code review

Co-authored-by: Dom <dom@itsallbroken.com>

* refactor: address review comments

* test: unit tests fot retention validation

* chore: address review comments

* test: more unit tests and integration tests

* refactor: make time inside retention period for emphemeral_mode test

* fix: 2 hours

Co-authored-by: Dom <dom@itsallbroken.com>
2022-11-17 20:55:58 +00:00
Dom cd33f25d8a
Merge branch 'main' into dom/correct-comment 2022-11-16 15:42:47 +00:00
Luke Bond 9365d933f1
chore: router namespace api (#6151)
* chore: move ns api from querier to router

* chore: add explanatory comment in querier about moved namespace API

* fix: add namespace service to router

* fix: querier returns unimplemented error for ns retention, not panic

* chore: reuse namespace -> proto in router ns api

* chore: grpc namespace - consume ns to avoid clone

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-16 15:25:49 +00:00
Dom Dwyer 8c38911e8c
docs: remove redundant comment
This comment remains by mistake - table_ids is now used.
2022-11-16 14:40:53 +01:00
Carol (Nichols || Goulding) 3943faf998
fix: Remove namespace from DmlWrite and DmlDelete constructors 2022-11-14 16:46:04 -05:00
Carol (Nichols || Goulding) f78195f7c7
fix: Remove namespace name field from DmlWrite and DmlDelete
But leave the argument in their constructors for now.

Not all numbers in tests can be 42, Dom.
2022-11-14 16:46:04 -05:00
dependabot[bot] a969754819
chore(deps): Bump chrono from 0.4.22 to 0.4.23 (#6129)
* chore(deps): Bump chrono from 0.4.22 to 0.4.23

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.22 to 0.4.23.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.22...v0.4.23)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: chrono future compat

Integer->timstamp conversions should not silently panic.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-14 13:34:09 +00:00
kodiakhq[bot] 05d7d1495e
Merge branch 'main' into dependabot/cargo/hashbrown-0.13.1 2022-11-11 21:26:40 +00:00
Carol (Nichols || Goulding) d965004e52
fix: Rename DmlError::DatabaseNotFound to NamespaceNotFound 2022-11-11 15:46:05 -05:00
Carol (Nichols || Goulding) bdff4e8848
fix: Consistently use 'namespace' instead of 'database' in comments and other internal text 2022-11-11 15:46:04 -05:00
Nga Tran a3f2fe489c
refactor: remove retention_duration field from namespace catalog table (#6124) 2022-11-11 20:30:42 +00:00
Jake Goulding cc17e5a54b refactor: use a workspace dependency for hashbrown 2022-11-11 13:25:39 -05:00