GPCC: Automatic monthly partition creation is failing in gpmetrics schema
search cancel

GPCC: Automatic monthly partition creation is failing in gpmetrics schema

book

Article ID: 295191

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article affects customers using GPCC in the following versions:
4.6.x, 4.7, 4.8, 6.0

By default, GPCC will automatically add a monthly partition to the tables in gpmetrics schema to store history data. For the month of October, if you are in a country with Daylight Savings Time and have enabled it, then this will fail. You will see messages such as the following in the GPDB/GPCC logs:
2019-09-17 07:44:57.864913 CEST,"gpmon","gpperfmon",p17768,th-1361094784,"10.113.96.27","18976",2019-09-17 07:44:54 CEST,0,con1519216,cm
d3,seg-1,,dx54934914,,sx1,"ERROR","42P16","START equal to END for partition",,,,,,"ALTER TABLE gpmetrics.gpcc_system_history ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-10-01') EXCLUSIVE WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYP
E, COMPRESSLEVEL=1)",0,,"parse_partition.c",4115,
2019-09-17 07:44:57.919106 CEST,"gpmon","gpperfmon",p43871,th-1361094784,"10.113.96.27","43104",2019-09-17 03:14:54 CEST,0,con1503892,cm
d2568,seg-1,,dx54934919,,sx1,"ERROR","42P16","START equal to END for partition",,,,,,"ALTER TABLE gpmetrics.gpcc_disk_history ADD PARTIT
ION START (date '2019-10-01') INCLUSIVE END (date '2019-10-01') EXCLUSIVE WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TY
PE, COMPRESSLEVEL=1)",0,,"parse_partition.c",4115,
webserver.log
2019/09/25 07:44:58 Fails to create partition of next month for gpcc_system_history pq: START equal to END for partition
2019/09/25 07:44:58 Fails to create partition of next month for gpcc_disk_history pq: START equal to END for partition
2019/09/25 07:44:58 Fails to create partition of next month for gpcc_database_history pq: START equal to END for partition
2019/09/25 07:44:58 Fails to create partition of next month for gpcc_queries_history pq: START equal to END for partition
2019/09/25 07:44:58 Fails to create partition of next month for gpcc_plannode_history pq: START equal to END for partition
Notice that the begin date is the same as the end date. This will affect customers in the following areas:

1. In a daylight saving time (DST) zone

AND

2. DST ending in October

If you let the month pass without manually creating these partitions, then GPCC will fail to store history data in the proper partition and temporary files can pile up under $GPCC_HOME/ccdata directory.

Resolution

This issue has been fixed and will be included in the following versions:
4.9.0, 6.1.0

If you notice the messages in your log files and cannot upgrade, please manually create the partitions using the sample DDLs:

psql -U gpmon gpperfmon
ALTER TABLE gpmetrics.gpcc_disk_history
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_system_history
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_queries_history
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_plannode_history
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_database_history
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_alert_log
      ADD PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=RLE_TYPE, COMPRESSLEVEL=2);

ALTER TABLE gpmetrics.gpcc_pg_log_history
      SPLIT DEFAULT PARTITION START (date '2019-10-01') INCLUSIVE END (date '2019-11-01') EXCLUSIVE
      INTO(PARTITION t2019Oct, DEFAULT PARTITION);
The auto partition creation will continue as normal in the other months.