grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
10.13k stars 614 forks source link

feat: improve compaction job state management #3519

Closed aleks-p closed 3 months ago

aleks-p commented 3 months ago

The main change here is how we update the state of compaction jobs, in particular when workers are polling with state updates and ask for jobs.

The current implementation intermixes the persistence (boltdb) and in-memory state updates. This causes a few cases where an error could leave the 2 storage layers in an inconsistent state.

The new implementation does everything in memory first and constructs a list of items that need to be durably stored. If we fail to durably store something or otherwise end up in an unexpected state while persisting, the application will panic.

Bonus: