Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant changes changes miq product features on all servers #20772

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Nov 2, 2020

alternative for: #20708 (first commit is from that PR)

miq product features contain tenant data. So we want to update the product features data
on all servers when a tenant is added or changes.

This allows us to remove special logic from the front end: ManageIQ/manageiq-ui-classic#7430

Closes ManageIQ/manageiq-api#928
Closes #20708

@@ -317,6 +318,10 @@ def create_miq_product_features_for_tenant_nodes
MiqProductFeature.seed_single_tenant_miq_product_features(self)
end

def update_miq_product_features_for_tenant_nodes
MiqProductFeature.invalidate_caches_queue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be more selective about which changes need to update the product features?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had asked Libor the same question.

It would mean that we know in this class exactly what the miq product feature cache is holding. and if the business logic or display logic over there changes.

I deemed that we don't make many tenant changes other than name adds and removes, so the blanket change was the safest bet and not overly cache invalidation happy.

If you have another interpretation, please share

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll put in after_create per your other request

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my argument over there was that the logic doesn't belong in the UI but did on the model, so at least all of the "information" would be self contained... But I agree that you'd have to have model logic to know this relationship anyway and then remember to update both sides, and that's not ideal.

@Fryguy
Copy link
Member

Fryguy commented Nov 6, 2020

Overall LGTM...can you also add a "Closes ManageIQ/manageiq-api#928" somewhere so we know this is linked to that and will auto-close it?

@Fryguy
Copy link
Member

Fryguy commented Nov 6, 2020

According to the issue described in ManageIQ/manageiq-api#928, perhaps this should only be a part of after_create?

@kbrock
Copy link
Member Author

kbrock commented Nov 6, 2020

@Fryguy made that change - let me know if you have other ideas

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Fryguy
Copy link
Member

Fryguy commented Nov 12, 2020

@kbrock Can you rebase, and then I can merge? (Didn't realize I hadn't merged this yet :( )

miq product features contain tenant data. So we want to update the product features data
on all servers when a tenant changes

This allows us to remove special logic from the front end.

ManageIQ/manageiq-ui-classic#7430
@miq-bot
Copy link
Member

miq-bot commented Nov 12, 2020

Checked commits kbrock/manageiq@92cb362~...c7aa203 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
3 files checked, 0 offenses detected
Everything looks fine. 🍪

@kbrock
Copy link
Member Author

kbrock commented Nov 13, 2020

@Fryguy thanks for the ping. I hadn't realized this had a conflict

@Fryguy Fryguy merged commit c7836b2 into ManageIQ:master Nov 16, 2020
@Fryguy Fryguy self-assigned this Nov 16, 2020
@kbrock kbrock deleted the invalidate_all_caches branch November 17, 2020 21:31
@simaishi
Copy link
Contributor

simaishi commented Jan 5, 2021

Backported to ivanchuk via #20886

simaishi pushed a commit that referenced this pull request Jan 7, 2021
Tenant changes changes miq product features on all servers

(cherry picked from commit c7836b2)
@simaishi
Copy link
Contributor

simaishi commented Jan 7, 2021

Jansa backport details:

$ git log -1
commit 4bebcc479de3c78212fbbe4acff0955cbce48e83
Author: Jason Frey <fryguy9@gmail.com>
Date:   Mon Nov 16 09:59:29 2020 -0500

    Merge pull request #20772 from kbrock/invalidate_all_caches

    Tenant changes changes miq product features on all servers

    (cherry picked from commit c7836b284561b3c9e396c610333659e1c5e287eb)

simaishi pushed a commit that referenced this pull request Jan 7, 2021
Tenant changes changes miq product features on all servers

(cherry picked from commit c7836b2)
@simaishi
Copy link
Contributor

simaishi commented Jan 7, 2021

Kasparov backport details:

$ git log -1
commit 49681cc277fe57ebe03bb39fda53635f61270165
Author: Jason Frey <fryguy9@gmail.com>
Date:   Mon Nov 16 09:59:29 2020 -0500

    Merge pull request #20772 from kbrock/invalidate_all_caches

    Tenant changes changes miq product features on all servers

    (cherry picked from commit c7836b284561b3c9e396c610333659e1c5e287eb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalidating product feature caches when creating a child (ops) tenant
5 participants