Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat.compactLock #7021 +/- ##
====================================================
- Coverage 79.41% 79.41% -0.01%
====================================================
Files 567 567
Lines 64683 64683
====================================================
- Hits 51369 51366 -3
- Misses 10256 10261 +5
+ Partials 3058 3056 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
atzoum
force-pushed
the
feat.compactLockEnabled
branch
2 times, most recently
from
May 30, 2026 13:56
8b7e437 to
c9db23f
Compare
1 task done
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 30, 2026 14:13
c9db23f to
db2d474
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 10:19
db2d474 to
d455bf7
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 11:12
d455bf7 to
3946c79
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 11:12
3946c79 to
51cb9b9
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 11:12
51cb9b9 to
741dd59
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 12:31
741dd59 to
d8d57ff
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
May 31, 2026 12:35
d8d57ff to
cf3b79c
Compare
This was referenced Jun 2, 2026
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
June 2, 2026 13:20
cf3b79c to
71818a3
Compare
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
June 3, 2026 06:08
71818a3 to
73b87e2
Compare
…ale ds error while updating job statuses
🔒 Scanned for secrets using gitleaks 8.30.1 chore: timed lock
atzoum
force-pushed
the
feat.compactLockEnabled
branch
from
June 3, 2026 07:36
73b87e2 to
64089b0
Compare
atzoum
added a commit
that referenced
this pull request
Jun 3, 2026
…ale ds error while updating job statuses (#7024) # Description When updating job statuses, if a background compaction/migration has changed the dataset (DS) layout, the update hits a stale DS list (`ErrStaleDsList`) and retries. Previously the retry re-read the DS list **from the database**, which needs a connection from the main pool — so under high concurrency (in-flight updaters ≥ pool size) every connection is already in use, leaving none to perform the refresh, which can stall the whole update path. The in-memory DS list cache is already kept up to date by the compaction/migration loop, so the retry doesn't need to touch the database. We now refresh from that cached snapshot under a read lock instead, removing the connection requirement from the retry path entirely. ## Benchmark A new `compaction` jobsdb bench scenario (`TestBench/compaction`) drains a read-write jobsdb seeded with 2M jobs (20 datasets × 100K, 3KB payload) across 100 destinations, using 100 consumer goroutines against a pool of 80 connections, and measures the time for all consumers to fully drain. It is also used to compare the available compaction strategies under an identical workload. Run it with: ```bash RUN_COMPACTION_BENCH=1 GOMAXPROCS=2 go test ./jobsdb/bench/ -run 'TestBench/compaction' -v -timeout 30m ``` Drain time for 2M jobs (lower is better): | Scenario | Time | vs. baseline | | --------------------------------- | ------------ | ------------ | | baseline (blocking compaction) | 2m56.6s | — | | nonBlockingCompletedDSDrop | 2m10.9s | −25.9% | | nonBlockingCompaction | 1m54.8s | −35.0% | ## Linear Ticket resolves PIPE-2997 ## Security - [x] The code changed/added as part of this pull request won't create any security issues with how the software is being used. <!-- GitButler Footer Boundary Top --> --- This is **part 1 of 4 in a stack** made with GitButler: - <kbd> 4 </kbd> #7038 - <kbd> 3 </kbd> #7021 - <kbd> 2 </kbd> #7020 - <kbd> 1 </kbd> #7024 👈 <!-- GitButler Footer Boundary Bottom -->
atzoum
added a commit
that referenced
this pull request
Jun 3, 2026
# Description During non-blocking compaction, the source job status table is locked `EXCLUSIVE` early, before jobs are copied to the destination. Because the job copy includes the (potentially large) `event_payload`, the bulk of the lock window is spent moving data that does not actually need the lock — status updates for jobs in that dataset are blocked for the whole copy. This PR adds an opt-in mode (`compactionDeferStatusLock`, off by default) that splits the copy into two phases: 1. **Copy pending jobs first, with no status lock held** — the slow, payload-heavy work. 2. **Then lock each source status table one after another** only to copy the latest statuses of the jobs that were moved. The result is that the status-table lock window shrinks to roughly the (small, payload-free) status copy, minimizing how long status updates are blocked. As a side-effect, jobs that complete between the two phases are still moved to the new table (now carrying their terminal status). These few extra completed rows will get reclaimed on the next compaction. #7021 runs all tests with this feature enabled ## Benchmark Deferring the status lock shaves a further ~12% off `nonBlockingCompaction` alone. Run it with: ```bash RUN_COMPACTION_BENCH=1 GOMAXPROCS=2 go test ./jobsdb/bench/ -run 'TestBench/compaction' -v -timeout 30m ``` Drain time for 2M jobs (lower is better): | Scenario | Time | vs. baseline | | ------------------------------------------ | --------- | ------------ | | baseline (blocking compaction) | 2m56.6s | — | | nonBlockingCompletedDSDrop | 2m10.9s | −25.9% | | nonBlockingCompaction | 1m54.8s | −35.0% | | nonBlockingCompaction + deferStatusLock | 1m40.7s | −43.0% | ## Linear Ticket resolves PIPE-3064 ## Security - [x] The code changed/added as part of this pull request won't create any security issues with how the software is being used. <!-- GitButler Footer Boundary Top --> --- This is **part 2 of 4 in a stack** made with GitButler: - <kbd> 4 </kbd> #7038 - <kbd> 3 </kbd> #7021 - <kbd> 2 </kbd> #7020 👈 - <kbd> 1 </kbd> #7024 <!-- GitButler Footer Boundary Bottom -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Running all tests with
nonBlockingCompaction: true&compactionDeferStatusLock: trueSecurity
This is part 3 of 4 in a stack made with GitButler: