Skip to content

Conversation

@zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Jul 15, 2025

What this PR does:

This is an alternative approach to the same issue described in #5405.

Here we fix the race by keeping track of the recent jobs which were created and their blocks. This cache is used to skip blocks on the block selector from being considered. Once the next blockselector is called, we use the job list to identify what cache needs to be pruned. This allows a small delay between when the compaction provider created the job and when the scheduler assigns the job, but without the additional overhead of looping through the work list as proposed in #5405.

Which issue(s) this PR fixes:
Fixes #5405

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@zalegrala zalegrala force-pushed the compactionProviderSkipRecentBlocks branch from 8f33b52 to 1173b8d Compare July 18, 2025 13:34
@zalegrala zalegrala marked this pull request as ready for review July 18, 2025 14:08
@zalegrala zalegrala merged commit 80881d3 into grafana:main Jul 18, 2025
22 checks passed
@zalegrala zalegrala deleted the compactionProviderSkipRecentBlocks branch July 18, 2025 18:59
knylander-grafana pushed a commit to knylander-grafana/tempo-doc-work that referenced this pull request Jul 18, 2025
…on provider (grafana#5409)

* [backend-scheduler] fix race condition between scheduler and compaction provider

* Protect the recentJobs map with a mutex

* Renames for clarity

* Convert map values to UUIDs for less conversion

* Validate the prune age is twice the compaction cycle

* Validate the measurement interval is sufficiently fast

* Fix test for UUID change and config validation

* Update integration test for change in behavior

* Reduce channel size by removing duplciate initialization

* Simplify append loop

* Give a little more time

* Reword the validation error

* Record the job before its sent

* Update integration test notes

* Update changelog

* Update config after rebase

* Update test config after rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants