Commit Graph

10187 Commits (13ed3f9acb478a2cb25ebc7bd90bcad00a8e6cdf)

Author SHA1 Message Date
kodiakhq[bot] 0e21f3dcfe
Merge pull request #6303 from influxdata/cn/ingester2
feat: Add an ingester2 command behind the rpc_write feature flag
2022-12-02 13:46:30 +00:00
kodiakhq[bot] 9e3d0fcefb
Merge branch 'main' into cn/ingester2 2022-12-02 13:39:55 +00:00
Dom Dwyer b819a48d59
refactor(ingester2): rename concurrent limit var
The ingester will handle many types of requests - this limit applies to
queries only.
2022-12-02 14:36:42 +01:00
Dom Dwyer 4f928fbd0c
perf(ingester2): partition persist queue
This commit swaps the existing single "persisting batch" slot (field) in
a PartitionData for an ordered queue of outstanding partitions.

This decouples marking a partition buffer for persistence from the
actual persistence operation, allowing them to proceed at different
rates. This reduces the complexity of persistence management, but also
allows us to gracefully handle "hot" partitions; for example, this
problematic scenario in the ingester(1) implementation during recovery:

    * Writes come into a partition, reaching a size/row/hotness limit
    * Partition is enqueued for persistence
    * More writes come into the new buffer, exceeding the same limit
    * Cannot persist the hot buffer because of outstanding persist op

Without this change the only possibilities in this situation are:

    * stop ingest for the partition and error all writes that
      (partially!) write to the partition, or
    * continue accepting writes, allowing the partition to exceed the
      limit that marked it for persistence in the first place

The latter is what the ingester(1) implementation does today, which
results in partitions exceeding their row/size/age limits, which exist
to limit the cost of generating the Parquet file from the buffer - this
is a significant contributor to instability during recovery.

This strategy enforces configured the limits on the partition buffer,
but does not block / slow down recovery while persistence is completed.
2022-12-02 14:09:50 +01:00
kodiakhq[bot] 94cd66fd99
Merge pull request #6306 from influxdata/dom/shared-namesapce-name
refactor(ingester2): namespace name in partition
2022-12-02 12:50:23 +00:00
kodiakhq[bot] 9199b4b3ee
Merge branch 'main' into dom/shared-namesapce-name 2022-12-02 12:43:58 +00:00
Marco Neumann 942a6100b5
fix: check schemas in `pretty_print_batches` (#6309)
* fix: check schemas in `pretty_print_batches`

I think most users of this function (and `assert_batches_eq`) assume
that all batches have the same schema. If not, `pretty_print_batches`
may either fail producing an actual table (some rows may have more or
less columns) or silently produce a table that looks "alright".

* fix: equalize schemas where it is required/desired

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-02 12:14:16 +00:00
Marco Neumann ec2e72d223
test: simplify test executors (#6312)
Have a single global test executor w/ reasonable defaults. Also don't
require tests to join/await executor shutdowns (most tests forget this
anyways and will get a runtime warning).

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-02 11:38:18 +00:00
Marco Neumann ab4f910111
refactor: improve DF error handling (#6311)
This is required to extract "resource exhausted" errors in more cases.
2022-12-02 11:25:30 +00:00
dependabot[bot] 8742ed6c67
chore(deps): Bump syn from 1.0.104 to 1.0.105 (#6308)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.104 to 1.0.105.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.104...1.0.105)

---
updated-dependencies:
- dependency-name: syn
  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-02 09:01:19 +00:00
Stuart Carnie 5ac80bf4a5
feat: Add mutable visitor to InfluxQL parser crate (#6292)
* feat: Add mutable visitor to InfluxQL parser crate

* chore: Add missing snapshots

* chore: Fix docs

* chore: Fix test visitor
2022-12-02 05:37:41 +00:00
Nga Tran 775f4b5eea
docs: Add 2 new config params that can be adjusted to avoid OOMs (#6307)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 22:36:48 +00:00
Nga Tran 77cbc880f6
feat: Add cap limit on number of partitions to be compacted in parallel (#6305)
* feat: Add cap limit on number of partitions to be comapcted in parallel

* chore: cleanup

* chore: clearer comments
2022-12-01 21:23:44 +00:00
Dom Dwyer 9c170dd506
refactor(ingester2): namespace name in partition
Pushes the (ref-counted/shared) deferred NamespaceName resolver into the
child TableData and PartitionData nodes in the BufferTree.

This allows the PartitionData to provide the name of the namespace to
which it belongs, in addition to the existing table name, and all
relevant IDs.
2022-12-01 21:13:05 +01:00
Carol (Nichols || Goulding) 7c21db360f
fix: Make wal rotation period a CLI arg with a default of 300 s 2022-12-01 13:51:45 -05:00
Carol (Nichols || Goulding) 1977b34f23
fix: Use the IngesterGuard that was added while I was working 2022-12-01 13:43:02 -05:00
Marco Neumann e2168ae859
refactor: stream-based series-set conversion (#6285)
* refactor: stream-based series-set conversion

Closes #6216.

* docs: improve

Co-authored-by: Andrew Lamb <alamb@influxdata.com>

* refactor: improve algo docs and tests

* test: fix after rebase

* fix: broken `Series` conversion when slices are present

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 17:24:36 +00:00
Andrew Lamb d0f1f6a4fd
chore: Upgrade datafusion to get memory limits (#6297)
* chore: Update datafusion

* fix: use correctly qualified column names

* 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>
2022-12-01 16:40:26 +00:00
Carol (Nichols || Goulding) b9e424582f
refactor: Extract a clap block for the ingester2 RPC write path
To be able to share it with the coming all-in-one2 command
2022-12-01 11:39:30 -05:00
Carol (Nichols || Goulding) fef3bc02cd
refactor: Extract a clap block for the router RPC write path
To be able to share it with the coming all-in-one2 command
2022-12-01 11:39:30 -05:00
Carol (Nichols || Goulding) 0133479122
feat: Create an ingester2 server 2022-12-01 11:39:29 -05:00
Carol (Nichols || Goulding) a3bc31aa82
fix: Have ingester2 GrpcDelegate hold onto the catalog and metrics
So that they don't have to be passed in again later for the services.
2022-12-01 11:39:27 -05:00
Carol (Nichols || Goulding) 99698d0f46
feat: Create an ioxd_ingester2 crate 2022-12-01 11:37:21 -05:00
Carol (Nichols || Goulding) fc694e7273
feat: Add an ingester2 command behind the rpc_write feature flag 2022-12-01 11:37:21 -05:00
Dom fa4d6810a4
Merge pull request #6302 from influxdata/dom/rotate-wal
feat(ingester2): periodic WAL rotation
2022-12-01 16:01:08 +00:00
Dom Dwyer 81619fd5b3
refactor(ingester2): clean-up rotation task
When an ingester2 instance goes out of scope, automatically stop the WAL
rotation task.
2022-12-01 16:03:53 +01:00
Dom Dwyer c7f88d779a
feat(ingester2): rotate wal periodically
Spawn a background task to rotate the WAL file with the given internal.
2022-12-01 16:03:52 +01:00
Dom Dwyer f40885d4ca
refactor(wal): remove needless async/await
Obtaining a rotation handle isn't async.
2022-12-01 16:03:52 +01:00
kodiakhq[bot] e7f22fd9ab
Merge pull request #6300 from influxdata/dom/wal-replay
feat(ingester2): WAL entry replay at startup
2022-12-01 14:41:34 +00:00
kodiakhq[bot] 76e500cb31
Merge branch 'main' into dom/wal-replay 2022-12-01 14:34:51 +00:00
Marco Neumann 01315bc063
refactor: bring back "stream-based `SeriesSetConvert::convert` interface (#6282)" (#6301)
This reverts commit 4a8bb871dc.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 14:27:43 +00:00
Andrew Lamb 14a9bc92e9
Revert "Revert "chore: Update Datafusion and arrow/arrow-flight/parquet to `28.0.0` (#6279)" (#6294)" (#6296)
This reverts commit b7e52c0d8d.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-01 14:20:43 +00:00
Dom Dwyer cb248c75d5
feat(ingester2): WAL entry replay at startup
Replay the WAL log, if any, at startup.

Op replay is performed synchronously, during initialisation of the
ingester2 instance, and passes all ops through the "normal" write path
that the system uses once replay is complete, minus the WAL writer layer
- this helps to DRY the write path and minimise different behaviours.
2022-12-01 15:01:43 +01:00
kodiakhq[bot] b427213ae9
Merge pull request #6299 from influxdata/dom/more-partition-cache
refactor(ingester2): cache more hot partitions
2022-12-01 13:55:41 +00:00
kodiakhq[bot] 523b041319
Merge branch 'main' into dom/more-partition-cache 2022-12-01 13:49:09 +00:00
Marco Neumann 6cecc439d4
refactor: revert "simplify `SeriesSet` (#6277)" (#6298)
This reverts commit c41200536e.
2022-12-01 13:30:19 +00:00
Dom Dwyer 1be9ffb409
refactor(ingester2): cache more hot partitions
Now partition cache entries are smaller, the number of entries held in
memory can be increased - this now uses ~2MiB of memory and drains the
cache during execution, amortising to 0.
2022-12-01 13:45:19 +01:00
kodiakhq[bot] 8515b770e3
Merge pull request #6293 from influxdata/dom/remove-ordering
refactor(ingester2): document reordering / remove seqnum ranges
2022-12-01 12:44:40 +00:00
kodiakhq[bot] 047bcc6e7e
Merge branch 'main' into dom/remove-ordering 2022-12-01 12:37:54 +00:00
Marco Neumann 88de327f70
Merge pull request #6295 from influxdata/crepererum/revert_dad6dee924ef71b414e4fc3b79864e454f4f7fea
refactor: revert stream-based `SeriesSetConvert::convert` interface (#6282)
2022-12-01 12:20:46 +00:00
Marco Neumann 4a8bb871dc refactor: revert stream-based `SeriesSetConvert::convert` interface (#6282)
This reverts commit dad6dee924.
2022-12-01 12:51:56 +01:00
Andrew Lamb b7e52c0d8d
Revert "chore: Update Datafusion and arrow/arrow-flight/parquet to `28.0.0` (#6279)" (#6294)
This reverts commit 039a45ddd1.
2022-12-01 11:38: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
Dom Dwyer 6639568665
refactor: remove unimplemented!()
This lets us keep the existing test coverage for the new impl.
2022-12-01 11:35:00 +01:00
Dom Dwyer 464242ebc6
refactor: remove ordering asserts, sequence ranges
This commit removes the invariant asserts of monotonicity carried over
from the "ingester" crate - ingester2 does not define any ordering of
writes within the system.

This commit also removes the SequenceNumberRange as it is no longer
useful to indirectly check the equality of two sets of ops -
non-monotonic writes means overlapping ranges does not guarantee a full
set of overlapping operations (gaps may be present). Likewise bounding
values (such as "min persisted") provide no useful meaning in an
out-of-order system.
2022-12-01 10:38:20 +01:00
Dom Dwyer 50d5e4a6f1
docs: arbitrarily reordering & sequence numbers
Document the arbitrary reordering of concurrent writes in an ingester,
and the potential divergence of WAL entries / buffered state.

Also documents that in ingester2, sequence numbers only identify writes,
not their ordering.
2022-12-01 10:38:20 +01:00
kodiakhq[bot] 7ab21ddf32
Merge pull request #6280 from influxdata/dom/wal-write
feat(ingester2): commit DML ops to WAL
2022-11-30 18:41:07 +00:00
Carol (Nichols || Goulding) b6b8e6ac10
Merge remote-tracking branch 'origin/main' into dom/wal-write 2022-11-30 13:27:28 -05:00
Carol (Nichols || Goulding) 096d850fd5
fix: Maintain WAL segment file ordering (#6287)
Rather than naming WAL files with a UUID, give them a number that
indicates the order they were created in so that they can be read back
in order.

Fixes #6227.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-30 17:37:37 +00:00
Marco Neumann dad6dee924
refactor: stream-based `SeriesSetConvert::convert` interface (#6282)
Change the interface of `SeriesSetConvert::convert` to be stream-based.
This is the final interface-prep step before actually implementing #6216.
2022-11-30 17:12:54 +00:00