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

Fixed error with replication setup when default exclude list used #17999

Merged
merged 4 commits into from
Sep 20, 2018

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented Sep 19, 2018

Fixing error when when default list of tables to exclude from replication used during remote region. This bug was introduced in #17956

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1630517

@miq-bot add-label bug

@miq-bot miq-bot added the bug label Sep 19, 2018
@@ -158,6 +158,12 @@
expect(described_class).to receive(:refresh_excludes).with(YAML.safe_load(tables))
described_class.save_remote_region(tables)
end

it "does not updates list of tables to be excluded from replication if passed paramere is empty" do
Copy link
Member

@bdunne bdunne Sep 20, 2018

Choose a reason for hiding this comment

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

Is it okay to have an empty exclusion_list? I think there are some tables we are counting on never replicating (MiqDatabase).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we have this but it's not being used very thoroughly for application-side tables (but rather for AR and other system-type tables).

Copy link
Member

Choose a reason for hiding this comment

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

There are probably lots of tables that would cause problems if they were replicated, but we have never tried to enumerate them in any serious way.

Copy link
Member

Choose a reason for hiding this comment

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

Also, this has some typos s/updates/update/ s/paramere/parameter/

@bdunne bdunne requested a review from carbonin September 20, 2018 17:57
@@ -145,7 +145,7 @@ def self.default_excludes

def self.save_remote_region(exclusion_list)
MiqRegion.replication_type = :remote
refresh_excludes(YAML.safe_load(exclusion_list))
refresh_excludes(YAML.safe_load(exclusion_list)) unless exclusion_list.empty?
Copy link
Member

Choose a reason for hiding this comment

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

Why is this exclude list empty?

Copy link
Member

Choose a reason for hiding this comment

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

Or rather why would it ever be empty unless the user specifically wanted to exclude nothing? (which as @bdunne noted will likely not go well)

Copy link
Member

Choose a reason for hiding this comment

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

Okay, after going back over the previous two PRs it looks like this condition was previously preventing us from calling the refresh_excludes if the exclude list parameter was empty.

I'm not particularly happy that this UI-side concern (dealing with an empty list that shouldn't be treated as an empty list) is being pushed into this method, but I'm not sure how else this can be solved with the new way this is working.

Can you add a comment that says that this is here because the UI passes an empty array for "no changes" so we can rely on the refresh_excludes call which is run as a part of replication_type=?

@carbonin
Copy link
Member

After looking into this for a bit, it seems like your previous changes would have failed unconditionally @yrudman. In the future, when making complex changes like this, please test them before making it sound like the PRs are ready to be merged.

@miq-bot
Copy link
Member

miq-bot commented Sep 20, 2018

Checked commits yrudman/manageiq@154e779~...48e92b0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@carbonin carbonin self-assigned this Sep 20, 2018
@carbonin carbonin merged commit adc4dea into ManageIQ:master Sep 20, 2018
@carbonin carbonin added this to the Sprint 95 Ending Sep 24, 2018 milestone Sep 20, 2018
@yrudman yrudman deleted the fixed-error-with-replication-setup branch September 21, 2018 13:13
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.

4 participants