Commit Graph

36 Commits (d56217a8f64a61cdaf56200bfbe847789dda0268)

Author SHA1 Message Date
Carol (Nichols || Goulding) c32a04388c
feat: Wrap max tables and max columns per table values in newtypes 2023-09-15 13:09:36 -04:00
Carol (Nichols || Goulding) b63290daf4
fix: Remove a redundant function
This function is largely duplicated with namespace_to_proto, and the
other responses in this file don't make helper functions for
constructing the response type, so make Create more similar to the other
actions.
2023-09-15 13:09:36 -04:00
Carol (Nichols || Goulding) f6c7fb4403
refactor: Reuse protobuf conversion functions for tests
So that we can use PartialEq rather than comparing each field
individually.

Also take a reference to a namespace; this function doesn't need
ownership.
2023-09-15 13:09:35 -04:00
Fraser Savage e602f067ad
feat(namespace): Return namespace custom partition templates to API
This exposes the custom partitionining scheme of a namespace (if any)
in the response to namespace create and list calls.
2023-08-30 15:53:43 +01:00
dependabot[bot] e33a078128
chore(deps): Bump paste from 1.0.13 to 1.0.14 (#8244)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.13...1.0.14)

---
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-07-17 16:10:02 +00:00
dependabot[bot] 9a03d9c9fe
chore(deps): Bump paste from 1.0.12 to 1.0.13 (#8139)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.12 to 1.0.13.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.12...1.0.13)

---
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-07-04 07:57:41 +00:00
Marko Mikulicic d26ad8e079
feat: Allow passing service protection limits in create db gRPC call (#7941)
* feat: Allow passing service protection limits in create db gRPC call

* fix: Move the impl into the catalog namespace trait

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-08 14:28:32 +00:00
Carol (Nichols || Goulding) d0db1194e2
feat: Validate custom partition templates on their creation
Make sure custom partition templates have:

- At least one part
- No more than 8 parts
- Only nonempty, valid strftime formats
2023-06-07 11:38:12 -04:00
Carol (Nichols || Goulding) ac26ceef91
feat: Make a place to do partition template validation
- Create data_types::partition_template::ValidationError
- Make creation of NamespacePartitionTemplateOverride and
  TablePartitionTemplateOverride fallible
- Move SerializationWrapper into a module to make its inner field
  private to force creation through one fallible constructor; this is
  where the validation logic will go to be shared among all uses of
  partition templates
2023-06-07 11:38:12 -04:00
Dom Dwyer 9e0570f2bf
refactor: explicit submod for partition_template
Move the import into the submodule itself, rather than re-exporting it
at the crate level.

This will make it possible to link to the specific module/logic.
2023-05-30 15:13:20 +02:00
Carol (Nichols || Goulding) c3117e7eb8
fix: Return 'already exists' errors from namespace and table gRPC APIs
When appropriate, rather than internal errors.
2023-05-25 13:19:33 -04:00
Carol (Nichols || Goulding) afb3838437
feat: Optionally supply the namespace partition template when creating a namespace 2023-05-24 10:10:34 -04:00
Carol (Nichols || Goulding) 6f92bccc99
feat: Use protobuf for PartitionTemplate in CreateNamespace gRPC API
The service implementation doesn't use this field yet.
2023-05-24 10:10:34 -04:00
Dom Dwyer 928a4d163e
build: remove unused dependencies from crates
This commit fixes loads of crates (47!) had unused dependencies, or
mis-configured dependencies (test deps as normal deps).

I added the "unused_crate_dependencies" to all crates to help prevent
this mess from growing again!

    https://doc.rust-lang.org/beta/nightly-rustc/rustc_lint_defs/builtin/static.UNUSED_CRATE_DEPENDENCIES.html

This has the minor downside of false-positives when specifying
dev-dependencies for test/bench binaries - these are files in /test or
/benches (not normal tests). This commit includes a workaround,
importing them in lib.rs (gated by a feature flag). I think the
trade-off of better dependency management is worth it!
2023-05-23 14:55:43 +02:00
Dom Dwyer 9696b75476
ci: add missing lints to service_grpc_namespace
This crate was missing some of the common lints we use everywhere else.
2023-05-23 14:55:42 +02:00
Carol (Nichols || Goulding) b0959667d5
fix: Move topic and query pool within iox catalog (#7734)
Still insert them into the database and associate them with namespaces,
but don't ever query them back out.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-05-04 13:45:56 +00:00
wiedld daabe9663c chore(idpe-17434): make restrictive whitelist of chars accepted, for any NamespaceName 2023-04-21 16:36:00 -07:00
Dom Dwyer c4a802cea8
fix: apply namespace name validation on create
Prior to this commit, the gRPC NamespaceService would allow namespaces
to be created with invalid names due to a missing call to NamespaceName
that performs validation.
2023-04-18 14:50:51 +02:00
Dom Dwyer 54d4ca8729
test: invalid namespace name creation
Adds tests that attempt to create namespaces via the gRPC
NamespaceService with a variety of invalid names.

NOTE: this test currently fails!
2023-04-18 14:48:44 +02: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
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
Fraser Savage 134967cddb
feat(namespace): Enable update of service protection limits over gRPC
This adds a message type to encapsulate service protection limits
for a namespace, an RPC to update any single limit and exposes
the limits on a namespace as part of the pre-existing Namespace message.
2023-03-31 17:14:19 +01:00
Carol (Nichols || Goulding) faae5eb438 chore: Rerun cargo hakari manage-deps 2023-02-27 11:56:15 +01:00
Dom Dwyer 5ca165b76e
docs: fix two typos
Comments in test code.
2023-02-15 10:49:39 +01:00
Dom Dwyer dbe9219a8b
test: assert correct retention period
Use the correct constant in the retention period assert.
2023-02-15 10:49:38 +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 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
Dom Dwyer ec5b35e3cc
fix: reject negative retention periods
Do not allow a negative retention period to be specified.
2023-02-01 11:29:56 +01:00
Dom Dwyer bf6ae3dc4d
fix: map retention period 0 values to NULL
Treat a retention period of 0 as "infinite", and not "none".
2023-02-01 11:29:13 +01:00
Dom Dwyer 363ce1629c
refactor: log namespace RPC actions
Adds info logs for namespace CRUD actions.
2023-01-31 14:36:15 +01:00
Dom Dwyer c70ccee4a1
fix: disable namespace delete gRPC endpoint
Do not allow this endpoint to be called - the logic is incorrect.
2023-01-31 14:34:44 +01:00
Andrew Lamb e8e50df692
chore: Enable last SQL test, retention.sql (#6721) 2023-01-31 12:46:50 +00:00
Luke Bond 3c5b44cf70 chore: call delete ns from grpc handler 2022-12-16 10:23:50 +00:00
Luke Bond 3659be59c7 feat: delete namespace api mem impl
chore: tests for delete namespace; use unique ptn names in tests
2022-12-16 10:23:50 +00: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
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