Skip to content

Commit

Permalink
WIP: Compaction planning in metastore (#3427)
Browse files Browse the repository at this point in the history
* First iteration of compaction planning in metastore

* Second iteration of compaction planning in metastore

* Add GetCompactionJobs back

* Create and persist jobs in the same transaction as blocks

* Add simple logging for compaction planning

* Fix bug

* Remove unused proto message

* Remove unused raft command type

* Add a simple config for compaction planning
  • Loading branch information
aleks-p authored Jul 16, 2024
1 parent 5d9a4ec commit 8371c57
Show file tree
Hide file tree
Showing 14 changed files with 547 additions and 248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ message CompactionJob {
CompactionOptions options = 2;
// List of the input blocks.
repeated metastore.v1.BlockMeta blocks = 3;
CompactionJobStatus status = 4;
}

message CompactionOptions {
Expand All @@ -58,7 +59,6 @@ message UpdateJobStatusRequest {
}

message CompactionJobStatus {
string name = 1;
// Status update allows the planner to keep
// track of the job ownership and compaction
// progress:
Expand All @@ -72,8 +72,8 @@ message CompactionJobStatus {
// or cancels the compaction job.
//
// Partial results/status is not allowed.
CompactionStatus status = 2;
CompletedJob completed_job = 3;
CompactionStatus status = 1;
CompletedJob completed_job = 2;
}

enum CompactionStatus {
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/openapiv2/gen/phlare.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@
"$ref": "#/definitions/v1BlockMeta"
},
"description": "List of the input blocks."
},
"status": {
"$ref": "#/definitions/v1CompactionJobStatus"
}
},
"description": "One compaction job may result in multiple output blocks."
Expand All @@ -671,9 +674,6 @@
"v1CompactionJobStatus": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"status": {
"$ref": "#/definitions/v1CompactionStatus",
"description": "Status update allows the planner to keep\ntrack of the job ownership and compaction\nprogress:\n- If the job status is other than IN_PROGRESS,\n the ownership of the job is revoked.\n- FAILURE must only be sent if the failure is\n persistent and the compaction can't be accomplished.\n- completed_job must be empty if the status is\n other than SUCCESS, and vice-versa.\n- UNSPECIFIED must be sent if the worker rejects\n or cancels the compaction job.\n\nPartial results/status is not allowed."
Expand Down
Loading

0 comments on commit 8371c57

Please sign in to comment.