Skip to content

new: salt.sqlalchemy base implementation (+ returner & cache)#68068

Open
mattp- wants to merge 7 commits intosaltstack:masterfrom
mattp-:sqla
Open

new: salt.sqlalchemy base implementation (+ returner & cache)#68068
mattp- wants to merge 7 commits intosaltstack:masterfrom
mattp-:sqla

Conversation

@mattp-
Copy link
Contributor

@mattp- mattp- commented Jun 12, 2025

What does this PR do?

this is the foundation for a shared sqlalchemy model that can be used across (at least, from current testing) postgresql, mysql, sqlite. The eventual goal would be to deprecate the redundant mysql, pgjsonb, postgres returners & cache implementations. In the longer future, possibly defaulting to sqlite and removing file based cache &
returner mechanisms could lead to simplifying the salt codebase, but thats a much larger discussion.

NOTE: this PR is rebased on #68039 and #68030 , please merge them first, thanks 👍

NOTE: this pr only runs against sqlite and pymysql at the moment; I can't figure out how to get psycopg installing with the static reqs. I'll try to work with someone from salt-co to get that added. once psycopg gets installed the pg tests should run automatically.

I've got a separate changeset that implements sql optimizations for salt.key/salt.utils.minions, I'll be working on that next

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@mattp- mattp- requested a review from a team as a code owner June 12, 2025 18:55
@mattp- mattp- changed the title new: salt.sqlalchemy base implementation new: salt.sqlalchemy base implementation (+ returner & cache) Jun 12, 2025
@mattp- mattp- changed the title new: salt.sqlalchemy base implementation (+ returner & cache) WIP: new: salt.sqlalchemy base implementation (+ returner & cache) Jun 12, 2025
@mattp- mattp- force-pushed the sqla branch 2 times, most recently from e0c1ccb to 9b8f4df Compare June 13, 2025 00:54
@whytewolf whytewolf added the test:full Run the full test suite label Jun 17, 2025
returner implementation leveraging the newly introduced sqlalchemy
models. one useful thing offered not by the other database returner
implementations is a lock based prep_jid to assure no jid collisions in
a high volume multi-master/clustered setup. tested with mysql, postgres
& sqlite.
I'd like to add psycopg but can't figure out how to get the wheel to
install / I think we need to add libs to salt-ci-container-images
instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants