Notice to Chef Reporting users that have used the data purging feature (—remove-partitions) introduced in 1.3.0

Irving Popovetsky -

Critical news for users upgrading to a newer release of Chef Reporting (1.5.5 and greater).

Due to a bug in the upgrade process, If you’ve removed any of the 2015 data partitions the upgrade will fail. To determine if this applies to you, as well as to resolve the issue, run the following steps on your Standalone or Primary Backend Chef Server:

  1. To see if you’ve removed them, query the list of reporting tables and verify that you have node_run_2015_* andnode_run_detail_2015_* tables (12 of each):

    # sudo -u opscode-pgsql /opt/opscode/embedded/bin/psql opscode_reporting -c "\dt"
    could not change directory to "/root"
                        List of relations
    Schema |          Name           | Type  |     Owner
    --------+-------------------------+-------+---------------
    public | duration_buckets        | table | opscode-pgsql
    public | matviews                | table | opscode-pgsql
    public | node_run                | table | opscode-pgsql
    public | node_run_2015_01        | table | opscode-pgsql
    public | node_run_2015_02        | table | opscode-pgsql
    public | node_run_2015_03        | table | opscode-pgsql
    public | node_run_2015_04        | table | opscode-pgsql
    public | node_run_2015_05        | table | opscode-pgsql
    public | node_run_2015_06        | table | opscode-pgsql
    public | node_run_2015_07        | table | opscode-pgsql
    public | node_run_2015_08        | table | opscode-pgsql
    public | node_run_2015_09        | table | opscode-pgsql
    public | node_run_2015_10        | table | opscode-pgsql
    public | node_run_2015_11        | table | opscode-pgsql
    public | node_run_2015_12        | table | opscode-pgsql
    public | node_run_detail         | table | opscode-pgsql
    public | node_run_detail_2015_01 | table | opscode-pgsql
    public | node_run_detail_2015_02 | table | opscode-pgsql
    public | node_run_detail_2015_03 | table | opscode-pgsql
    public | node_run_detail_2015_04 | table | opscode-pgsql
    public | node_run_detail_2015_05 | table | opscode-pgsql
    public | node_run_detail_2015_06 | table | opscode-pgsql
    public | node_run_detail_2015_07 | table | opscode-pgsql
    public | node_run_detail_2015_08 | table | opscode-pgsql
    public | node_run_detail_2015_09 | table | opscode-pgsql
    public | node_run_detail_2015_10 | table | opscode-pgsql
    public | node_run_detail_2015_11 | table | opscode-pgsql
    public | node_run_detail_2015_12 | table | opscode-pgsql
    public | node_run_foreign_key    | table | opscode-pgsql
    public | node_run_in_progress    | table | opscode-pgsql
    public | node_runcounts_day      | table | opscode-pgsql
    public | node_runcounts_hour     | table | opscode-pgsql
    public | node_runcounts_minute   | table | opscode-pgsql
    public | node_runcounts_week     | table | opscode-pgsql
    public | stale_node_runs         | table | opscode-pgsql
    
  2. It is critical that you restore any missing 2015-XX partitions before upgrading. To restore them, download the following two attached SQL files to your backend/standalone Chef server and execute them like so:

    sudo -u opscode-pgsql /opt/opscode/embedded/bin/psql opscode_reporting -f /tmp/node_run_2015_partition_tables.sql
    sudo -u opscode-pgsql /opt/opscode/embedded/bin/psql opscode_reporting -f /tmp/node_run_detail_2015_partition_tables.sql
    
  3. Any errors or notices of the nature relation "idx" already exists can be safely ignored

NOTE: For large data sets, the upgrade may take a long time if upgrading from 1.3.0 because additional indexing work is done. To speed the upgrade, purge as much of the 2015 data as you want before running step 2 above:

opscode-reporting-ctl remove-partitions --before 2016-01
Have more questions? Submit a request

Comments

Powered by Zendesk