Commit Graph

13 Commits (65ba208f88bec8d8b4addb2163c366b1d829ae72)

Author SHA1 Message Date
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