Repository navigation
packages/django-dramatiq-postgres/broker: use positive state filter for pending messages - #24074
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
4211525 to
ceaf6aa
Compare
ceaf6aa to
eee6779
Compare
|
@rissson all resolved, ready for another pass, when you have time |
eee6779 to
d4ef266
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24074 +/- ##
==========================================
- Coverage 92.83% 92.66% -0.17%
==========================================
Files 1056 1056
Lines 62751 62765 +14
Branches 424 424
==========================================
- Hits 58256 58164 -92
- Misses 4495 4601 +106
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
d4ef266 to
94658e5
Compare
94658e5 to
e491415
Compare
|
@EasyAsABC123 you do not need to keep rebasing on main. When you do we need to re-run the CI every time for no good reason, and we need to re-check your changes. Thanks. |
|
Thank you for the contribution! |
|
|
…or pending messages (cherry-pick #24074 to version-2026.5) (#24166) * Cherry-pick #24074 to version-2026.5 (with conflicts) This cherry-pick has conflicts that need manual resolution. Original PR: #24074 Original commit: ae6882c * Apply suggestions from code review Co-authored-by: Marc 'risson' Schmitt <[email protected]> Signed-off-by: Marc 'risson' Schmitt <[email protected]> * Apply suggestions from code review Co-authored-by: Marc 'risson' Schmitt <[email protected]> Signed-off-by: Marc 'risson' Schmitt <[email protected]> --------- Signed-off-by: Marc 'risson' Schmitt <[email protected]> Co-authored-by: Justin Schuhmann <[email protected]> Co-authored-by: Marc 'risson' Schmitt <[email protected]>
* main: policies: filter policy engine (#24025) endpoints/connectors/agent: fix auth schema for device endpoints (#24164) core, web: update translations (#24137) packages/django-dramatiq-postgres/broker: use positive state filter for pending messages (#24074) events: fix typo (#24161) root: fix agents test instructions (#24119) enterprise: fix enterprise_test skipping tests when used as class decorator (#24138) core: bump library/nginx from `ec4ed8b` to `b5a9a3c` in /website (#24146) core: bump github.com/pires/go-proxyproto from 0.14.0 to 0.15.0 (#24139) core: bump library/node from `ffc7838` to `715e55e` in /lifecycle/container (#24142) core: bump pnpm/pnpm from 11.12.0 to 11.13.0 in /lifecycle/container (#24144) core: bump library/golang from `ee5a795` to `3f1e064` in /lifecycle/container (#24143) core: bump pnpm/pnpm from 11.12.0 to 11.13.0 in /website (#24147) core: bump kubernetes from 36.0.2 to 36.0.3 (#24145) core: bump docker from 7.1.0 to 7.2.0 (#24149) web: bump webcomponent-qr-code from 1.3.0 to 2.0.0 in /web (#24152) core: bump regex from 1.12.4 to 1.13.0 (#24150) core: bump rust-toolchain from 1.97.0 to 1.97.1 (#24148) website/docs: cleanup 07-12: refresh contributor guidance (#23969) packages/ak-common/db: ignore empty passwords (#24127)
* main: policies: filter policy engine (#24025) endpoints/connectors/agent: fix auth schema for device endpoints (#24164) core, web: update translations (#24137) packages/django-dramatiq-postgres/broker: use positive state filter for pending messages (#24074) events: fix typo (#24161) root: fix agents test instructions (#24119) enterprise: fix enterprise_test skipping tests when used as class decorator (#24138) core: bump library/nginx from `ec4ed8b` to `b5a9a3c` in /website (#24146) core: bump github.com/pires/go-proxyproto from 0.14.0 to 0.15.0 (#24139) core: bump library/node from `ffc7838` to `715e55e` in /lifecycle/container (#24142) core: bump pnpm/pnpm from 11.12.0 to 11.13.0 in /lifecycle/container (#24144) core: bump library/golang from `ee5a795` to `3f1e064` in /lifecycle/container (#24143) core: bump pnpm/pnpm from 11.12.0 to 11.13.0 in /website (#24147) core: bump kubernetes from 36.0.2 to 36.0.3 (#24145) core: bump docker from 7.1.0 to 7.2.0 (#24149) web: bump webcomponent-qr-code from 1.3.0 to 2.0.0 in /web (#24152) core: bump regex from 1.12.4 to 1.13.0 (#24150) core: bump rust-toolchain from 1.97.0 to 1.97.1 (#24148) website/docs: cleanup 07-12: refresh contributor guidance (#23969) packages/ak-common/db: ignore empty passwords (#24127)
Details
(queue_name, state, eta)index for queue polling.What does this PR change?
Changes query to be positive and thereby near instant
Why is this change needed?
Seek over all rows in tasks, including completed tasks is slow.
How was this tested?
git diff --check.filter(state__in=CONSUMABLE_TASK_STATES).authentik_t_queue_n_099d0d_idx.On a production-like task table with about 409k rows, mostly completed tasks, the old query shape planned as a parallel sequential scan:
The new query shape uses the existing index:
Linked issues
None opened
Checklist
make all)make docs)