Repository navigation
feat(jobsdb): migration optimizations for large number of datasets - #6786
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6786 +/- ##
==========================================
- Coverage 80.08% 79.69% -0.39%
==========================================
Files 565 565
Lines 63274 63293 +19
==========================================
- Hits 50670 50439 -231
- Misses 9610 9875 +265
+ Partials 2994 2979 -15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔒 Scanned for secrets using gitleaks 8.30.0
🔒 Scanned for secrets using gitleaks 8.30.0
🔒 Scanned for secrets using gitleaks 8.30.0
atzoum
force-pushed
the
feat.jobsdbMigrateFrom
branch
from
March 23, 2026 08:50
8c28711 to
c7016af
Compare
ktgowtham
reviewed
Mar 23, 2026
ktgowtham
approved these changes
Mar 23, 2026
mihir20
approved these changes
Mar 23, 2026
This was referenced Mar 30, 2026
Closed
itsmihir
pushed a commit
that referenced
this pull request
Mar 30, 2026
🤖 I have created a release *beep* *boop* --- ## [1.72.0-rc.1](v1.71.0...v1.72.0-rc.1) (2026-03-30) ### Features * **jobsdb:** migration optimizations for large number of datasets ([#6786](#6786)) ([641f9fd](641f9fd)) ### Bug Fixes * language label ([#6809](#6809)) ([ac501c8](ac501c8)) * mirroring round trip comparison ([#6813](#6813)) ([57a079b](57a079b)) ### Miscellaneous * partition migration stress test and improvements ([#6802](#6802)) ([419818a](419818a)) * sync release v1.71.0 to main branch ([#6801](#6801)) ([6a6ee90](6a6ee90)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
This was referenced Mar 30, 2026
Merged
itsmihir
pushed a commit
that referenced
this pull request
Mar 30, 2026
🤖 I have created a release *beep* *boop* --- ## [1.72.0-rc.2](v1.71.0...v1.72.0-rc.2) (2026-03-30) ### Features * **jobsdb:** migration optimizations for large number of datasets ([#6786](#6786)) ([641f9fd](641f9fd)) ### Bug Fixes * language label ([#6809](#6809)) ([ac501c8](ac501c8)) * mirroring round trip comparison ([#6813](#6813)) ([57a079b](57a079b)) * sanity checks ([#6817](#6817)) ([2969e3e](2969e3e)) ### Miscellaneous * partition migration stress test and improvements ([#6802](#6802)) ([419818a](419818a)) * sync release v1.71.0 to main branch ([#6801](#6801)) ([6a6ee90](6a6ee90)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir
pushed a commit
that referenced
this pull request
Mar 31, 2026
🤖 I have created a release *beep* *boop* --- ## [1.72.0](v1.71.0...v1.72.0) (2026-03-30) ### Features * **jobsdb:** migration optimizations for large number of datasets ([#6786](#6786)) ([641f9fd](641f9fd)) ### Bug Fixes * language label ([#6809](#6809)) ([ac501c8](ac501c8)) * mirroring round trip comparison ([#6813](#6813)) ([57a079b](57a079b)) * sanity checks ([#6817](#6817)) ([2969e3e](2969e3e)) ### Miscellaneous * partition migration stress test and improvements ([#6802](#6802)) ([419818a](419818a)) * sync release v1.71.0 to main branch ([#6801](#6801)) ([6a6ee90](6a6ee90)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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
Problem
doMigrateDScallsgetMigrationListtwice: once optimistically before acquiringdsMigrationLock, and once authoritatively under the lock. Each call iterates datasets left-to-right, running a SQL query per dataset viacheckIfMigrateDS. With many datasets, the second call is expensive because it holds the write lock — blocking all readers (GetJobs,UpdateJobStatus).Additionally, across migration loop iterations, scanning always restarts from dataset 0 even if the previous iteration already probed those datasets and found them ineligible.
Solution
Intra-invocation skip: The first (optimistic) call records the
firstEligibledataset it finds. The second call under the lock skips all datasets before that point usingdsindex.Lesscomparisons, avoiding redundantcheckIfMigrateDSqueries while holding the write lock.Cross-invocation resume: When
getMigrationListexhausts themaxMigrateDSProbelimit without finding eligible datasets, it saves the last probed dataset index. The next migration loop iteration resumes from there instead of re-scanning from the beginning. The resume point is reset unless the probe hits the limit with no eligible datasets again.Linear Ticket
resolves PIPE-2853
Security