Commit Graph

584 Commits (0c9570889bd63fc345906ca15921aef7101c1634)

Author SHA1 Message Date
Joe-Blount b7c0bcb61f
chore(compactor): move divide & branches to RoundInfo calculation (#8410) 2023-08-03 22:02:06 +00:00
wiedld 81b5d80a91
feat(idpe-17935): move filtering of skipped partitions to the scheduler (#8358)
* catalog.get_in_skipped_compaction() should handle for multiple partitions

* add the ability to perform transformation on sets of partitions (rather than filtering one by one). Start with the transformation to remove skipped partitions, in the scheduler.

* move the env var and cli flag setting, for when to ignore skipped partitions, to the scheduler config.
2023-08-03 11:43:09 -07:00
wiedld 09ee60e35f refactor(idpe-17789): rename mod to compaction_job_done_sink 2023-08-02 11:21:22 -07:00
wiedld 68ab2c97c1
feat(idpe 17789): provide job to CompactionJobDoneSink (formerly known as PartitionDoneSink) (#8368)
* rename PartitionDoneSink to CompactionJobSink. and change signature in trait
* update all trait implementations, including local variables and comments
* rename partition_done_sink in the components and driver, to be compaction_job_done_sink
2023-08-02 11:19:50 -07:00
Carol (Nichols || Goulding) 71b32d4dd6
fix: Persist Parquet files with the TransitionPartitionId 2023-08-02 10:17:23 -04:00
Carol (Nichols || Goulding) 5db8ed677f
fix: Update compactor's use of QueryChunk to return TransitionPartitionId
Also rename PartitionInfo's transition_partition_id to be partition_id
so that it's consistent with the QueryChunk method. We might want to
rename the partition_id field to catalog_partition_id, but for now I
think the types will make compactor usage clear enough.

This gets compactor to compile and pass its tests.
2023-08-02 10:17:22 -04:00
Carol (Nichols || Goulding) e4b9455344
feat: Have QueryChunk return a reference from partition_id() 2023-08-02 10:17:22 -04:00
wiedld cc70a2c38b
Merge branch 'main' into idpe-17789/provide-job-on-commit 2023-07-31 08:20:45 -07:00
Joe-Blount 44e266d000
fix: compaction looping fixes (#8363)
* fix: selectively merge L1 to L2 when L0s still exist

* fix: avoid grouping files that undo previous splits

* chore: add test case for new fixes

* chore: insta test churn

* chore: lint cleanup
2023-07-31 13:15:49 +00:00
Carol (Nichols || Goulding) 4a9e76b8b7
feat: Make parquet_file.partition_id optional in the catalog (#8339)
* feat: Make parquet_file.partition_id optional in the catalog

This will acquire a short lock on the table in postgres, per:
<https://stackoverflow.com/questions/52760971/will-making-column-nullable-lock-the-table-for-reads>

This allows us to persist data for new partitions and associate the
Parquet file catalog records with the partition records using only the
partition hash ID, rather than both that are used now.

* fix: Support transition partition ID in the catalog service

* fix: Use transition partition ID in import/export

This commit also removes support for the `--partition-id` flag of the
`influxdb_iox remote store get-table` command, which Andrew approved.

The `--partition-id` filter was getting the results of the catalog gRPC
service's query for Parquet files of a table and then keeping only the
files whose partition IDs matched. The gRPC query is no longer returning
the partition ID from the Parquet file table, and really, this command
should instead be using `GetParquetFilesByPartitionId` to only request
what's needed rather than filtering.

* feat: Support looking up Parquet files by either kind of Partition id

Regardless of which is actually stored on the Parquet file record.

That is, say there's a Partition in the catalog with:

Partition {
    id: 3,
    hash_id: abcdefg,
}

and a Parquet file that has:

ParquetFile {
    partition_hash_id: abcdefg,
}

calling `list_by_partition_not_to_delete(PartitionId(3))` should still
return this Parquet file because it is associated with the partition
that has ID 3.

This is important for the compactor, which is currently only dealing in
PartitionIds, and I'd like to keep it that way for now to avoid having
to change Even More in this PR.

* fix: Use and set new partition ID fields everywhere they want to be

---------

Co-authored-by: Dom <dom@itsallbroken.com>
2023-07-31 12:40:56 +00:00
wiedld 1ce8e50f1a feat(idpe-17789): provide job from compactor --> scheduler, on commit 2023-07-28 15:58:50 -07:00
wiedld 9a7ff9ecfc chore(idpe-17789): update code comments to reflect both jobs and partitions 2023-07-27 15:39:18 -07:00
wiedld d7fee9fdb8 refactor(idpe-17789): rename local variables and private struct properties to jobs (versus partitions). 2023-07-27 15:38:21 -07:00
wiedld 78ef536954
Merge branch 'main' into idpe-17789/compaction-job-renaming 2023-07-27 15:05:49 -07:00
Joe-Blount f5a41592da Merge remote-tracking branch 'origin/main' into jrb_73_stuck
# Conflicts:
#	compactor/tests/layouts/stuck.rs
2023-07-27 08:54:50 -05:00
Joe-Blount 525f8ec0cb
fix: compactor loop splitting then undoing it (#8338) 2023-07-27 13:17:30 +00:00
Joe-Blount 6246275c4a chore: insta churn updates 2023-07-26 15:59:49 -05:00
Joe-Blount f1e088aa0e fix: no percent split during ManySmallFiles compaction 2023-07-26 15:59:20 -05:00
wiedld 4dd73a036b refactor(idpe-17789): rename remaining references (in methods and report output) to be compaction_job_stream 2023-07-24 18:40:15 -07:00
wiedld 8abce6b054 refactor(idpe-17789): rename partition_stream mod to compaction_job_stream mod 2023-07-24 18:40:15 -07:00
wiedld 74e48dccb8 refactor(idpe-17789): rename OncePartititionStream to OnceCompactionJobStream 2023-07-24 18:40:15 -07:00
wiedld 559f9a612d refactor(idpe-17789): rename EndlessPartititionStream to EndlessCompactionJobStream 2023-07-24 18:40:15 -07:00
wiedld 2f51333914 refactor(idpe-17789): rename PartitionStream to CompactionJobStream 2023-07-24 18:40:15 -07:00
wiedld 5afc6e6fce refactor(idpe-17789): in hardcoded components, change all references of partitions_source to compaction_jobs_source 2023-07-24 18:40:15 -07:00
wiedld 067b5038c8 refactor(idpe-17789): rename partitions_source mod to compaction_jobs_source mod 2023-07-24 18:40:15 -07:00
wiedld b53e435e0d refactor(idpe-17789): rename ScheduledPartitionsSource to ScheduledCompactionJobsSource 2023-07-24 18:40:15 -07:00
wiedld 0acf02e460 refactor(idpe-17789): rename RandomizeOrderPartitionsSourcesWrapper to RandomizeOrderCompactionJobsSourcesWrapper 2023-07-24 18:40:15 -07:00
wiedld 759a494724 refactor(idpe-17789): rename NotEmptyPartitionsSourceWrapper to NotEmptyCompactionJobsSourceWrapper 2023-07-24 18:40:15 -07:00
wiedld 0234b56533 refactor(idpe-17789): rename MockPartitionsSource to MockCompactionJobsSource 2023-07-24 18:40:15 -07:00
wiedld 4f2f4dec83 refactor(idpe-17789): rename MetricsPartitionsSourceWrapper to MetricsCompactionJobsSourceWrapper 2023-07-24 18:40:15 -07:00
wiedld 37313765ce refactor(idpe-17789): rename LoggingPartitionsSourceWrapper to LoggingCompactionJobsWrapper 2023-07-24 18:40:15 -07:00
wiedld 56f296e338 refactor(idpe-17789): rename PartitionsSource to CompactionJobsSource 2023-07-24 18:40:15 -07:00
wiedld bab6f239ea feat(idpe-17789): move Compactor abstractions PartitionsSource and PartitionStream to use CompactionJob 2023-07-24 18:40:04 -07:00
wiedld 82d55fd6b6 refactor(idpe-17789): move PartitionsSource to be separate traits in scheduler vs compactor 2023-07-24 14:43:52 -07:00
wiedld 02088995b2
feat(idpe 17789): compactor to scheduler communication. `update_job_status()` and `end_job()` (#8216)
* feat(idpe-17789): scheduler job_status() (#8121)

This block of work moves into the scheduler some of the specific downstream actions affiliated with compaction outcomes. Which responsibilities stay in the compactor, versus moved to the scheduler, roughly followed the heuristic of whether the action (a) had an impact on global catalog state (a.k.a. commits and partition skipping), (b) whether it's logging affiliated with compactor health (e.g. ParitionDoneSink logging outcomes) versus system health (e.g. logging commits), and (c) reporting to the scheduler on any errors encountered during compaction. This boundary is subject to change as we move forward.

Also, a noted caveat (TODO) on this commit. We have a CompactionJob which is used to track work handed off to each compactor. Currently it still uses the partition_id for tracking, but the followup PR will start moving the compactor to have more CompactionJob uuid awareness.

* fix(idpe-17789): need to remove partition from uniqueness tracking, so it becomes available again

* refactor(idpe-17789): split up the single-use end_job() from the multi-use update_job_status()

* feat(idpe-17789): Commit is now a scheduler trait, only used externally in the compactor_test_utils

* feat(idpe-17789): Propagate errors pertaining to commit, in both the scheduler and the compactor.

* feat(idpe-17789): PartitionDoneSink should have different crate-private traits for scheduler versus comactor.

* feat(idpe-17789): PartitionDoneSink should propagate errors

* test(idpe-17789): integration tests suite

* test(idpe-17789): test documenting what skip request does (as outcome)

* refactor(idpe-17789): make the validate of the upgrade commit, versus replacement commit, more explicit.

* feat(idpe-17789): switch to using parking_lot Mutex within the scheduler
2023-07-24 12:01:28 -07:00
Joe-Blount acf9da2336
fix: detect empty list in compactor before assert (#8323) 2023-07-24 15:02:47 +00:00
Joe-Blount 968a0fc574
Merge branch 'main' into jrb_69_smooth_rate_limiter 2023-07-24 08:52:55 -05:00
dependabot[bot] cd31492e5b
chore(deps): Bump async-trait from 0.1.71 to 0.1.72 (#8317)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.71 to 0.1.72.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.71...0.1.72)

---
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>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-24 10:07:18 +00:00
Joe-Blount 7622358518 fix: avoid compacting 1 L0 to 1 L0 file (stuck looping) 2023-07-21 13:55:04 -05:00
Joe-Blount 1a62d2e4e7 chore: improve rate limiter accuracy 2023-07-21 11:22:36 -05:00
Joe-Blount 1bed99567c
chore: add DF metrics to compaction spans (#8270)
* chore: add DF metrics to compaction spans

* chore: update string for test verification

* chore: update comment

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-20 15:00:22 +00:00
Marco Neumann 0173c50ba1
fix: use correct error code when querier is shutting down (#8282)
When a long running query is in process and the querier is shutting
down, it might happen that the executor (= thread pool and tokio
executor responsible for the CPU-bound DataFusion execution) is shut
down while the query is running. From a "systems interaction" PoV I
think this is totally fine and I would like to avoid some weird
ref-counting. Or in other words: if the system is shutting down, shut it
down.

However the error was treated as "internal" which is not useful. The
client should rather be informed that its server was gone and that it is
OK (and desired) to retry. So as per
<https://grpc.github.io/grpc/core/md_doc_statuscodes.html> I think this
should signal "unavailable".

This change wires the error code in such a way that the gRPC service
layer can properly inspect it and then changes the error mapping.

Ref https://github.com/influxdata/idpe/issues/17917 .

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-07-20 12:08:22 +00:00
Joe-Blount 4c5c2473e6 chore: move scratchpad cleanup earlier 2023-07-19 10:16:28 -05:00
Joe-Blount 69e4f998dd fix: chunk up high plan counts in the compactor 2023-07-18 15:16:04 -05:00
Joe-Blount 85a9e13262
Merge branch 'main' into jrb_63_compactor_spans 2023-07-17 09:52:27 -05:00
kodiakhq[bot] ebba032399
Merge branch 'main' into cn/all-over-again 2023-07-17 14:46:48 +00:00
Carol (Nichols || Goulding) cf046d0b3e
refactor: Extract a from implementation for creating TransitionPartitionId 2023-07-17 10:34:01 -04:00
Carol (Nichols || Goulding) a9b788b58f
feat: Collate chunks based on their partition hash id if they have it 2023-07-17 10:34:01 -04:00
Joe-Blount bba0685c59 Merge remote-tracking branch 'origin/main' into jrb_64_add_test_case 2023-07-17 09:16:13 -05:00
Joe-Blount 190bc41ca4 chore: comment spelling 2023-07-17 09:14:55 -05:00