Skip to content

chore(jobsdb): multiconsumer flip, registry table and unionjobsdb - #7094

Merged
atzoum merged 1 commit into
masterfrom
feat.mcJobsDB3
Jun 24, 2026
Merged

atzoum merged 1 commit into
masterfrom
feat.mcJobsDB3

Conversation

@atzoum

@atzoum atzoum commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Registry table (<prefix>_consumers_<idx>):
Each dataset of a multi-consumer handle gets a third table alongside its jobs and status tables, with a single consumer TEXT PRIMARY KEY column. Its lifecycle is tied to the dataset — created in the same transaction as the jobs/status tables, dropped with them. It plays three roles:

  1. enumerating distinct consumers cheaply without scanning the status table;
  2. acting as the stateless schema-presence marker that lets the upgrade/downgrade logic work without a separate persisted flag
  3. seeding the dataset's canonical consumer set at compaction time.

applyMultiConsumerFlip — handles both upgrade and downgrade:
A single function drives both directions of the multi-consumer transition, called unconditionally on every startup.

  • Upgrade (multiConsumer=true): detects pre-flip datasets (those without a registry table) via getDSList and for each one runs a single maintenance transaction: creates the v_last_c_ view (idempotent via CREATE OR REPLACE) then creates the registry table and seeds it with ('') in one statement. Both reader and writer owner types run the flip; already-migrated datasets are skipped.

  • Downgrade (multiConsumer=false): for each dataset that carries a registry table, queries it for any consumer whose value is not the empty string. If none exist the datasets contain only legacy (single-consumer) data and startup proceeds normally. If a named consumer is found the process returns an error (converted to a panic by the caller), because per-consumer status data cannot be faithfully represented in the single-consumer schema.

unionjobsdbmetadata SQL migration:
Updated to detect the registry table per dataset via to_regclass and join the correct view (v_last_c_ for multi-consumer datasets, v_last_ for single-consumer), returning consumers and consumer columns in its result type.

Linear Ticket

resolves PIPE-3051

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.88%. Comparing base (c59e9e5) to head (b847e12).

Files with missing lines Patch % Lines
jobsdb/jobsdb_dataset_ddl.go 20.00% 5 Missing and 3 partials ⚠️
jobsdb/jobsdb_multiconsumer.go 88.00% 3 Missing and 3 partials ⚠️
jobsdb/jobsdb_store.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7094      +/-   ##
==========================================
+ Coverage   79.46%   79.88%   +0.42%     
==========================================
  Files         583      584       +1     
  Lines       65394    65469      +75     
==========================================
+ Hits        51964    52302     +338     
+ Misses      10339    10051     -288     
- Partials     3091     3116      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

atzoum added a commit that referenced this pull request Jun 22, 2026
## Summary

Adds two new columns to all jobsdb tables (jobs and job_status) as the
foundational schema step for multi-consumer jobsdb support:
- `consumers` on jobs tables — tracks which consumers a job is intended
for
- `consumer` on job_status tables — identifies which consumer a status
row belongs to

Both columns are added universally to all handles (single- and
multi-consumer alike), with safe defaults that preserve existing
single-consumer semantics. All existing read, write, and compaction
paths are updated to carry the new columns through.

## Linear Ticket

Resolves PIPE-3115

## 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 5 in a stack** made with GitButler:
- <kbd>&nbsp;5&nbsp;</kbd> #7096 
- <kbd>&nbsp;4&nbsp;</kbd> #7083 
- <kbd>&nbsp;3&nbsp;</kbd> #7094 
- <kbd>&nbsp;2&nbsp;</kbd> #7093 
- <kbd>&nbsp;1&nbsp;</kbd> #7082 👈 
<!-- GitButler Footer Boundary Bottom -->
Base automatically changed from feat.mcJobsDB2 to master June 22, 2026 14:52
@atzoum
atzoum marked this pull request as ready for review June 22, 2026 14:57
Comment thread jobsdb/jobsdb_dataset_ddl.go Dismissed
@atzoum atzoum closed this Jun 22, 2026
@atzoum atzoum reopened this Jun 22, 2026
@atzoum
atzoum force-pushed the feat.mcJobsDB3 branch 2 times, most recently from d54342a to 5a43aaa Compare June 24, 2026 04:37
chore: make lint

🔒 Scanned for secrets using gitleaks 8.30.1

chore: remove disallowMultiConsumerDowngrade config

🔒 Scanned for secrets using gitleaks 8.30.1
@atzoum
atzoum merged commit 9eff2e9 into master Jun 24, 2026
74 checks passed
@atzoum
atzoum deleted the feat.mcJobsDB3 branch June 24, 2026 08:29
This was referenced Jun 29, 2026
atzoum pushed a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0-rc.1](v1.78.0...v1.79.0-rc.1)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
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 29, 2026
atzoum pushed a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0-rc.2](v1.78.0...v1.79.0-rc.2)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* **jobsdb:** compaction panics with pq error column js.consumer does
not exist at position
([#7133](#7133))
([f392a53](f392a53))
* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
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>
atzoum pushed a commit that referenced this pull request Jun 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.79.0](v1.78.0...v1.79.0)
(2026-06-29)


### Features

* support compressing payloads in reporting client
([#7124](#7124))
([365b530](365b530))
* support deltalake azure hierarchical namespace folders
([#7089](#7089))
([61b41e4](61b41e4))


### Bug Fixes

* **jobsdb:** compaction panics with pq error column js.consumer does
not exist at position
([#7133](#7133))
([f392a53](f392a53))
* panic in user transformer client due to timeout doesn't get recorded
by alerts
([#7116](#7116))
([61b41e4](61b41e4))
* partition migration restarts server on slow in-progress wait
([#7129](#7129))
([d63d597](d63d597))


### Miscellaneous

* **jobsdb:** capturing multi-consumer pending events
([#7121](#7121))
([dc382f7](dc382f7))
* **jobsdb:** cleanup legacy configuration flags
([#7122](#7122))
([58778d5](58778d5))
* **jobsdb:** multi-consumer compaction
([#7096](#7096))
([57f1ef5](57f1ef5))
* **jobsdb:** multi-consumer get and noresults cache handling
([#7095](#7095))
([9d5c58a](9d5c58a))
* **jobsdb:** multi-consumer get distinct consumers
([#7097](#7097))
([f68a56d](f68a56d))
* **jobsdb:** multi-consumer partition migration
([#7098](#7098))
([9cda68d](9cda68d))
* **jobsdb:** multi-consumer-specific indexes and views
([#7093](#7093))
([61b41e4](61b41e4))
* **jobsdb:** multiconsumer flip, registry table and unionjobsdb
([#7094](#7094))
([9eff2e9](9eff2e9))
* **jobsdb:** new columns for multi-consumer jobsdb
([#7082](#7082))
([61b41e4](61b41e4))
* recreate stale rsources subscription on shared db
([#7108](#7108))
([c59e9e5](c59e9e5))
* use priority pool at migration start while polling for pending jobs
([#7128](#7128))
([254ae15](254ae15))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants