Commit Graph

9866 Commits (651b7a1ce64df19c730e1fd721a1dcf4ecf618cf)

Author SHA1 Message Date
Carol (Nichols || Goulding) 51afe53d23
fix: Rename database to namespace in service_grpc_flight types, vars, and errors 2022-11-11 16:14:13 -05:00
Carol (Nichols || Goulding) 042bf545fe
fix: Rename database types/vars to namespace in the storage command code 2022-11-11 16:14:12 -05:00
Carol (Nichols || Goulding) 3dde82b3b9
fix: Rename QueryDatabaseProvider to QueryNamespaceProvider 2022-11-11 16:14:12 -05:00
Carol (Nichols || Goulding) 0657ad9600
fix: Rename QueryDatabase to QueryNamespace 2022-11-11 16:14:12 -05:00
Carol (Nichols || Goulding) 621560a0dc
fix: Rename QueryDatabaseMeta to QueryNamespaceMeta 2022-11-11 16:14:12 -05: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
CircleCI[bot] 55f880a498 chore: Run cargo hakari tasks 2022-11-11 18:47:12 +00:00
Jake Goulding 6ca2915d9b fix: missing ahash lockfile entry 2022-11-11 13:27:05 -05:00
Marco Neumann 746032af0f fix: compatibility after hashbrown upgrade
- Some methods need explicit types
- `hashbrown::HashMap` now takes 32 bytes, not 64
2022-11-11 13:25:39 -05:00
Jake Goulding cc17e5a54b refactor: use a workspace dependency for hashbrown 2022-11-11 13:25:39 -05:00
dependabot[bot] 5024523f00 chore(deps): Bump hashbrown from 0.12.3 to 0.13.1
Bumps [hashbrown](https://github.com/rust-lang/hashbrown) from 0.12.3 to 0.13.1.
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.12.3...v0.13.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 13:24:56 -05:00
Dom 1b322a6a6e
Merge pull request #6121 from influxdata/dom/deferred-namespace-name
perf(ingester): deferred namespace name discovery
2022-11-11 17:45:31 +00:00
Dom 2e7a1391f8
Merge branch 'main' into dom/deferred-namespace-name 2022-11-11 17:39:10 +00:00
Dom Dwyer 0f6470c390
refactor: use correct description for retries
Use the correct description for namespace query retries.
2022-11-11 18:38:30 +01:00
Dom Dwyer 1e5d3f31af
docs: clearer code comments / docs
Remove redundant comments & clarify returns.
2022-11-11 18:38:29 +01:00
Dom 18c86ca44f
refactor: named unused return
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2022-11-11 17:32:42 +00:00
Nga Tran ea2559a640
chore: update SQL syntax after adding the new column to_delete into table partition (#6123) 2022-11-11 16:21:45 +00:00
Nga Tran 9c4266c503
refactor: first step to remove unused retention_duration (#6113)
* refactor: first step to remove unused retention_duration

* refactor: remove retenion_duration from update catalog

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-11 15:21:06 +00:00
Dom Dwyer 2521aedb6a
perf(ingester): address namespaces by ID only
Removes reliance on string name identifiers for namespaces in the
ingester buffer tree, reducing the memory usage of the namespace index
and associated overhead.

The namespace name is required (though unused by IOx) in the IoxMetadata
embedded within a parquet file, and therefore the name is necessary at
persist time. For this reason, a DeferredLoad is used to query the
catalog (by ID) for the name, at some uniformly random duration of time
after initialisation of the NamespaceData, up to a maximum of 1 minute
later. This ensures the query remains off the hot ingest path, and the
jitter prevents spikes in catalog load during replay/ingester startup.

As an additional / easy optimisation, the persist code causes a
pre-fetch of the name in the background while compacting, hiding the
query latency should it not have already been resolved.

In order to keep the the ingester buffer & catalog decoupled / easily
testable, this commit uses a provider/factory trait
NamespaceNameProvider and corresponding implementation
(NamespaceNameResolver) in a similar fashion to the PartitionResolver,
allowing easy mocking for tests, and composition for prod code, allowing
future optimisations such as pre-fetching / caching the "hot" namespace
names at startup.

Internal string identifier removal is a pre-requisite for removing
string identifiers from the write wire format (#4880).
2022-11-11 14:37:21 +01:00
Dom Dwyer 611acc1ad2
refactor: plumb in DeferredLoad<NamespaceName>
Changes the ingester's buffer tree to use the deferred loading primitive
to resolve the namespace name for NamespaceData.

Note that the loader is initialised with the name in the first place -
this commit just introduces the use of the deferred loading primitive,
and doesn't change where the name is sourced from.
2022-11-11 14:37:20 +01:00
Dom Dwyer 3adc66a4b2
feat: Display impl for DeferredLoad
This lets deferred loads be used in place of a non-differed T, such as
log context fields.

If the value has not been resolved, the display impl returns
"<unresolved>".
2022-11-11 14:37:19 +01:00
Dom Dwyer 76ed1afb01
perf(ingester): support prefetch deferred loads
Allow a caller to signal to the DeferredLoad that the value it may or
may not have to materialise will be used imminently, optimistically
hiding the latency of resolving the value (typically a catalog query).
2022-11-11 14:37:18 +01:00
Dom e60b3191c8
Merge pull request #6120 from influxdata/dom/remove-redundant
refactor: remove redundant shard data init
2022-11-11 13:01:36 +00:00
Dom Dwyer d1cfa9d08b
refactor: remove redundant shard data init
Removes confusingly unused shard data initialisation.
2022-11-11 13:27:15 +01:00
Marco Neumann 7b83d6ec64
fix: traverse some more DataFusion error to extract tonic error (#6118)
See https://github.com/apache/arrow-datafusion/issues/4172 .
2022-11-11 12:24:47 +00:00
Marco Neumann 5398a1b986
chore: update blake2 because version 0.10.4 was yanked (#6119) 2022-11-11 11:36:11 +00:00
dependabot[bot] 358bdf6316
chore(deps): Bump ahash from 0.8.1 to 0.8.2 (#6115)
Bumps [ahash](https://github.com/tkaitchuck/ahash) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.8.1...v0.8.2)

---
updated-dependencies:
- dependency-name: ahash
  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-11-11 10:47:00 +00:00
Dom 02be6ba7e4
refactor: generic deferred loader helper (#6095)
* refactor: generic deferred loader helper

Splits the DeferredSortKey loader introduced in #5807 into two parts - a
generic helper type that implements deferred/background loading of
values, and SortKey specific logic for use with it.

As this will be more widley used, this implementation features improved
behaviour of the deferred loader under concurrent demand requests
(multiple calls to get() do not attempt to concurrently resolve the
value), as well as complete cancellation safety (cancelling the get()
doesn't affect the liveness of the background task).

* docs: doc-link & minor comment amendments

Fixes naming, adds missing doc-links, and expands some code comments.

* test: bound wait times to avoid hangs

Adds timeouts to all .await of the code under test, ensuring tests don't
hang if something goes wrong.
2022-11-10 19:16:51 +00:00
Nga Tran 93e11d4c91
chore: Revert "feat: flag partitions for delete (#6075)" (#6111)
This reverts commit 77a2541172.
2022-11-10 17:01:39 +00:00
Nga Tran e9c8f40af2
chore: Revert "feat: call soft delete partitions from garbage collector (#6090)" (#6110)
This reverts commit 9fe7a50129.
2022-11-10 16:15:13 +00:00
Nga Tran e81ff1f4d5
chore: Revert "feat: catalog delete old partitions (#6099)" (#6109)
This reverts commit 664b0578e9.
2022-11-10 15:31:16 +00:00
Andrew Lamb 694443bb87
chore: Rename DatabaseName to NamespaceName (#6100)
* chore: Rename DatabaseName to NamespaceName

* fix: fmt

* chore: Updates some more references

* chore: more cleanup

* fix: adjust test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-10 14:13:59 +00:00
Andrew Lamb 6c17ee29a5
feat: make logging clearer when parquet files upload is retried (#6056)
* feat: log success when parquet files are retried

* fix: Update parquet_file/src/storage.rs

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

* fix: fmt

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-10 11:59:54 +00:00
Luke Bond 664b0578e9
feat: catalog delete old partitions (#6099)
* feat: catalog delete old partitions

* chore: remove debug println

* chore: remove debug println

* chore: clippy

* chore: sql statement refactor for deleting partitions

* chore: improve delete partition test

* chore: clippy
2022-11-10 10:51:22 +00:00
Marco Neumann 5f7a6e696f
refactor: chunk InfluxRPC `ReadResponses` (#6094)
Currently we see some prod panics:

```
'assertion failed: len <= std::u32::MAX as usize', tonic/src/codec/encode.rs:127:5
```

This is due to an upstream bug in tonic:
https://github.com/hyperium/tonic/issues/1141

However the fix will only turn this into an error instead of panicking.
We should instead NOT return such overlarge results, esp. because
InfluxRPC supports streaming.

While we currently don't perform streaming conversion (like streaming
the data out of the query stack into the gRPC layer), the 4GB size limit
can easily be triggered (in prod) w/ enough RAM. So let's re-chunk our
in-memory responses so that they stream nicely to the client.

We may later implement proper streaming conversion, see #4445 and #503.
2022-11-10 08:13:22 +00:00
Andrew Lamb 07c25335cf
chore: delete dead code `PartitionAddr` (#6101) 2022-11-09 21:31:14 +00:00
kodiakhq[bot] fc41013e6b
Merge pull request #6074 from influxdata/cn/upgrade-rust
chore: Upgrade to Rust 1.65
2022-11-09 16:01:04 +00:00
Carol (Nichols || Goulding) dd013c5402
fix: Update the expected size in a test
I tracked down the source of the size difference to the difference in
`mem::size_of::<mutable_batch::column::ColumnData>`. I believe this enum
is now able to take advantage of this niche-filling optimization:

<https://github.com/rust-lang/rust/pull/94075/>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) abcbe19966
fix: Box some Error type fields to make the Error types small
As found by this new Clippy lint:

<https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) f33e367904
fix: Use is_none instead of == None, thanks Clippy!
Again seems kinda niche and not a huge deal, but apparently this doesn't
rely on `T: PartialEq` so probably good?

<https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 4ab506dbd4
fix: Collapse consecutive replace calls that can be one
Well this is rather niche but it seems good!

<https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 43687a86d2
fix: Remove lots of needless borrows that Clippy can now identify
Except for in generated code that we don't control.
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) fa46951524
fix: Remove needless deref done by auto deref, thanks Clippy! 2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 5d9d1d9ee5
fix: Allow using an if to turn a boolean into 1 or 0
I'm not sure I agree with this clippy lint; I think the `if` is much
clearer

<https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 07505c8f72
fix: Remove needless borrows, thanks Clippy! 2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) a3bee0c303
chore: Upgrade to Rust 1.65 2022-11-09 10:29:13 -05:00
Nga Tran 9fe7a50129
feat: call soft delete partitions from garbage collector (#6090) 2022-11-09 14:48:26 +00:00
Nga Tran 77a2541172
feat: flag partitions for delete (#6075)
* feat: flag partition for delete

* fix: compare the right date and time

* chore: Run cargo hakari tasks

* chore: cleanup

* fix: typos

* chore: rust style tidy ups in catalog

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Luke Bond <luke.n.bond@gmail.com>
2022-11-09 12:06:23 +00:00