Repository navigation
feat(jobsdb): versioned dataset list and non-blocking drop for completed datasets - #6962
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6962 +/- ##
==========================================
+ Coverage 80.02% 80.08% +0.06%
==========================================
Files 565 566 +1
Lines 63703 64006 +303
==========================================
+ Hits 50978 51261 +283
- Misses 9690 9705 +15
- Partials 3035 3040 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
2 times, most recently
from
May 15, 2026 15:42
36a773d to
10db25a
Compare
atzoum
commented
May 15, 2026
| func (jd *Handle) doCleanup(ctx context.Context) error { | ||
| if err := jd.abortOldJobs(ctx, jd.getDSList()); err != nil { | ||
| // doCleanup performs cleanup of old jobs and journal entries. It requires a ds list lock token to ensure that the list does not change during the cleanup process. | ||
| func (jd *Handle) doCleanup(ctx context.Context, l lock.LockToken) error { |
Contributor
Author
There was a problem hiding this comment.
Note: modifying this method's signature to highlight that it can only be called with a ds list lock already acquired
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
5 times, most recently
from
May 18, 2026 06:43
ea1d584 to
74b8f5f
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
2 times, most recently
from
May 18, 2026 12:21
a787530 to
60c3305
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 19, 2026 05:53
41ec5dd to
f8d3731
Compare
atzoum
force-pushed
the
feat.storeDsListLock
branch
from
May 19, 2026 06:03
a6d3749 to
586a7fa
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
3 times, most recently
from
May 19, 2026 10:38
9658f78 to
a9611aa
Compare
atzoum
force-pushed
the
feat.storeDsListLock
branch
from
May 19, 2026 11:43
586a7fa to
19df09b
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 19, 2026 11:43
a9611aa to
7ec2506
Compare
This was referenced May 19, 2026
atzoum
force-pushed
the
feat.storeDsListLock
branch
from
May 20, 2026 14:09
19df09b to
3655142
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 20, 2026 14:09
7ec2506 to
956a3c5
Compare
atzoum
force-pushed
the
feat.storeDsListLock
branch
from
May 21, 2026 07:08
3655142 to
ac6689e
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 21, 2026 07:08
956a3c5 to
5522db6
Compare
atzoum
force-pushed
the
feat.storeDsListLock
branch
from
May 22, 2026 13:57
ac6689e to
9ca950c
Compare
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 22, 2026 13:57
5522db6 to
23d3f8f
Compare
atzoum
added a commit
that referenced
this pull request
May 22, 2026
🔒 Scanned for secrets using gitleaks 8.30.1 # Description `jobsdb` currently retains the `dsList` read lock for the full duration of the store callback. As a result, long-running store transactions can block `dsList` writers (`addNewDS`, `migrateDSLoop`). Once a writer begins waiting on the write lock, new `dsList` readers may also become blocked. Therefore, we are now snapshoting the last dataset under the read lock and release the lock immediately, so the store transaction can take as long as it needs without holding dsList writers back. If this turns out to cause regressions in production, the new reloadable config `jobsDB.holdDSListLockDuringStore` (default `false`) reverts to the previous hold-the-lock-throughout behavior, so no redeployment is required. ## Uncovered latent bugs Releasing the read lock early exposed two latent bugs in existing tests: 1. **`WithStoreSafeTxFromTx` couldn't retry on a stale ds.** When the caller owned the outer `*Tx` and the store returned `errStaleDsList`, the savepoint inside `doStoreJobsInTx` was never rolled back. The retry inherited an aborted savepoint and the whole transaction failed. Fixed by rolling back to the savepoint before returning `ErrStaleDsList`. 2. **The JSON sanitize path was missing the same stale-ds handling.** Once the rollback was in place, it became obvious that the post-sanitize `store()` retry could itself hit the read-only table and was not handling it either. `doStoreJobsInTx` is now a single loop that handles both conditions uniformly; the sanitize retry still runs at most once. ## Bonus - `inStoreSafeCtx` no longer logs stale-ds at error level, since it's an expected retryable condition, not a failure. - When many goroutines hit a stale ds at the same time (which is exactly what happens during a dataset swap), only the first one to grab the dsList write lock actually refreshes. The rest see that the last dataset has already moved past the one they failed on and skip the refresh, going straight back to the retry. This avoids a thundering herd of redundant refreshes. ## Linear Ticket resolves PIPE-2993 ## 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> #6979 - <kbd> 3 </kbd> #6967 - <kbd> 2 </kbd> #6962 - <kbd> 1 </kbd> #6963 👈 <!-- GitButler Footer Boundary Bottom -->
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 22, 2026 16:01
23d3f8f to
ec97bab
Compare
atzoum
marked this pull request as ready for review
May 22, 2026 16:01
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 25, 2026 06:01
ec97bab to
86a42ac
Compare
ktgowtham
approved these changes
May 25, 2026
ktgowtham
left a comment
Contributor
There was a problem hiding this comment.
LGTM, but added a minor comment. not sure if it has any risk.
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
2 times, most recently
from
May 25, 2026 12:33
76315e1 to
8c148ce
Compare
…ted datasets 🔒 Scanned for secrets using gitleaks 8.30.1
atzoum
force-pushed
the
feat.nonBlockingDsDrop
branch
from
May 25, 2026 12:58
8c148ce to
5ae095c
Compare
mihir20
approved these changes
May 25, 2026
atzoum
added a commit
that referenced
this pull request
May 26, 2026
# Description Syncing release v1.76.0 to main branch **WARNING: Do NOT rewrite git history and ALWAYS use a "Merge Commit" for merging!** **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix: flaky cluster test (#7003) chore: remove deprecated bulkStatusEnabled flag for snowpipe streaming (#6992) feat(jobsdb): versioned dataset list and non-blocking drop for completed datasets (#6962) END_COMMIT_OVERRIDE
atzoum
added a commit
that referenced
this pull request
May 26, 2026
🔒 Scanned for secrets using gitleaks 8.30.1 # Description Introduces a non-blocking compaction flow for the jobsdb migration loop, gated behind the `nonBlockingCompaction` flag. When enabled it dramatically shrinks the lock window taken during dataset migration: - **`dsMigrationLock` is no longer taken.** Concurrent readers (`getJobs`, `GetPileUpCounts`, `GetDistinctParameterValues`) are not blocked by an in-flight compaction. - **Caveat:** an `UpdateJobStatus` call that targets a source dataset *while it is being compacted* will block at the PG level on the `EXCLUSIVE` lock held against that source's status table, until the compaction TX commits — bounded by the per-source `COPY` duration. After commit, late writers landing on the old status table are fenced by the readonly trigger and routed to the new destination via the existing `ErrStaleDsList` retry path. Compared to the legacy path, the writer side of `dsListLock` is reduced from "entire migration TX, including bulk `COPY` of all non-terminal jobs and `DROP TABLE` of every source" down to "`COMMIT` + a single `getDSList` + a `MIN/MAX` scan of the new destination". ## New maintenance pool Introducing a new maintenance pool which can be used by maintenance operations, such as: - adding new dataset - refreshing dataset list - compacting datasets - compacting job status tables This pool helps closing a connection-pool deadlock vector where jobsdb readers and writers could fully exhaust the pool, blocking an active maintenance goroutine while it still held a mutex (e.g. post-commit compaction which requires acquiring a new connection to refresh the dataset list). In addition, all maintenance goroutines were updated to ensure they require no more than a single connection at any time, eliminating pool-related deadlock risks caused by previously nested connection usage. If no maintenance pool is injected, the calls fall back to `dbHandle` (backwards compatibility). ## Lock stats `dsListLock` and `dsMigrationLock` now emit timing metrics, tagged by lock type (`read`/`write`) and whether the acquisition was async: | Metric | Description | |---|---| | `jobsdb_lock_wait_time` | Time spent waiting to acquire the lock | | `jobsdb_lock_time` | Time the lock was held (excluding wait) | | `jobsdb_lock_total_time` | End-to-end time (wait + hold) | All metrics carry a `name` tag so lock contention can be tracked per jobsdb instance. ## Flags - `JobsDB.<prefix>.nonBlockingCompaction` (default `false`) — gates the new flow. When off, `doMigrateDS` falls back to the legacy in-TX migrate+drop path. - `JobsDB.<prefix>.getJobsRetryOnCompaction` (default `true`) — gates the `getJobs` snapshot revalidation. When on, if a dataset that `getJobs` queried was compacted mid-read, the call returns `ErrStaleDsList` and is retried against the freshly published list. **Why:** while `getJobs` is reading the source's status table, an `UpdateJobStatus` for one of the same jobs could commit against the new dataset. Without the retry, `getJobs` would miss that status update, risking out-of-order processing downstream. This option has no effect unless `nonBlockingCompaction` is also on. ## Testing #6979 runs all tests with non-blocking partition migration enabled ## 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 3 of 4 in a stack** made with GitButler: - <kbd> 4 </kbd> #6979 - <kbd> 3 </kbd> #6967 👈 - <kbd> 2 </kbd> #6962 - <kbd> 1 </kbd> #6963 <!-- GitButler Footer Boundary Bottom -->
This was referenced Jun 8, 2026
Closed
itsmihir
pushed a commit
that referenced
this pull request
Jun 8, 2026
🤖 I have created a release *beep* *boop* --- ## [1.77.0-rc.1](v1.76.0...v1.77.0-rc.1) (2026-06-08) ### Features * **jobsdb:** deferred status table lock during compaction ([#7020](#7020)) ([d156057](d156057)) * **jobsdb:** non-blocking dataset compaction ([#6967](#6967)) ([e0838dc](e0838dc)) * **jobsdb:** versioned dataset list and non-blocking drop for completed datasets ([#6962](#6962)) ([d7fe1ae](d7fe1ae)) ### Bug Fixes * flaky cluster test ([#7003](#7003)) ([d7fe1ae](d7fe1ae)) * **jobsdb:** pq 42P01 error when trying to store to a dataset that has been dropped ([#7041](#7041)) ([9db406d](9db406d)) * server panics with sql database is closed in case of an etcd error ([#7023](#7023)) ([15dc39a](15dc39a)) * support scoped batchrouter datePrefixOverride ([#7037](#7037)) ([9e8a0a8](9e8a0a8)) ### Miscellaneous * capture scheduler lag in stats ([#7017](#7017)) ([0dcf2b4](0dcf2b4)) * **deps:** bump actions/create-github-app-token from 3.0.0 to 3.1.1 ([#6969](#6969)) ([ee7f735](ee7f735)) * **deps:** bump actions/create-github-app-token from 3.1.1 to 3.2.0 ([#7013](#7013)) ([ac5681b](ac5681b)) * **deps:** bump actions/labeler from 5.0.0 to 6.1.0 ([#6970](#6970)) ([e748b86](e748b86)) * **deps:** bump actions/stale from 10.2.0 to 10.3.0 ([#7031](#7031)) ([6cf6804](6cf6804)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.4 to 2.1.5 ([#6972](#6972)) ([e38a99d](e38a99d)) * **deps:** bump aws-actions/configure-aws-credentials from 5.0.0 to 6.1.1 ([#6971](#6971)) ([1114b7f](1114b7f)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.1 to 6.1.2 ([#7049](#7049)) ([e210e68](e210e68)) * **deps:** bump codecov/codecov-action from 6.0.0 to 6.0.1 ([#7016](#7016)) ([3d639f5](3d639f5)) * **deps:** bump docker/login-action from 4.1.0 to 4.2.0 ([#7035](#7035)) ([b39183b](b39183b)) * **deps:** bump docker/metadata-action from 6.0.0 to 6.1.0 ([#7032](#7032)) ([574f7c8](574f7c8)) * **deps:** bump docker/setup-buildx-action from 4.0.0 to 4.1.0 ([#7034](#7034)) ([ff49009](ff49009)) * **deps:** bump golangci/golangci-lint-action from 8.0.0 to 9.2.1 ([#7044](#7044)) ([56070dc](56070dc)) * **deps:** bump slackapi/slack-github-action from 3.0.1 to 3.0.3 ([#6968](#6968)) ([fd70e60](fd70e60)) * **deps:** bump step-security/harden-runner from 2.19.1 to 2.19.3 ([#7012](#7012)) ([b4dc9b2](b4dc9b2)) * **deps:** bump step-security/harden-runner from 2.19.3 to 2.19.4 ([#7033](#7033)) ([ba82100](ba82100)) * **jobsdb:** avoid refreshing ds list from database in case of a stale ds error while updating job statuses ([#7024](#7024)) ([de98ede](de98ede)) * **jobsdb:** lateral join for getting jobs ([#7007](#7007)) ([7148a30](7148a30)) * remove deprecated bulkStatusEnabled flag for snowpipe streaming ([#6992](#6992)) ([d7fe1ae](d7fe1ae)) --- 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 Jun 8, 2026
Closed
atzoum
pushed a commit
that referenced
this pull request
Jun 8, 2026
🤖 I have created a release *beep* *boop* --- ## [1.77.0-rc.2](v1.76.0...v1.77.0-rc.2) (2026-06-08) ### Features * **jobsdb:** deferred status table lock during compaction ([#7020](#7020)) ([d156057](d156057)) * **jobsdb:** non-blocking dataset compaction ([#6967](#6967)) ([e0838dc](e0838dc)) * **jobsdb:** versioned dataset list and non-blocking drop for completed datasets ([#6962](#6962)) ([d7fe1ae](d7fe1ae)) ### Bug Fixes * flaky cluster test ([#7003](#7003)) ([d7fe1ae](d7fe1ae)) * **jobsdb:** pq 42P01 error when trying to store to a dataset that has been dropped ([#7041](#7041)) ([9db406d](9db406d)) * **jobsdb:** stale table count gauge after dropping dataset async ([#7063](#7063)) ([4abb293](4abb293)) * server panics with sql database is closed in case of an etcd error ([#7023](#7023)) ([15dc39a](15dc39a)) * support scoped batchrouter datePrefixOverride ([#7037](#7037)) ([9e8a0a8](9e8a0a8)) ### Miscellaneous * capture scheduler lag in stats ([#7017](#7017)) ([0dcf2b4](0dcf2b4)) * **deps:** bump actions/create-github-app-token from 3.0.0 to 3.1.1 ([#6969](#6969)) ([ee7f735](ee7f735)) * **deps:** bump actions/create-github-app-token from 3.1.1 to 3.2.0 ([#7013](#7013)) ([ac5681b](ac5681b)) * **deps:** bump actions/labeler from 5.0.0 to 6.1.0 ([#6970](#6970)) ([e748b86](e748b86)) * **deps:** bump actions/stale from 10.2.0 to 10.3.0 ([#7031](#7031)) ([6cf6804](6cf6804)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.4 to 2.1.5 ([#6972](#6972)) ([e38a99d](e38a99d)) * **deps:** bump aws-actions/configure-aws-credentials from 5.0.0 to 6.1.1 ([#6971](#6971)) ([1114b7f](1114b7f)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.1 to 6.1.2 ([#7049](#7049)) ([e210e68](e210e68)) * **deps:** bump codecov/codecov-action from 6.0.0 to 6.0.1 ([#7016](#7016)) ([3d639f5](3d639f5)) * **deps:** bump docker/login-action from 4.1.0 to 4.2.0 ([#7035](#7035)) ([b39183b](b39183b)) * **deps:** bump docker/metadata-action from 6.0.0 to 6.1.0 ([#7032](#7032)) ([574f7c8](574f7c8)) * **deps:** bump docker/setup-buildx-action from 4.0.0 to 4.1.0 ([#7034](#7034)) ([ff49009](ff49009)) * **deps:** bump golangci/golangci-lint-action from 8.0.0 to 9.2.1 ([#7044](#7044)) ([56070dc](56070dc)) * **deps:** bump slackapi/slack-github-action from 3.0.1 to 3.0.3 ([#6968](#6968)) ([fd70e60](fd70e60)) * **deps:** bump step-security/harden-runner from 2.19.1 to 2.19.3 ([#7012](#7012)) ([b4dc9b2](b4dc9b2)) * **deps:** bump step-security/harden-runner from 2.19.3 to 2.19.4 ([#7033](#7033)) ([ba82100](ba82100)) * **jobsdb:** avoid refreshing ds list from database in case of a stale ds error while updating job statuses ([#7024](#7024)) ([de98ede](de98ede)) * **jobsdb:** lateral join for getting jobs ([#7007](#7007)) ([7148a30](7148a30)) * remove deprecated bulkStatusEnabled flag for snowpipe streaming ([#6992](#6992)) ([d7fe1ae](d7fe1ae)) --- 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 Jun 8, 2026
Merged
atzoum
pushed a commit
that referenced
this pull request
Jun 8, 2026
🤖 I have created a release *beep* *boop* --- ## [1.77.0-rc.3](v1.76.0...v1.77.0-rc.3) (2026-06-08) ### Features * **jobsdb:** deferred status table lock during compaction ([#7020](#7020)) ([d156057](d156057)) * **jobsdb:** non-blocking dataset compaction ([#6967](#6967)) ([e0838dc](e0838dc)) * **jobsdb:** versioned dataset list and non-blocking drop for completed datasets ([#6962](#6962)) ([d7fe1ae](d7fe1ae)) ### Bug Fixes * flaky cluster test ([#7003](#7003)) ([d7fe1ae](d7fe1ae)) * **jobsdb:** jobsdb_lock_total_time for dsMigrationLock missing ([#7066](#7066)) ([7e00370](7e00370)) * **jobsdb:** pq 42P01 error when trying to store to a dataset that has been dropped ([#7041](#7041)) ([9db406d](9db406d)) * **jobsdb:** stale table count gauge after dropping dataset async ([#7063](#7063)) ([4abb293](4abb293)) * server panics with sql database is closed in case of an etcd error ([#7023](#7023)) ([15dc39a](15dc39a)) * support scoped batchrouter datePrefixOverride ([#7037](#7037)) ([9e8a0a8](9e8a0a8)) ### Miscellaneous * capture scheduler lag in stats ([#7017](#7017)) ([0dcf2b4](0dcf2b4)) * **deps:** bump actions/create-github-app-token from 3.0.0 to 3.1.1 ([#6969](#6969)) ([ee7f735](ee7f735)) * **deps:** bump actions/create-github-app-token from 3.1.1 to 3.2.0 ([#7013](#7013)) ([ac5681b](ac5681b)) * **deps:** bump actions/labeler from 5.0.0 to 6.1.0 ([#6970](#6970)) ([e748b86](e748b86)) * **deps:** bump actions/stale from 10.2.0 to 10.3.0 ([#7031](#7031)) ([6cf6804](6cf6804)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.4 to 2.1.5 ([#6972](#6972)) ([e38a99d](e38a99d)) * **deps:** bump aws-actions/configure-aws-credentials from 5.0.0 to 6.1.1 ([#6971](#6971)) ([1114b7f](1114b7f)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.1 to 6.1.2 ([#7049](#7049)) ([e210e68](e210e68)) * **deps:** bump codecov/codecov-action from 6.0.0 to 6.0.1 ([#7016](#7016)) ([3d639f5](3d639f5)) * **deps:** bump docker/login-action from 4.1.0 to 4.2.0 ([#7035](#7035)) ([b39183b](b39183b)) * **deps:** bump docker/metadata-action from 6.0.0 to 6.1.0 ([#7032](#7032)) ([574f7c8](574f7c8)) * **deps:** bump docker/setup-buildx-action from 4.0.0 to 4.1.0 ([#7034](#7034)) ([ff49009](ff49009)) * **deps:** bump golangci/golangci-lint-action from 8.0.0 to 9.2.1 ([#7044](#7044)) ([56070dc](56070dc)) * **deps:** bump slackapi/slack-github-action from 3.0.1 to 3.0.3 ([#6968](#6968)) ([fd70e60](fd70e60)) * **deps:** bump step-security/harden-runner from 2.19.1 to 2.19.3 ([#7012](#7012)) ([b4dc9b2](b4dc9b2)) * **deps:** bump step-security/harden-runner from 2.19.3 to 2.19.4 ([#7033](#7033)) ([ba82100](ba82100)) * **jobsdb:** avoid refreshing ds list from database in case of a stale ds error while updating job statuses ([#7024](#7024)) ([de98ede](de98ede)) * **jobsdb:** lateral join for getting jobs ([#7007](#7007)) ([7148a30](7148a30)) * remove deprecated bulkStatusEnabled flag for snowpipe streaming ([#6992](#6992)) ([d7fe1ae](d7fe1ae)) --- 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
Jun 9, 2026
🤖 I have created a release *beep* *boop* --- ## [1.77.0](v1.76.0...v1.77.0) (2026-06-08) ### Features * **jobsdb:** deferred status table lock during compaction ([#7020](#7020)) ([d156057](d156057)) * **jobsdb:** non-blocking dataset compaction ([#6967](#6967)) ([e0838dc](e0838dc)) * **jobsdb:** versioned dataset list and non-blocking drop for completed datasets ([#6962](#6962)) ([d7fe1ae](d7fe1ae)) ### Bug Fixes * flaky cluster test ([#7003](#7003)) ([d7fe1ae](d7fe1ae)) * **jobsdb:** jobsdb_lock_total_time for dsMigrationLock missing ([#7066](#7066)) ([7e00370](7e00370)) * **jobsdb:** pq 42P01 error when trying to store to a dataset that has been dropped ([#7041](#7041)) ([9db406d](9db406d)) * **jobsdb:** stale table count gauge after dropping dataset async ([#7063](#7063)) ([4abb293](4abb293)) * server panics with sql database is closed in case of an etcd error ([#7023](#7023)) ([15dc39a](15dc39a)) * support scoped batchrouter datePrefixOverride ([#7037](#7037)) ([9e8a0a8](9e8a0a8)) ### Miscellaneous * capture scheduler lag in stats ([#7017](#7017)) ([0dcf2b4](0dcf2b4)) * **deps:** bump actions/create-github-app-token from 3.0.0 to 3.1.1 ([#6969](#6969)) ([ee7f735](ee7f735)) * **deps:** bump actions/create-github-app-token from 3.1.1 to 3.2.0 ([#7013](#7013)) ([ac5681b](ac5681b)) * **deps:** bump actions/labeler from 5.0.0 to 6.1.0 ([#6970](#6970)) ([e748b86](e748b86)) * **deps:** bump actions/stale from 10.2.0 to 10.3.0 ([#7031](#7031)) ([6cf6804](6cf6804)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.4 to 2.1.5 ([#6972](#6972)) ([e38a99d](e38a99d)) * **deps:** bump aws-actions/configure-aws-credentials from 5.0.0 to 6.1.1 ([#6971](#6971)) ([1114b7f](1114b7f)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.1 to 6.1.2 ([#7049](#7049)) ([e210e68](e210e68)) * **deps:** bump codecov/codecov-action from 6.0.0 to 6.0.1 ([#7016](#7016)) ([3d639f5](3d639f5)) * **deps:** bump docker/login-action from 4.1.0 to 4.2.0 ([#7035](#7035)) ([b39183b](b39183b)) * **deps:** bump docker/metadata-action from 6.0.0 to 6.1.0 ([#7032](#7032)) ([574f7c8](574f7c8)) * **deps:** bump docker/setup-buildx-action from 4.0.0 to 4.1.0 ([#7034](#7034)) ([ff49009](ff49009)) * **deps:** bump golangci/golangci-lint-action from 8.0.0 to 9.2.1 ([#7044](#7044)) ([56070dc](56070dc)) * **deps:** bump slackapi/slack-github-action from 3.0.1 to 3.0.3 ([#6968](#6968)) ([fd70e60](fd70e60)) * **deps:** bump step-security/harden-runner from 2.19.1 to 2.19.3 ([#7012](#7012)) ([b4dc9b2](b4dc9b2)) * **deps:** bump step-security/harden-runner from 2.19.3 to 2.19.4 ([#7033](#7033)) ([ba82100](ba82100)) * **jobsdb:** avoid refreshing ds list from database in case of a stale ds error while updating job statuses ([#7024](#7024)) ([de98ede](de98ede)) * **jobsdb:** lateral join for getting jobs ([#7007](#7007)) ([7148a30](7148a30)) * remove deprecated bulkStatusEnabled flag for snowpipe streaming ([#6992](#6992)) ([d7fe1ae](d7fe1ae)) --- 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.
🔒 Scanned for secrets using gitleaks 8.30.1
Description
Introducing support for dropping completed dataset tables in a non-blocking fashion without a migration lock:
1. Versioned dataset list with reader-drain semantics
A new
versionedDSListreplaces the baredatasetList/datasetRangeListfields onHandle. Each update bumps a version; readers acquire a snapshot tagged with that version and release it when done reading. An additionalwait(through)API returns a channel that closes once no reader is still using a version<= through, so a dropper can block until in-flight queries that still see the old list have finished.2.
nonBlockingCompletedDSDropfast path and async drop loopdropDSLoopconsumes adropDSListqueue. Each entry records the dslist version that must drain before the table can be dropped.addToDropDSListrepublishes the dslist without the queued datasets, writes the persistent pre-drop marker (see §3), and pings the loop. The actualDROP TABLEhappens off the hot path.doMigrateDSgains a fast path gated byjobsdb.<prefix>.nonBlockingCompletedDSDrop(defaultfalse): datasets with zero pending jobs are routed through the async drop loop instead of the in-lockpostMigrateHandleDSpath. When disabled, behavior is unchanged.3. Persistent
pre_drop:v1table markerCOMMENT ON TABLE … IS 'rudder:pre_drop:v1'is written as part of queuing a dataset for drop. This makes the queue crash-safe — the source of truth lives in Postgres, not just in-memorydropDSList.getAllTableNamesnow joinspg_class/pg_namespace/pg_descriptionand filters out marked tables, masking half-pairs (drops both the jobs and status table when either is marked).000019_jobsdb_functions_pre_drop_filter.up.sqlrewritesunionjobsdb,unionjobsdbmetadata, andjoborderlogto apply the samepg_descriptionfilter, so server-side discovery skips marked tables too.cleanupPreDropTablesruns once at startup ofreadorreadwritejobsdbs and after journal recovery, dropping any tables left marked by a previous crashed run.If there isn't any marker present, behavior remains identical as before.
4.
RS001tolerance on theUpdateJobStatuspathThe readonly-trigger error code
RS001was previously only handled on theStorepath. TheUpdatepath now wraps eachinternalUpdateJobStatusInTxcall in a savepoint: onErrStaleDsListit rolls back to the savepoint, refreshes the dslist under the write lock, updates theUpdateSafeTx's embedded dslist/rangeList snapshot, and retries the whole command. We do not replay the caller-owned outer transaction.To support this,
UpdateSafeTxnow carries its owndsList/dsRangeList(with asetDSListsetter) so retries reroute against the refreshed snapshot without re-runninginUpdateSafeCtx.This change is harmless until a follow-up PR starts marking status tables readonly during compaction.
Linear Ticket
resolves PIPE-2996
Security
This is part 2 of 4 in a stack made with GitButler: