Skip to content

fix: warehouse pending tables to skip - #5867

Merged
achettyiitr merged 2 commits into
release/1.49.xfrom
fix.warehouse-pending-table-uploads
May 19, 2025
Merged

achettyiitr merged 2 commits into
release/1.49.xfrom
fix.warehouse-pending-table-uploads

Conversation

@achettyiitr

@achettyiitr achettyiitr commented May 19, 2025 •

Copy link
Copy Markdown
Member

Description

  • While picking up jobs we are relying on picking jobs via COALESCE(metadata->>'priority', '100')::int ASC, COALESCE(first_event_at, NOW()) ASC, id ASC) AS row_number.

  • Same thing this needs to be done while getting PendingTableUploads, so as to avoid dependency for skipping table uploads.

  • Modified query still using the existing indexes.

    Sort  (cost=16.95..16.96 rows=1 width=522)
    --
    Sort Key: ((COALESCE((ut.metadata ->> 'priority'::text), '100'::text))::integer), (COALESCE((ut.first_event_at)::timestamp with time zone, now())), ut.id
    ->  Nested Loop  (cost=0.43..16.94 rows=1 width=522)
    ->  Nested Loop  (cost=0.29..16.36 rows=1 width=550)
    ->  Index Scan using wh_uploads_destination_id_namespace_index on wh_uploads ut  (cost=0.14..8.19 rows=1 width=340)
    Index Cond: (((destination_id)::text = 'destination_id'::text) AND ((namespace)::text = 'namespace'::text))
    Filter: (((status)::text <> 'exported_data'::text) AND ((status)::text <> 'aborted'::text) AND (id <= 5) AND (COALESCE((first_event_at)::timestamp with time zone, now()) <= '2021-01-01 00:00:00+00'::timestamp with time zone) AND ((COALESCE((metadata ->> 'priority'::text), '100'::text))::integer <= 100))
    ->  Index Scan using wh_table_uploads_wh_upload_id_status_index on wh_table_uploads tu  (cost=0.14..8.16 rows=1 width=218)
    Index Cond: (wh_upload_id = ut.id)
    ->  Index Only Scan using unique_table_upload_wh_upload on wh_table_uploads tu1  (cost=0.14..0.36 rows=1 width=32)
    Index Cond: ((wh_upload_id = 5) AND (table_name = tu.table_name))
    
    Sort  (cost=16.92..16.93 rows=1 width=510)
    --
    Sort Key: ut.id
    ->  Nested Loop  (cost=0.43..16.91 rows=1 width=510)
    ->  Nested Loop  (cost=0.29..16.34 rows=1 width=510)
    ->  Index Scan using wh_uploads_destination_id_namespace_index on wh_uploads ut  (cost=0.14..8.17 rows=1 width=300)
    Index Cond: (((destination_id)::text = 'destination_id'::text) AND ((namespace)::text = 'namespace'::text))
    Filter: ((id <= 5) AND ((status)::text <> 'exported_data'::text) AND ((status)::text <> 'aborted'::text))
    ->  Index Scan using wh_table_uploads_wh_upload_id_status_index on wh_table_uploads tu  (cost=0.14..8.16 rows=1 width=218)
    Index Cond: (wh_upload_id = ut.id)
    ->  Index Only Scan using unique_table_upload_wh_upload on wh_table_uploads tu1  (cost=0.14..0.36 rows=1 width=32)
    Index Cond: ((wh_upload_id = 5) AND (table_name = tu.table_name))
    

Linear Ticket

  • Resolves WAR-671

Security

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

@achettyiitr
achettyiitr force-pushed the fix.warehouse-pending-table-uploads branch from 34144ea to 5b28e85 Compare May 19, 2025 06:35
@achettyiitr achettyiitr changed the title fix: warehouse pending table uploads fix: warehouse pending tables to skip May 19, 2025
@codecov

codecov Bot commented May 19, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/1.49.x@802db2e). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/1.49.x    #5867   +/-   ##
=================================================
  Coverage                  ?   77.05%           
=================================================
  Files                     ?      496           
  Lines                     ?    67788           
  Branches                  ?        0           
=================================================
  Hits                      ?    52232           
  Misses                    ?    12728           
  Partials                  ?     2828           

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread warehouse/internal/repo/upload.go Resolved
Comment thread warehouse/internal/repo/upload.go Resolved
Comment thread warehouse/internal/repo/upload_test.go Resolved
@achettyiitr
achettyiitr merged commit 6133dbc into release/1.49.x May 19, 2025
@achettyiitr
achettyiitr deleted the fix.warehouse-pending-table-uploads branch May 19, 2025 09:13
achettyiitr added a commit that referenced this pull request May 19, 2025
# Description

Syncing patch release v1.49.3 to main branch

**↓↓ Please review and edit commit overrides before merging ↓↓**

BEGIN_COMMIT_OVERRIDE
fix: warehouse pending tables to skip (#5867)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Satish Kumar <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: Akash Chetty <[email protected]>
mihir20 pushed a commit that referenced this pull request May 26, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.50.0-rc.1](v1.49.0...v1.50.0-rc.1)
(2025-05-26)


### Features

* implement aws v2 implementation
([#5852](#5852))
([18fd4fb](18fd4fb))


### Bug Fixes

* do not panic for invalid router payload
([#5880](#5880))
([f4a0e7c](f4a0e7c))
* server panicking with invalid byte sequence for encoding utf8 0x00
([#5882](#5882))
([4c1a0de](4c1a0de))
* skip source_id when fetching warehouse schema from database
([#5886](#5886))
([092ee2a](092ee2a))
* warehouse pending tables to skip
([#5867](#5867))
([864fd49](864fd49))
* warehouse transformations
([#5875](#5875))
([715ccfa](715ccfa))


### Miscellaneous

* **deps:** bump the go-deps group across 1 directory with 25 updates
([#5890](#5890))
([3c4ddd8](3c4ddd8))
* **jobsdb:** migrate incomplete datasets in pairs excluding completed
ones ([#5876](#5876))
([9d8b573](9d8b573))
* **jobsdb:** remove support for jobDoneMigrateThres
([#5873](#5873))
([4745d2b](4745d2b))
* make reporting client params configurable
([#5891](#5891))
([39f7e75](39f7e75))
* move house keeping action to commit sha
([#5885](#5885))
([d379e82](d379e82))
* refactor config change dtype for config to json.RawMessage
([#5874](#5874))
([940adb0](940adb0))
* refactor webhook pkg to make it reusable in other repos
([#5594](#5594))
([1ee57bc](1ee57bc))
* remove redundant structure for account with definition
([#5872](#5872))
([89bc62b](89bc62b))
* remove support for transformer-based kafka batching
([#5870](#5870))
([60a571c](60a571c))
* revert support new consent resolution strategy values
([#5855](#5855))
([c7e3b37](c7e3b37))
* revert use account to decide oauth type of a destination
([#5861](#5861))
([6232755](6232755))
* **router:** additional observability metrics
([#5887](#5887))
([da3ba3c](da3ba3c))
* sync release v1.49.0 to main branch
([#5851](#5851))
([78cc5a9](78cc5a9))
* use jsonrs from rudder-go-kit
([#5869](#5869))
([39064af](39064af))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
atzoum pushed a commit that referenced this pull request May 26, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.50.0-rc.2](v1.49.0...v1.50.0-rc.2)
(2025-05-26)


### Features

* implement aws v2 implementation
([#5852](#5852))
([18fd4fb](18fd4fb))


### Bug Fixes

* do not panic for invalid router payload
([#5880](#5880))
([f4a0e7c](f4a0e7c))
* error gathering metrics, metric was collected before with the same
name and label values
([#5900](#5900))
([422f45b](422f45b))
* handle missing eventUpload config gracefully
([#5898](#5898))
([05a926d](05a926d))
* server panicking with invalid byte sequence for encoding utf8 0x00
([#5882](#5882))
([4c1a0de](4c1a0de))
* skip source_id when fetching warehouse schema from database
([#5886](#5886))
([092ee2a](092ee2a))
* warehouse pending tables to skip
([#5867](#5867))
([864fd49](864fd49))
* warehouse transformations
([#5875](#5875))
([715ccfa](715ccfa))


### Miscellaneous

* **deps:** bump the go-deps group across 1 directory with 25 updates
([#5890](#5890))
([3c4ddd8](3c4ddd8))
* **jobsdb:** migrate incomplete datasets in pairs excluding completed
ones ([#5876](#5876))
([9d8b573](9d8b573))
* **jobsdb:** remove support for jobDoneMigrateThres
([#5873](#5873))
([4745d2b](4745d2b))
* make reporting client params configurable
([#5891](#5891))
([39f7e75](39f7e75))
* move house keeping action to commit sha
([#5885](#5885))
([d379e82](d379e82))
* refactor config change dtype for config to json.RawMessage
([#5874](#5874))
([940adb0](940adb0))
* refactor webhook pkg to make it reusable in other repos
([#5594](#5594))
([1ee57bc](1ee57bc))
* remove redundant structure for account with definition
([#5872](#5872))
([89bc62b](89bc62b))
* remove support for transformer-based kafka batching
([#5870](#5870))
([60a571c](60a571c))
* revert support new consent resolution strategy values
([#5855](#5855))
([c7e3b37](c7e3b37))
* revert use account to decide oauth type of a destination
([#5861](#5861))
([6232755](6232755))
* **router:** additional observability metrics
([#5887](#5887))
([da3ba3c](da3ba3c))
* sync release v1.49.0 to main branch
([#5851](#5851))
([78cc5a9](78cc5a9))
* use jsonrs from rudder-go-kit
([#5869](#5869))
([39064af](39064af))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
mihir20 pushed a commit that referenced this pull request May 27, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.50.0](v1.49.0...v1.50.0)
(2025-05-26)


### Features

* implement aws v2 implementation
([#5852](#5852))
([18fd4fb](18fd4fb))


### Bug Fixes

* do not panic for invalid router payload
([#5880](#5880))
([f4a0e7c](f4a0e7c))
* error gathering metrics, metric was collected before with the same
name and label values
([#5900](#5900))
([422f45b](422f45b))
* handle missing eventUpload config gracefully
([#5898](#5898))
([05a926d](05a926d))
* server panicking with invalid byte sequence for encoding utf8 0x00
([#5882](#5882))
([4c1a0de](4c1a0de))
* skip source_id when fetching warehouse schema from database
([#5886](#5886))
([092ee2a](092ee2a))
* warehouse pending tables to skip
([#5867](#5867))
([864fd49](864fd49))
* warehouse transformations
([#5875](#5875))
([715ccfa](715ccfa))


### Miscellaneous

* **deps:** bump the go-deps group across 1 directory with 25 updates
([#5890](#5890))
([3c4ddd8](3c4ddd8))
* **jobsdb:** migrate incomplete datasets in pairs excluding completed
ones ([#5876](#5876))
([9d8b573](9d8b573))
* **jobsdb:** remove support for jobDoneMigrateThres
([#5873](#5873))
([4745d2b](4745d2b))
* make reporting client params configurable
([#5891](#5891))
([39f7e75](39f7e75))
* move house keeping action to commit sha
([#5885](#5885))
([d379e82](d379e82))
* refactor config change dtype for config to json.RawMessage
([#5874](#5874))
([940adb0](940adb0))
* refactor webhook pkg to make it reusable in other repos
([#5594](#5594))
([1ee57bc](1ee57bc))
* remove redundant structure for account with definition
([#5872](#5872))
([89bc62b](89bc62b))
* remove support for transformer-based kafka batching
([#5870](#5870))
([60a571c](60a571c))
* revert support new consent resolution strategy values
([#5855](#5855))
([c7e3b37](c7e3b37))
* revert use account to decide oauth type of a destination
([#5861](#5861))
([6232755](6232755))
* **router:** additional observability metrics
([#5887](#5887))
([da3ba3c](da3ba3c))
* sync release v1.49.0 to main branch
([#5851](#5851))
([78cc5a9](78cc5a9))
* use jsonrs from rudder-go-kit
([#5869](#5869))
([39064af](39064af))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants