-
Notifications
You must be signed in to change notification settings - Fork 897
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
Archive Container Nodes #15351
Archive Container Nodes #15351
Conversation
@miq-bot add_label providers/containers, enhancement |
app/models/container_node.rb
Outdated
self.ext_management_system = nil | ||
self.deleted_on = Time.now.utc | ||
save | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simon3z Note we keep entities created by this node like hardware
and computer_system
. i cant think of a place we might want to exclude them (reasons we would want to implement disconnection for them) but we should keep that in mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeari yes we need the hardware (it is important that we keep the number of cpus and memory).
@@ -5,6 +5,8 @@ class ContainerNode < ApplicationRecord | |||
include NewWithTypeStiMixin | |||
include TenantIdentityMixin | |||
include SupportsFeatureMixin | |||
include ArchivedMixin | |||
include_concern 'Purging' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
delegate :my_zone, :to => :ext_management_system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks
@miq-bot add_label fine/yes |
@zeari @moolitayer can you review/approve? Thanks. |
Had a minor comment, but other then that looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Btw. it can't be fine/yes. Since we do not allow migrations to be backported, |
@miq-bot rm_label fine/yes |
LGTM 👍 |
This pull request is not mergeable. Please rebase and repush. |
Database migrations have now been moved to the https://github.com/ManageIQ/manageiq-schema repo. Please see http://talk.manageiq.org/t/new-split-repo-manageiq-schema/2478 for instructions on how to transfer your database migrations. If this PR contains only migrations, I will leave it open for a short time during the transition, after which I will close this if it has not been moved over. |
@miq-bot rm_label sql migration |
d10703a
to
31b34f5
Compare
@Ladas can you please take a look in this PR to see if it's suited to the current state of the new archiving approach? |
app/models/container_node.rb
Outdated
@@ -115,4 +114,12 @@ def external_logging_path | |||
index = ".operations.*" | |||
EXTERNAL_LOGGING_PATH % {:index => index, :query => query} | |||
end | |||
|
|||
def disconnect_inv | |||
return if ems_id.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this can still happen. Maybe the condition should use deleted_on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right. Actually, we might need to change that condition in all other archived containers entities (to avoid second disconnect)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds like a followup PR to clean them all up.
Might be the ems_id.nil?
is still relevant when we destroy EMS? At least in cloud/infra, we do dependent => nullify for some models. (to speed up the destroy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in containers we currently have only :dependent => :destroy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ladas fixed it here, will send a separate PR for the rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I have just 1 minor question
a94c819
to
94d1551
Compare
@Fryguy Please review |
This pull request is not mergeable. Please rebase and repush. |
Checked commit zakiva@68d0b1f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@Fryguy @blomquisg Can you please review? |
@moolitayer @Fryguy migration landed long ago, let's get this in. |
@Fryguy please review/merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cc @chessbyte |
@moolitayer should we add this to the list of PRs that needs attention? This is waiting since way too long (more than 1 month from first approval and 1 week since last one). |
I've started a new list with this item in the daily doc. |
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1460401
Depends on ManageIQ/manageiq-schema#22
Changes included:
Adding(Extracted)deleted_on
andold_ems_id
columns tocontainer_nodes
table.