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

PG 9.6 - pg_stat_activity has no waiting column #13200

Closed
himdel opened this issue Dec 15, 2016 · 2 comments
Closed

PG 9.6 - pg_stat_activity has no waiting column #13200

himdel opened this issue Dec 15, 2016 · 2 comments

Comments

@himdel
Copy link
Contributor

himdel commented Dec 15, 2016

Starting with postgres 9.6, there is no pg_stat_activity.waiting.

This causes two of our tests to fail:

  1) VmdbDatabaseConnection.log_statistics normal
     Failure/Error: expect(lines.shift).to eq "MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV\n"
     
       expected: "MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV\n"
            got: "MIQ(VmdbDatabaseConnection.log_statistics) Unable to log stats, 'undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x00561af9d10640>\n"
     
       (compared using ==)
     
       Diff:
       @@ -1,2 +1,2 @@
       -MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV
       +MIQ(VmdbDatabaseConnection.log_statistics) Unable to log stats, 'undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x00561af9d10640>
       
     # ./spec/models/vmdb_database_connection_spec.rb:136:in `block (3 levels) in <top (required)>'
  2) VmdbDatabase.report_client_connections will return an array of hashes and verify hash keys for client connections query
     Failure/Error:
           data = select(<<-SQL, "Client Connections").to_a
                         SELECT client_addr   AS client_address
                              , datname       AS database
                              , pid           AS spid
                              , waiting       AS is_waiting
                              , query
                           FROM pg_stat_activity
                          ORDER BY 1, 2
                         SQL
     
     ActiveRecord::StatementInvalid:
       PG::UndefinedColumn: ERROR:  column "waiting" does not exist
       LINE 4:                        , waiting       AS is_waiting
                                        ^
       :                   SELECT client_addr   AS client_address
                              , datname       AS database
                              , pid           AS spid
                              , waiting       AS is_waiting
                              , query
                           FROM pg_stat_activity
                          ORDER BY 1, 2
     # ./lib/extensions/ar_adapter/ar_dba/postgresql.rb:15:in `client_connections'
     # ./app/models/vmdb_database.rb:77:in `report_client_connections'
     # ./spec/models/vmdb_database_spec.rb:77:in `block (3 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # PG::UndefinedColumn:
     #   ERROR:  column "waiting" does not exist
     #   LINE 4:                        , waiting       AS is_waiting
     #                                    ^
     #   ./lib/extensions/ar_adapter/ar_dba/postgresql.rb:15:in `client_connections'
rspec ./spec/models/vmdb_database_connection_spec.rb:133 # VmdbDatabaseConnection.log_statistics normal
rspec ./spec/models/vmdb_database_spec.rb:75 # VmdbDatabase.report_client_connections will return an array of hashes and verify hash keys for client connections query

My quick reading of 9.5 vs 9.6 would suggest the new way is to check wait_event IS NOT NULL, unless threre's some deeper semantic difference..

Cc @chrisarcand , @jrafanie

@miq-bot
Copy link
Member

miq-bot commented Sep 30, 2017

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

@miq-bot miq-bot added the stale label Sep 30, 2017
@himdel
Copy link
Contributor Author

himdel commented Sep 30, 2017

@miq-bot remove_label stale

Still relevant :)

@miq-bot miq-bot removed the stale label Sep 30, 2017
carbonin added a commit to carbonin/manageiq that referenced this issue Feb 7, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
carbonin added a commit to carbonin/manageiq that referenced this issue Feb 7, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
carbonin added a commit to carbonin/manageiq that referenced this issue Feb 7, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
carbonin added a commit to carbonin/manageiq that referenced this issue Feb 13, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
carbonin added a commit to carbonin/manageiq that referenced this issue Feb 19, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
carbonin added a commit to carbonin/manageiq that referenced this issue Mar 11, 2019
The pg_stat_activity view changed in PG 9.6

Fixes ManageIQ#13200
@Fryguy Fryguy closed this as completed in e6c63e2 Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants