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

Allow ovirt to implement their own pg version check #19090

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Aug 1, 2019

This doesn't fix the following bug but allows them to implement their
own adapter that opts-out of the manageiq pg version check and instead
implement their own via a check_version, something like this:

ManageIQ/ovirt_metrics#33

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

This doesn't fix the following bug but allows them to implement their
own adapter that opts-out of the manageiq pg version check and instead
implement their own via a check_version, something like this:

```ruby
module ActiveRecord
  module ConnectionHandling # :nodoc:
    def ovirt_postgresql_connection(config)
      conn_params = config.symbolize_keys
      ...rest of the existing rails 5.1 pg adapter method until...
      ConnectionAdapters::OvirtPostgreSQLAdapter.new(nil, logger, conn_params, config)
    end
  end
  module ConnectionAdapters
    class OvirtPostgreSQLAdapter < PostgreSQLAdapter
      def check_version
        raise "AAAAA" if postgresql_version > XXX
      end
    end
  end
end
```

https://bugzilla.redhat.com/show_bug.cgi?id=1734770
@jrafanie
Copy link
Member Author

jrafanie commented Aug 1, 2019

@gekorob Please test this and let me know how it goes... I think this is the interface we want... allow adapters to opt-out of the version check or implement their own

@miq-bot miq-bot added the wip label Aug 1, 2019
@miq-bot
Copy link
Member

miq-bot commented Aug 1, 2019

Checked commit jrafanie@b3f3f57 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@gekorob
Copy link
Member

gekorob commented Aug 2, 2019

@jrafanie I applied the patch to the initializer, reproduced the problem locally and build the new postgresql adapter with the check condition set to allow postgresql major of 9.2. And it worked.
So I'm gonna propose a PR on ovirt_metrics and lets see.
Thanks for your help

@jrafanie jrafanie changed the title [WIP] Allow ovirt to implement their own pg version check Allow ovirt to implement their own pg version check Aug 2, 2019
@jrafanie
Copy link
Member Author

jrafanie commented Aug 2, 2019

@carbonin please review... I added a link to the consumer of this change: ManageIQ/ovirt_metrics#33

@jrafanie
Copy link
Member Author

jrafanie commented Aug 2, 2019

cc @agrare (this is what is needed for the other PR to work)

@carbonin carbonin merged commit e530796 into ManageIQ:master Aug 2, 2019
@carbonin carbonin added this to the Sprint 117 Ending Aug 5, 2019 milestone Aug 2, 2019
simaishi pushed a commit that referenced this pull request Aug 2, 2019
…r_own_pg_check_version

Allow ovirt to implement their own pg version check

(cherry picked from commit e530796)

https://bugzilla.redhat.com/show_bug.cgi?id=1734770
@simaishi
Copy link
Contributor

simaishi commented Aug 2, 2019

Ivanchuk backport details:

$ git log -1
commit 493cf689e6ab227711e60e52ee1108d5b91fb012
Author: Nick Carboni <[email protected]>
Date:   Fri Aug 2 16:23:53 2019 -0400

    Merge pull request #19090 from jrafanie/allow_ovirt_to_implement_their_own_pg_check_version
    
    Allow ovirt to implement their own pg version check
    
    (cherry picked from commit e5307965c15f1cc2eaccb26e9a4364556252eb1c)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1734770

gekorob added a commit to gekorob/manageiq that referenced this pull request Aug 5, 2019
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter
to override the MIQ check_version method and allow connections to PG
older than v.10.

Related to ManageIQ#19090

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
lpichler pushed a commit to lpichler/manageiq that referenced this pull request Aug 7, 2019
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter
to override the MIQ check_version method and allow connections to PG
older than v.10.

Related to ManageIQ#19090

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
thearifismail pushed a commit to thearifismail/manageiq that referenced this pull request Aug 21, 2019
Latest version of ovirt_metrics implements a custom PostgreSQLAdapter
to override the MIQ check_version method and allow connections to PG
older than v.10.

Related to ManageIQ#19090

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1734770
@jrafanie jrafanie deleted the allow_ovirt_to_implement_their_own_pg_check_version branch October 4, 2019 19:46
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.

5 participants