Commit Graph

240 Commits (008270b3468d3b1faa10d0f43223633c9f8ada7e)

Author SHA1 Message Date
NGA-TRAN 646349c52d docs: addd comments to explain further the skip 2023-02-07 09:34:40 -05:00
Marco Neumann 997cca67a3
fix: `--compaction-process-once` should exit (#6886)
- do not wait for a non-empty partition result (this doesn't make sense
  if we are not running endlessly)
- modify entry point to allow the compactor to exit on its own (this is
  normally not allowed for other server types)
2023-02-07 13:52:17 +00:00
Marco Neumann e179887ede
fix: metric buckets (#6883) 2023-02-07 12:07:45 +00:00
Marco Neumann 3a4364b8f8
fix: partition-done metrics/logs (#6882)
Ignore partitions that where throttled or filtered due to the "not
unique" combo.

This is in line w/ the "partitions source", so the metric for "partition
in" and "partition out" line up.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-07 11:01:33 +00:00
Andrew Lamb 65e7ff779c
feat: verified test output display for compactor (#6859)
* feat: verified test output display for compactor

* fix: demacrofy assert_parquet_files

* fix: demacrofiy assert_parquet_files_split

* refactor: compute min/max without sentinels

* fix: clippy

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-07 10:49:38 +00:00
Dom 9e8785f9c1
Merge branch 'main' into dom/cache-table-limit 2023-02-07 10:04:50 +00:00
NGA-TRAN 6ec44d697a chore: cleanup 2023-02-06 21:41:35 -05:00
NGA-TRAN 24ebd923a2 chore: Merge branch 'ntran/c2-skip' of https://github.com/influxdata/influxdb_iox into ntran/c2-skip 2023-02-06 21:39:24 -05:00
NGA-TRAN 56ca3186b6 chore: turn test assert on 2023-02-06 21:39:17 -05:00
Nga Tran bce7dba856
Merge branch 'main' into ntran/c2-skip 2023-02-06 21:35:20 -05:00
NGA-TRAN 32715595bb chore: cleanup 2023-02-06 21:32:06 -05:00
NGA-TRAN bdf3e32dcd test: tests for partition filters of resource limit 2023-02-06 21:26:45 -05:00
NGA-TRAN 9f2fecde90 feat: first step to skip partition until we know what files to compact 2023-02-06 17:30:15 -05:00
Andrew Lamb 452b69cd2c
docs(compactor): Update comments about what `PartitionFilter` does (#6878)
* docs(compactor): Update comments about what `PartitionFilter` does

* fix: Update compactor2/src/components/partition_filter/mod.rs

* fix: fmt

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 21:44:32 +00:00
Andrew Lamb 50514a91ff
refactor: reduce duplication for compactor_tests (#6879) 2023-02-06 21:08:12 +00:00
Andrew Lamb 0c6b685ee1
refactor: add / cleanup some comments in compactor2 (#6853)
* refactor: add / cleanup some comments in compactor2

* fix: clarify comments after talking Nga

* fix: Update comments
2023-02-06 19:11:10 +00:00
Nga Tran 8689017f8f
chore: debug info (#6874)
* chore: debug info

* chore: Apply suggestions from code review
2023-02-06 18:16:33 +00:00
Dom Dwyer a633964f2b
feat(catalog): return max table limit in schema
The maximum number of tables is part of the Namespace, which is already
loaded in its entirety. This commit copies the value into the
NamespaceSchema, making it available for the router to utilise.
2023-02-06 17:33:55 +01:00
Marco Neumann 5b6b7cbf86
feat: rework commit log+metrics (#6871)
* feat: add more information to commit logging

* feat: rework commit metrics

- more consistent metric names
- histograms per file and per job
- more histogram types (number of files, rows, bytes)
2023-02-06 15:56:24 +00:00
Marco Neumann f83db0a52e
refactor: pass more information to `commit` (#6867)
This is NOT used yet but will greatly help w/ logging and metrics. E.g.
it allows us to count rows and bytes of in/out-flow, create per-file
histograms of bytes/rows, and more.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 12:29:32 +00:00
Raphael Taylor-Davies d3601a59f8
chore: update DataFusion, upgrade `arrow` `arrow-flight` and `parquet` to `32.0.0` (#6756)
* chore: update DataFusion

* fix: test

* chore: format

* chore: clippy

* chore: update arrow

* chore: arrow upgrade fallout

* chore: Run cargo hakari tasks

* chore: remove failing warm compaction test

* fix: flight error propagation

* chore: update parquet size

* fix: Update error message

* chore: Update parquet metadata test

---------

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 11:35:39 +00:00
Marco Neumann 52b43c40bc
refactor: use "endless" stream for compactor work (#6803)
Instead of looping and polling a fresh set of partitions and
constructing a stream from that, use an endless stream instead. This
helps w/ efficiency during roll-overs since we can already start to
process the next set of partitions while the last ones from the previous
round are still in-progress.

Closes #6750.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 11:11:39 +00:00
Marco Neumann 18287dc30e
fix: do not silently ignore errors (#6866)
Fixes https://github.com/influxdata/idpe/issues/17085 .

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 11:01:53 +00:00
Marco Neumann 4fb1b1948a
feat: throttle partitions that do not receive commits (#6831)
* feat: throttle partitions that do not receive commits

* test: add failing test

* fix: partition ID in "unique" combo

* fix: partition ID in "throttle" combo

* docs: improve

Co-authored-by: Dom <dom@itsallbroken.com>

---------

Co-authored-by: Dom <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-06 09:59:33 +00:00
Marco Neumann cd6d69c9b1
docs: high-level documentation for `compactor2` (#6818)
* docs: high-level documentation for `comapctor2`

* docs: typos & clarification

Co-authored-by: Nga Tran <nga-tran@live.com>
Co-authored-by: Andrew Lamb <alamb@influxdata.com>

* docs: improve wording

* fix: typo

---------

Co-authored-by: Nga Tran <nga-tran@live.com>
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-02-06 08:37:57 +00:00
Nga Tran e85de74a5d
feat: partition filters for TargetLevel version and a complete test (#6858)
* feat: partition filters for TargetLevel version and a complete test

* chore: Apply suggestions from code review

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

* chore: run fmt after applying review suggestions in git

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-04 19:54:41 +00:00
Andrew Lamb f1561676de
chore: refactor splitting files by level (#6857)
* chore: refactor splitting files by level

* fix: docs
2023-02-04 16:05:04 +00:00
Andrew Lamb 2b36692488
refactor: reduce more code duplication (#6856) 2023-02-04 15:12:06 +00:00
Andrew Lamb 77b2f53cc4
refactor: reduce code duplication in compactor (#6855) 2023-02-04 15:00:55 +00:00
Andrew Lamb edacc21e8e
refactor: extract timerange calculations (#6854)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-04 13:40:55 +00:00
Nga Tran f46881496d
feat: split files to upgrade and compact (#6852)
* feat: first step to split upgrade

* chore: Apply suggestions from code review

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

* chore: address review comments

* chore: rename per review request

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-02-04 13:17:29 +00:00
Nga Tran 670b811a2e
feat: split non-overlapping files and not compact them (#6849)
* chore:  start the overlap filter module

* feat: split  non-overlapping files and not compact them

* chore: remove unused file

* refactor: address review comment

* chore: Apply suggestions from code review

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

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2023-02-03 23:25:34 +00:00
NGA-TRAN db3ae70366 chore: merge main to branch 2023-02-03 17:38:05 -05:00
NGA-TRAN f071a3674e refactor: rename TargetLevelDetection to TargetLevelChooser 2023-02-03 17:28:33 -05:00
Carol (Nichols || Goulding) 30fea67701
fix: Move variables within format strings. Thanks clippy!
Changes made automatically using `cargo clippy --fix`.
2023-02-03 13:06:17 -05:00
Carol (Nichols || Goulding) fbfbe1adb4
fix: Remove track_caller from async fns as it's a no-op
Rust 1.67 now says:

warning: `#[track_caller]` on async functions is a no-op
   = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
   = note: `#[warn(ungated_async_fn_track_caller)]` on by default
2023-02-03 13:06:01 -05:00
Nga Tran 0ed9754c4a
feat: split higher target level files from compact ones (#6829)
* feat: split upgrade & compact

* chore: Apply suggestions from code review

Co-authored-by: Marco Neumann <marco@crepererum.net>

* chore: merge main to branch

* refactor: address review comments

* fix: doc comment fo []

---------

Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 17:57:38 +00:00
NGA-TRAN 930a40f6f6 fix: a kind of conflict the git merge does not know yet 2023-02-03 10:56:48 -05:00
NGA-TRAN b0197e6221 chore: Merge branch 'main' into ntran/c2-algo2-target-level 2023-02-03 10:50:30 -05:00
NGA-TRAN f02d0629ce refactor: address review comment and rename to match comapct algo version names 2023-02-03 10:49:45 -05:00
Nga Tran 1535366666
refactor: rename compact algo versions to reflect their actual work (#6841)
* refactor: rename compact algo versions to reflect thier actual work

* chore: Apply suggestions from code review

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

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-03 15:06:38 +00:00
Nga Tran ff39917dcb
chore: Apply suggestions from code review
Co-authored-by: Marco Neumann <marco@crepererum.net>
2023-02-03 09:40:41 -05:00
NGA-TRAN fc539cfe33 feat: compaction target level detection 2023-02-02 15:09:29 -05:00
Nga Tran 5a896764cc
refactor: Framework for compact version2: hotcold (#6810)
* refactor: Framework for compact version2: hotcold

* chore: Apply suggestions from code review

Co-authored-by: Marco Neumann <marco@crepererum.net>

* refactor: address review comments

---------

Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-02 17:07:58 +00:00
Marco Neumann cb582b859d
revert: throttle partitions that do not receive commits (#6778) (#6820)
This will stall the compactor and only touch each partition ones because
the "unique" combo thinks that partitions never finish. This will need
more thought.
2023-02-02 16:29:45 +00:00
Nga Tran 0ddf11adab
chore: add definition for the output of compacting a partition (#6806)
* chore: add definition for the output of compacting a partition

* chore: Apply suggestions from code review

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

* chore: address review comments

---------

Co-authored-by: Andrew Lamb <alamb@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-02 13:35:32 +00:00
Marco Neumann c90ddd12d1
feat: throttle partitions that do not receive commits (#6778)
This was a bit tricky to design so it is testable and modular, but I
think this turned out quite nicely. It will even work w/ #6750.

Fixes #6727.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-02 09:38:03 +00:00
Nga Tran 0ef4f9fa9b
feat: start adding piece by piece for hotcold compaction (#6804)
* feat: start adding piece by piece for hotcold compaction

* chore: remove upgrade from commit results

* chore: address review comments

* chore: comments for stop conditions
2023-02-01 19:52:48 +00:00
Marco Neumann d16eaac64b
refactor: ensure that we only have a partition ID ONCE within the pipeline (#6774)
* refactor: `MockPartitionDoneSink::{errors => results}`

* feat: ensure we don't concurrently process the same partition

Helps w/ #6750.

* test: extend `test_unique`

* docs: explain `unique_partitions`

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-01 15:42:40 +00:00
Marco Neumann 0a20bd404e
feat: allow selection of different compactor algo versions (#6800)
Required to lift&shift to hot-cold compaction w/ keeping the codebase
maintainable.
2023-02-01 15:33:41 +00:00
Marco Neumann b8b59bf73b
feat: allow partition filters to error + flag partitions (#6796)
* refactor: error handling clean-up and testing

* feat: allow partition filters to error + flag partitions

Closes #6748.
2023-02-01 11:34:53 +00:00
Marco Neumann c8da5a8e07
refactor: extract early ID-based partition filters into new components (#6794)
This should greatly improve efficiency of the two filters ("by ID" -
used for mocking / tests / dev, "shard"). This also changes the metrics
slightly since the partitions filtered there no longer count into the
overall "backlog" (which makes sense for the two filters).

I've left the "never skipped" filter where it is, because it needs to
perform IO (i.e. shouldn't be done for all partitions upfront) and we
shall only have a few skipped partitions, so it's not such a big if
needlessly fetch the parquet files for them.

Closes #6783.
2023-02-01 11:08:47 +00:00
dependabot[bot] d0e6b16450
chore(deps): Bump bytes from 1.3.0 to 1.4.0
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.3.0...v1.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 00:30:56 +00:00
Marco Neumann 62697265c1
feat: compactor sharding (#6729)
I'm not saying we have to use this, but this is a demonstration how easy
it would be to add sharding to the compaction tier and also acts as a
"backup / insurance" if we ever need it.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-31 14:37:06 +00:00
Marco Neumann b682ffcb36
refactor: add partition ID to commit (#6775)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-31 11:41:25 +00:00
dependabot[bot] 6f032b1d57
chore(deps): Bump async-trait from 0.1.63 to 0.1.64 (#6769)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.63 to 0.1.64.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.63...0.1.64)

---
updated-dependencies:
- dependency-name: async-trait
  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-01-31 10:18:27 +00:00
Marco Neumann b635dda85c
feat: throttle when there are not partitions to compact (#6752)
* test: `MockPartitionsSource::set`

* test: `AssertFutureExt`

* feat: throttle when there are not partitions to compact

Fixes #6727.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-30 12:00:03 +00:00
Andrew Lamb f133cda00c
docs: Add docstring to Scratchpad (#6742)
* docs: Add docstring to Scratchpad

* fix: put derive macro after docstring

* fix: Update compactor2/src/components/scratchpad/mod.rs

Co-authored-by: Marco Neumann <marco@crepererum.net>

* fix: Update other italic markdown

---------

Co-authored-by: Marco Neumann <marco@crepererum.net>
2023-01-30 11:52:13 +00:00
Marco Neumann 515f0eef64
feat: simple compactor2 self-protection (#6728)
Add some rough "partition is too big" filter for now until we can deal
with them (the framework allows that but we need to set up the proper
divide-and-conquer components).

This will hopefully prevent our prod compactor from dying that often.

Note that this is also duct-tape around two issues:

- DataFusion not accounting in-flight data all the time
- Our wide fan-out query plans (see https://github.com/influxdata/idpe/issues/16768#issuecomment-1387056833 )

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-30 10:57:47 +00:00
Marko Mikulicic 0bc7d90ee3 chore: Avoid defining transition shard numbers in multiple crates 2023-01-27 18:30:34 +01:00
Marko Mikulicic f6e7724d19
fix(compactor2): Update other locations of the TRANSITION_SHARD_INDEX (#6736) 2023-01-27 16:59:24 +00:00
Marco Neumann 4391e30d2d
feat: improve compactor2 debugging (#6718)
* feat: add planning logging wrapper

* refactor: split partitionS source and partition source into two components
2023-01-26 16:10:20 +00:00
Marco Neumann 68380a32e5
fix: "timeout" as a reason to skip a partition (#6716)
I've meant to skip partitions w/ timeouts when I designed the
functionality but forgot to adjust the error filter accordingly. To not
run into this problem again (i.e. forget adjust the filter), make the
code a bit more explicit.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-26 15:00:13 +00:00
Marco Neumann 30d411dc95
feat: shadow mode (#6712)
* refactor: remove untyped durations from `compactor2`

* feat: shadow mode

Closes #6645.

* refactor: split input and output store
2023-01-26 14:20:55 +00:00
Nga Tran b8a80869d4
feat: introduce a new way of max_sequence_number for ingester, compactor and querier (#6692)
* feat: introduce a new way of max_sequence_number for ingester, compactor and querier

* chore: cleanup

* feat: new column max_l0_created_at to order files for deduplication

* chore: cleanup

* chore: debug info for chnaging cpu.parquet

* fix: update test parquet file

Co-authored-by: Marco Neumann <marco@crepererum.net>
2023-01-26 10:52:47 +00:00
Marco Neumann ed694d3be4
feat: introduce scratchpad store for compactor (#6706)
* feat: introduce scratchpad store for compactor

Use an intermediate in-memory store (can be a disk later if we want) to
stage all inputs and outputs of the compaction. The reasons are:

- **fewer IO ops:** DataFusion's streaming IO requires slightly more
  IO requests (at least 2 per file) due to the way it is optimized to
  read as little as possible. It first reads the metadata and then
  decides which content to fetch. In the compaction case this is (esp.
  w/o delete predicates) EVERYTHING. So in contrast to the querier,
  there is no advantage of this approach. In contrary this easily adds
  100ms latency to every single input file.
- **less traffic:** For divide&conquer partitions (i.e. when we need to
  run multiple compaction steps to deal with them) it is kinda pointless
  to upload an intermediate result just to download it again. The
  scratchpad avoids that.
- **higher throughput:** We want to limit the number of concurrent
  DataFusion jobs because we don't wanna blow up the whole process by
  having too much in-flight arrow data at the same time. However while
  we perform the actual computation, we were waiting for object store
  IO. This was limiting our throughput substantially.
- **shadow mode:** De-coupling the stores in this way makes it easier to
  implement #6645.

Note that we assume here that the input parquet files are WAY SMALLER
than the uncompressed Arrow data during compaction itself.

Closes #6650.

* fix: panic on shutdown

* refactor: remove shadow scratchpad (for now)

* refactor: make scratchpad safe to use
2023-01-26 10:03:08 +00:00
Marco Neumann 7306ea9424
feat: divide&conquer framework (#6697)
Allows compactor2 to run a fixed-point loop (until all work is done) and
in every loop in can run mulitiple jobs.

The jobs are currently organized by "branches". This is because our
upcoming OOM handling may split a branch further if it doesn't complete.

Also note that the current config resembles the state prior to this PR.
So the FP-loop will only iterate ONCE and then runs out of L0 files. A
more advanced setup can be built using the framework though.
2023-01-25 14:45:20 +00:00
Marco Neumann 40e6a1a437
feat: job semaphore (#6696)
* refactor: avoid too-many-arguments

* refactor: extract `fetch_partition_info`

* feat: job semaphore
2023-01-25 10:35:07 +00:00
Marco Neumann 4521516147
feat: add per-partition timeout (#6686)
It seems that prod was hanging last night. This is pretty hard to debug
and in general we should protect the compactor against hanging /
malformed partitions that take forever. This is similar to the fact that
the querier also has a timeout for every query. Let's see if this shows
anything in prod (and if not it's still a desired safety net).

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-24 16:53:47 +00:00
Marco Neumann 1c87d9667f
refactor: record partition completion (both Ok and Err) (#6680)
With the upcoming divide-and-conquer approach, we have have multiple
commits per partition since we can divide it into multiple compaction
jobs. For metrics (and logs) however it is important to track the
overall process, so we shall also monitor the number of completed
partitions.
2023-01-24 15:06:15 +00:00
Marco Neumann 32df24e057
feat: compactor2 error classification (#6676)
* feat: add error kinds

* refactor: sink proper error type

* fix: ignore object store errors

See <https://github.com/influxdata/idpe/issues/16984>.

* feat: log error kind

* feat: per-kind error metric

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-24 13:50:19 +00:00
Marco Neumann bcb1232c5d
refactor: integrate "skipped" handling into the partition filter framework (#6673)
* refactor: pass partition ID to partition filter

* feat: add logging partition filter wrapper

* refactor: make partition filter async

* refactor: integrate "skipped" handling into the partition filter framework

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-24 11:34:06 +00:00
Nga Tran 06d4a5fe4e
refactor: ignore partitions in table skipped compactions (#6666)
* refactor: ignore partitions in table skipped compactions

* refactor: continue ignoring partitions in skipped compaction

* test: skip partition
2023-01-23 19:53:05 +00:00
Marco Neumann e2cfe809d2
refactor: planner as a component (#6665)
* refactor: planner as a component

Now everything except for the core algorithm structure is a component.
This also means that the driver no longer needs the whole config
structure.

* docs: explain V1
2023-01-23 16:02:01 +00:00
Marco Neumann c9821720ab
test: ensure Arrow/DataFusion panics don't crash compactor (#6664)
Closes #6644.
2023-01-23 15:30:16 +00:00
Marco Neumann cb02262b9d
refactor: extract "exec DF plan" and "store stream to file" components (#6663)
* refactor: extract `PartitionInfo`

* refactor: extract DF exec component

* feat: add some error conversions

* refactor: make fn public

* refactor: extract file sink component

* fix: clippy
2023-01-23 14:40:35 +00:00
dependabot[bot] 0114e7ee50
chore(deps): Bump async-trait from 0.1.61 to 0.1.63 (#6660)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.61 to 0.1.63.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.61...0.1.63)

---
updated-dependencies:
- dependency-name: async-trait
  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>
2023-01-23 08:41:27 +00:00
Nga Tran 411b3db928
fix: Get shard id from a constant (topic, shard_index) to avoid error of shard_id FK violation (#6658)
* fix: ake shard_id FK always 1

* fix: use const shard_index to read its ID

* refactor: read shard_id during compactor initiation
2023-01-22 16:49:06 +00:00
Nga Tran 840923abab
refactor: execute compaction plan (#6654)
* chore: address review comment of previous PR

* refactor: execute compact plan

* refactor: we will now compact all L0 and L1 files of a partition and split them as needed

* chore: comnents

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-20 22:34:50 +00:00
Marco Neumann 4f1beba482
feat: filter out L2 files from compaction (#6653)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-20 15:44:13 +00:00
Marco Neumann 111e582d71
feat: improve compactor2 metrics and logging (#6652)
Closes #6647.

We can always create tickets for concrete issues/wishes or create
on-demand PRs.
2023-01-20 15:08:00 +00:00
Nga Tran 8aeded32d6
refactor: reorganize compact_files core function (#6636)
* refactor: reorganize compact_files core function

* chore: smore more in-progress structure

* refactor: further reorganization for compact_files

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-20 13:41:23 +00:00
Marco Neumann 810f9096b8
feat: catalog commits for compactor2 (#6638) 2023-01-19 17:37:45 +00:00
Marco Neumann df85c7b154
refactor: more flexible filter design (#6635)
Filters can now inspect ALL files for a partition which may be useful
for limiters. This also moves the "is not empty" part into a filter.

Note that we still can only run ONE compaction job per partition for the
time being, so splitting the files into multiple sub-groups and run a
per-group DataFusion job is currently not possible. It should be a rather easy
addition if we ever want that (probably needs another semaphore of
something to limit the overall job count).
2023-01-19 16:40:54 +00:00
Marco Neumann eb149eca7c
feat: partition error sink (#6633)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-19 15:34:57 +00:00
Marco Neumann ad69a554d6
refactor: extract "fetch files" component (#6632) 2023-01-19 13:11:44 +00:00
Marco Neumann e4bf9e85d9
refactor: more components for compactor2 (#6630)
* refactor: rename "rules" to "components"

* refactor: replace `Trait::name` w/ `impl Display`

* refactor: remodel partitions source

* refactor: add TODO

* refactor: fully components-based partitions source

* test: add tests for partitions sources

* docs: improve

Co-authored-by: Dom <dom@itsallbroken.com>

Co-authored-by: Dom <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-19 12:29:38 +00:00
Nga Tran 9ae03b16d6
feat: invokes catalog functions for compactor2 (#6619)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-19 10:33:57 +00:00
Marco Neumann 380a855aab
feat: basic compactor2 algo layout (#6616) 2023-01-18 18:51:59 +00:00
Marco Neumann e72173d58d
feat: very basic compactor2 skeleton (#6614)
Sets up crate and wires up the main binary. No tests yet, no algorithm
framework, just the bare minimum.

Also I decided to not offer a gRPC server in `compactor2` at the moment
and hence did not implement any handle/delegate infrastructure. We add
this later if we need it. This also means compactor2 does NOT provide a
catalog service for now.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-01-18 16:36:40 +00:00