Commit Graph

49389 Commits (praveen/ring-buffer-optimizations)

Author SHA1 Message Date
Dom 500112bd47
Merge branch 'main' into dependabot/cargo/clap-4.4.4 2023-09-19 10:28:35 +01:00
Marco Neumann 949635b324
feat: use time-based column ranges in querier (#8732)
Use output of #8725 within the column ranges of the querier. Currently
this won't have any effect since the column ranges are only used to
prune parquet files and parquet files come with their own, more precise
time range (and that information has priority). However for #8705 we
want to use it to prune partitions before needing to deal with the
parquet files.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-19 09:13:50 +00:00
Dom 18c45d39bb
Merge branch 'main' into dependabot/cargo/clap-4.4.4 2023-09-19 10:12:09 +01:00
Dom 41856be312
Merge pull request #8753 from influxdata/dom/merkle-protocol
feat(gossip): schema cache anti-entropy service
2023-09-19 10:07:36 +01:00
Dom 43e7094a06
Merge branch 'main' into dom/merkle-protocol 2023-09-19 09:49:26 +01:00
Dom Dwyer ef1a7b0ce8
docs: lexicographical ordering of min/max
The min/max values are the minimum/maximum values when ordered
lexicographically.
2023-09-19 10:45:32 +02:00
Joe-Blount 80f8b55baa
fix(compactor): retry OOM error at reduced concurrency (#8763)
* fix(compactor): retry OOM error at reduced concurrency

* chore: address comment
2023-09-18 20:01:08 +00:00
dependabot[bot] 38ea9a6cc8
chore(deps): Bump clap from 4.4.3 to 4.4.4
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.3 to 4.4.4.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.3...v4.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 18:15:43 +00:00
Andrew Lamb 58d892fcdf
chore: Update DataFusion pin (#8749)
* chore: Update DataFusion pin and `chrono`

* chore: Update for deprecation

* chore: Update plans

* fix: fix update logic in percentile

* chore: update to avoid deprecated from_exprs api

* fix: Update arrow pin, fix plan errors

* test: for describe

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-18 18:11:23 +00:00
Dom 5e3e2f087e
Merge pull request #8734 from influxdata/dom/limit-active-partitions
feat(ingester): limit non-empty partitions per namespace
2023-09-18 15:14:52 +01:00
Fraser Savage 55f089beca
refactor(ingester): Use single match for error handling on WAL file replay results 2023-09-18 15:09:47 +01:00
Dom f9225d34df
Merge branch 'main' into dom/limit-active-partitions 2023-09-18 14:53:39 +01:00
Fraser Savage 35e14c315f
test(ingester): Use `assert_counter` in WAL replay tests 2023-09-18 14:35:48 +01:00
Marco Neumann 0bf1000fe9
feat: error "ignore" layer for i->q V2 client (#8754)
We shall ignore certain error cases during query processing. This layer
provides an easy interface for that.

Note that this is also done in the V1 client, just in a more hidden /
hard-to-test manner.

For #8349.
2023-09-18 13:31:23 +00:00
Fraser Savage b179076011
refactor(ingester): Use separate attribute for ingester WAL replay failure reason
By separating the failure reason from the result of the WAL file replay
metric, it keeps flexibility to include other failure modes in future.
2023-09-18 14:11:26 +01:00
Fraser Savage 2546fbb796
docs(ingester): Document the meaning of the `SequenceNumber` returned for a WAL replay read error 2023-09-18 14:03:56 +01:00
dependabot[bot] 1760fe7736
chore(deps): Bump chrono from 0.4.30 to 0.4.31 (#8752)
* chore(deps): Bump chrono from 0.4.30 to 0.4.31

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.30 to 0.4.31.
- [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.30...v0.4.31)

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

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

* fix: chrono ts -> nanos can fail, fix deprecation warning

---------

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>
2023-09-18 12:57:48 +00:00
Fraser Savage acc2d6f33c
refactor(wal): Tidy up pointless let assignment 2023-09-18 13:57:03 +01:00
Dom af425f657c
Merge pull request #8748 from influxdata/cn/refactors
refactor: Prepare for correcting validation of max tables and max columns per table
2023-09-18 13:40:51 +01:00
Dom c591a4fef6
Merge branch 'main' into cn/refactors 2023-09-18 13:22:31 +01:00
Dom Dwyer 4ec07b5d80
feat(gossip): schema cache anti-entropy service
Defines an RPC service to be used by two peers to converge their schema
cache content by exchanging their serialised Merkle Search Tree pages (a
compact representation of the MST itself).

This will be used in the latter half of the following sync protocol:

                    ┌─────┐                   ┌────┐
                    │Local│                   │Peer│
                    └──┬──┘                   └─┬──┘
                       │ [1] Send content hash  │
                       │────────────────────────>
                       │                        │
                       │                 ┌───────────────┐
                       │                 │Compute hash,  │
                       │                 │stop if equal  │
                       │                 └───────────────┘
                       │                        │
                       │   ╔════════════════╗   │
═══════════════════════╪═══╣ Switch to gRPC ╠═══╪═══════════════════════
                       │   ╚════════════════╝   │
                       │                        │
                       │[2] Serialised MST pages│
                       │<────────────────────────
                       │                        │
                ┌──────────────┐                │
                │Perform diff  │                │
                └──────────────┘                │
                       │ [3] Inconsistent pages │
                       │────────────────────────>
                       │                        │
                       │                        │
          ╔═══════╤════╪════════════════════════╪════════════╗
          ║ LOOP  │  For each inconsistent page │            ║
          ╟───────┘    │                        │            ║
          ║            │      [4] Scheams       │            ║
          ║            │<────────────────────────            ║
          ╚════════════╪════════════════════════╪════════════╝
                    ┌──┴──┐                   ┌─┴──┐
                    │Local│                   │Peer│
                    └─────┘                   └────┘

The initial consistency probe request [1] is sent over gossip and is
used to trigger a further sync of inconsistent MST content if necessary.
This message is a no-op if the MSTs are found to be fully consistent.

If an inconsistency is detected between the two peers, the protocol
switches to perform RPC over TCP, calling the AntiEntropyService defined
in this commit to complete the sync process.

The receiver of the consistency probe [1] calls GetTreeDiff and provides
the their MST pages [2], causing the local node to compute the diff
between the two MSTs, and return the set of inconsistent ranges [3] that
require convergence.

Once the set of inconsistent ranges have been identified, the peer pulls
all the schemas within those ranges and merges them into the local cache
to ensure it has all the content of the source node.

Once this protocol has run in both directions between two peers (and in
absence of further updates between runs) then these two peers are
guaranteed to have converged.
2023-09-18 11:38:22 +02:00
Marco Neumann 012df69974
feat: i->q V2 circuit breaker (#8743)
* feat: impl `PartialEq + Eq` for `TestError`

* feat: i->q V2 circuit breaker

This is a straight port from V1, it even uses the same test. The code is
copied though (instead of reusing the old one) because the interface in
the V2 client is so different and the new testing infra is also nicer
(IMHO).

For #8349.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-18 08:58:56 +00:00
dependabot[bot] eb80fea517
chore(deps): Bump mockito from 1.1.1 to 1.2.0 (#8751)
Bumps [mockito](https://github.com/lipanski/mockito) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/lipanski/mockito/releases)
- [Commits](https://github.com/lipanski/mockito/compare/1.1.1...1.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-18 07:55:49 +00:00
Carol (Nichols || Goulding) 1f485747d8
refactor: Move type validation logic into data_types rather than the gRPC service 2023-09-15 17:14:05 -04:00
Carol (Nichols || Goulding) ada3d310d9
refactor: Use the newtypes in the catalog functions for updating service limits 2023-09-15 16:23:31 -04:00
Carol (Nichols || Goulding) 5a74d09194
fix: Use the newtypes in NamespaceServiceProtectionLimitsOverride 2023-09-15 16:23:31 -04:00
Carol (Nichols || Goulding) a42a00b6f2
refactor: Consistently order max tables first, then max columns
I can't handle it.
2023-09-15 16:23:31 -04:00
Carol (Nichols || Goulding) d56217a8f6
refactor: Define the default limits on the types, not the catalog 2023-09-15 16:23:30 -04:00
Carol (Nichols || Goulding) 94b86e317b
refactor: Extract service protection types to their own module 2023-09-15 13:41:20 -04:00
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) ab7282795a
refactor: Extract functions for creating repeated NamespaceSchema values 2023-09-15 13:09:36 -04:00
Carol (Nichols || Goulding) 3614ea4e70
refactor: Share a test fn and constants between router tests 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) 307a450f51
refactor: Extract a function for comparing NamespaceSchemas
Namely, those attributes that are simple values, as opposed to tables
which is more complicated and is the aspect under test.
2023-09-15 13:09:35 -04:00
Carol (Nichols || Goulding) c00cd95f9d
refactor: Extract a function for constructing NamespaceCreated messages in the router
So that the same conversion can happen in the tests and one assert_eq!
can check everything rather than repeating lots of assertions for every
test for every field.
2023-09-15 13:09:35 -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
Carol (Nichols || Goulding) 0994264152
refactor: Use a test constant rather than redefining 2023-09-15 13:09:35 -04:00
Carol (Nichols || Goulding) 553e34a7f3
refactor: Share some test constants in a common parent module 2023-09-15 13:09:35 -04:00
Fraser Savage 827f4beb05
feat(ingester): Expose metric for finished replay of whole & truncated segment files 2023-09-15 16:47:41 +01:00
Fraser Savage bc3b421618
fix(ingester): Include truncated WAL file for max sequence number calculation 2023-09-15 16:24:43 +01:00
Martin Hilton 421b78e48b
feat(iox_query): support timezone in gap-filling (#8745)
When gap-filling make the output time array have the same timezone
as the imput time array.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-15 14:55:16 +00:00
Fraser Savage 32853b77ed
refactor(ingester): Only discard truncated write during replay for final segment
This moves the error handling up the the file level replay loop, being
stricter about which files are considered "replayed" when they are
truncated. Any files other than the most recent segment file which
encounter and unexpected are not considered to be safe to replay and
discard.
2023-09-15 15:45:58 +01:00
Carol (Nichols || Goulding) fb351ac3e1
test: Add a test encoding expected behavior of validate_or_insert_schema (#8738)
I was confused about whether validate_or_insert_schema should return all
columns a table has in the catalog if another process has added some.

Dom explained that no, this is by design-- the validate_or_insert_schema
function shouldn't be fetching any extra columns from the catalog, only
inserting missing columns from the diff set being processed during a
write.

The NamespaceCache/gossip system takes care of eventually converging
schemas at a higher level.

To avoid anyone having to go through the understanding path I just did,
encode this expected behavior in a test for future reference.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-15 14:36:19 +00:00
Martin Hilton ada65d7389
feat(query_functions): suport timezone in selector_* functions (#8742)
Update the selector functions to output the selected time in the
same timezone as input time array. This will not have any effect
on the rest of the system yet as timezones are not used anywhere.
This change is being done in preparation for making use of timezones.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-09-15 11:54:28 +00:00
dependabot[bot] 8fddbc395b
chore(deps): Bump mockito from 1.1.0 to 1.1.1 (#8741)
Bumps [mockito](https://github.com/lipanski/mockito) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/lipanski/mockito/releases)
- [Commits](https://github.com/lipanski/mockito/compare/1.1.0...1.1.1)

---
updated-dependencies:
- dependency-name: mockito
  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-09-15 08:51:03 +00:00
kodiakhq[bot] 477e6df639
Merge pull request #8735 from influxdata/dom/persist-threads
perf: use half of logical cores for persist exec
2023-09-14 16:05:27 +00:00
Dom Dwyer 1bb4c08067
perf: use half of logical cores for persist exec
Changes the default ingester configuration to assign half the logical
cores to datafusion for persist execution. Prior to this commit,
datafusion always used 4 threads by default.

In situations where the ingesters are configured with 4 logical cores or
less, the periodic persist can start enough persist jobs to keep the 4
threads assigned to datafusion busy. Because there are enough threads to
saturate all CPU cores, these CPU-heavy persist threads can impact write
latency by stealing CPU time from the tokio runtime threads.

This change assigns exactly half the threads to DF by default, ensuring
there's always N/2 cores to service I/O heavy API requests.
2023-09-14 17:54:33 +02:00
Dom Dwyer 7ad26e6d0e
feat: only limit non-empty partitions
This changes the per-namespace buffered partition limiter to only
consider non-empty partitions when enforcing the partition limit.

Non-empty partitions cost a small amount of RAM, but are not added to
the persist queue - only non-empty partitions will need persisting, so
the limiter only needs to limit non-empty partitions.

This commit also significantly improves the consistency properties of
the limiter - the limit no longer suffers from a small window of
"overrun" due to non-atomic updates w.r.t partition creation - the limit
is now exact.

As an optimisation, partitions are not created at all if the limit has
been reached, preventing an accumulation of empty partitions whilst the
limit is being enforced.
2023-09-14 16:50:48 +02:00
Dom Dwyer 3978b07a43
feat(ingester): partition is_empty()
Adds an is_empty() method to the PartitionData, returning true iff a
subsequent query of the partition would return no rows.
2023-09-14 16:50:23 +02:00
Dom 11604f1f70
Merge pull request #8733 from influxdata/dom/partition-use-builder
test: accept PartitionDataBuilder in provider
2023-09-14 15:34:42 +01:00