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

Delegate queue_name for refresh to parent manager instead of queue_name arrays #20345

Merged
merged 1 commit into from
Oct 2, 2020

Conversation

agrare
Copy link
Member

@agrare agrare commented Jul 9, 2020

Instead of changing the worker queue_name to allow for arrays which has been problematic we could simply delegate the queue_name for refresh to the parent manager if the child managers are targeted and leave the parent manager's RefreshWorker queue_name alone.

Depends on:

Dependent:

Fixes #20307

@Fryguy
Copy link
Member

Fryguy commented Jul 9, 2020

Are we still storing JSON in the column, then or will there be a data migration? Since it's using the parent's queue name, how do we report that in rake evm:status (maybe it doesn't matter)?

@jrafanie
Copy link
Member

jrafanie commented Jul 10, 2020

Since it's using the parent's queue name, how do we report that in rake evm:status (maybe it doesn't matter)?

Yeah, this would break evm:status since we use worker.queue_name...

EDIT: well, it could break it, depending on what queue_name would return.

@agrare
Copy link
Member Author

agrare commented Jul 11, 2020

Sorry might be missing something but why would it break evm:status? worker.queue_name would just be e.g. ems_1 like it used to be.

@agrare
Copy link
Member Author

agrare commented Jul 13, 2020

$ rake evm:status/manageiq/bundler.d/overrides.rb:4
** ManageIQ master, codename: Kasparov
Checking EVM status...
The version of PostgreSQL being connected to is incompatible with ManageIQ (10 required)
 Region | Zone    | Server | Status  |   PID |  SPID | Workers | Version | Started     | Heartbeat   | MB Usage | Roles
--------+---------+--------+---------+-------+-------+---------+---------+-------------+-------------+----------+----------------------------------------------------------------------------------------------------------------------------------------------------------
      0 | default | EVM*   | started | 75219 | 75499 |      13 | master  | 12:20:20UTC | 12:21:15UTC |      366 | automate:database_operations:database_owner:ems_inventory:ems_operations:event:remote_console:reporting:scheduler:smartstate:user_interface:web_services

* marks a master appliance

 Type                        | Status  |   PID | SPID  | Queue     | Started     | Heartbeat   | MB Usage
-----------------------------+---------+-------+-------+-----------+-------------+-------------+----------
 Amazon::Cloud::EventCatcher | started | 75902 | 77913 | ems_2     | 12:21:02UTC | 12:21:10UTC | 288/2048
 Amazon::Cloud::Refresh      | started | 76101 | 78032 | ems_2     | 12:21:06UTC | 12:21:12UTC | 323/2048
 EventHandler                | started | 75987 | 77659 | ems       | 12:21:03UTC | 12:21:04UTC | 139/500
 Generic                     | started | 76001 | 77677 | generic   | 12:21:03UTC | 12:21:05UTC | 138/500

@jrafanie
Copy link
Member

Sorry might be missing something but why would it break evm:status? worker.queue_name would just be e.g. ems_1 like it used to be.

cool! Yeah, I changed my comment afterwards... it wouldn't definitely break it... if it returns a queue_name format that was previously supported, it would work

@agrare agrare force-pushed the drop_combined_queue_names branch from ea51528 to 2ddba64 Compare July 17, 2020 18:46
@agrare agrare changed the title [WIP] Delegate queue_name for refresh to parent manager instead of queue_name arrays Delegate queue_name for refresh to parent manager instead of queue_name arrays Jul 17, 2020
@miq-bot miq-bot removed the wip label Jul 17, 2020
@jrafanie
Copy link
Member

@agrare it says it depends on the other PRs, do they need to be merged first? If so, can you mark this WIP and ping me when they're merged?

@agrare
Copy link
Member Author

agrare commented Jul 17, 2020

Oh I think "not WIP" implies ready to review not ready to merge, I'll mark it WIP if that's how most people use it

@agrare agrare changed the title Delegate queue_name for refresh to parent manager instead of queue_name arrays [WIP] Delegate queue_name for refresh to parent manager instead of queue_name arrays Jul 17, 2020
@miq-bot miq-bot added the wip label Jul 17, 2020
Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

Looks good.

I think we may have this as a static method to get away from having to create an ems object for every queue.

But looking at the original code in ems_refresh.rb it looks like that wasn't the intent here.
I remember getting a big performance gain in MiqQueue.put by avoiding the queue lookup.

Maybe something to file away in our minds for future work

@agrare agrare changed the title [WIP] Delegate queue_name for refresh to parent manager instead of queue_name arrays Delegate queue_name for refresh to parent manager instead of queue_name arrays Sep 22, 2020
@agrare
Copy link
Member Author

agrare commented Sep 22, 2020

I'm going to un-WIP this because it is ready for review, just has an associated schema change.

@jrafanie please review

@miq-bot miq-bot added unmergeable and removed wip labels Sep 22, 2020
@miq-bot
Copy link
Member

miq-bot commented Sep 23, 2020

Checked commit agrare@387abe2 with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
8 files checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM

@jrafanie
Copy link
Member

@Fryguy are you good with this PR and the associated migration (ManageIQ/manageiq-schema#496)?

@Fryguy Fryguy merged commit be9bd91 into ManageIQ:master Oct 2, 2020
@Fryguy Fryguy self-assigned this Oct 2, 2020
@agrare agrare deleted the drop_combined_queue_names branch October 2, 2020 15:29
agrare added a commit to agrare/manageiq-providers-amazon that referenced this pull request Oct 3, 2020
ManageIQ/manageiq#20345 dropped combined child
manager queue names
agrare added a commit to agrare/manageiq-providers-azure that referenced this pull request Oct 3, 2020
ManageIQ/manageiq#20345 dropped combined child
manager queue names
agrare added a commit to agrare/manageiq-providers-openstack that referenced this pull request Oct 3, 2020
ManageIQ/manageiq#20345 dropped combined child
manager queue names
agrare added a commit to agrare/manageiq-providers-openstack that referenced this pull request Oct 4, 2020
ManageIQ/manageiq#20345 dropped combined child
manager queue names
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Mar 17, 2023
ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an
integer or nil from parse_ems_id.

[1] ManageIQ#20345
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Mar 17, 2023
ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an
integer or nil from parse_ems_id.

[1] ManageIQ#20345
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Mar 21, 2023
ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an
integer or nil from parse_ems_id.

[1] ManageIQ#20345
jrafanie added a commit to jrafanie/manageiq that referenced this pull request Mar 29, 2023
ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an
integer or nil from parse_ems_id.

[1] ManageIQ#20345
GilbertCherrie pushed a commit to GilbertCherrie/manageiq that referenced this pull request Jul 7, 2023
ems_id comes from ems_id_from_queue_name which as of [1] can only ever return an
integer or nil from parse_ems_id.

[1] ManageIQ#20345
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants