gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

gpcheckcat enhancement to report tables created using legacy opclass

Open ravoorsh opened this issue 1 year ago • 0 comments

Enhance gpcheckcat to generate a report and log all tables that use legacy opclass in the distribution policy. This enhancement is necessary as ORCA will fallback to the planner in case there are tables created with a mix in distribution policy. The ability to identify and report tables created with a legacy opclass in the distribution policy will help users to pinpoint and rectify the necessary tables.

Option added gpcheckcat -R legacy_distribution_policy

The output of this command will look as follows

#gpcheckcat -R legacy_distribution_policy
Truncated batch size to number of primaries: 4
 
Truncated batch size to number of primaries: 4

Connected as user 'ravoorsh' to database 'ravoorsh', port '7000', gpdb version '7.0'
-------------------------------------------------------------------
Batch size: 4
Performing test 'legacy_distribution_policy'
[ERROR]: Found tables that use legacy opclass in distribution policy. Check the gpcheckcat log for details.
Total runtime for test 'legacy_distribution_policy': 0:00:00.00

SUMMARY REPORT: FAILED
===================================================================
Completed 1 test(s) on database 'ravoorsh' at 2024-02-15 14:15:45 with elapsed time 0:00:00
Failed test(s) that are not reported here: legacy_distribution_policy
See /Users/ravoorsh/gpAdminLogs/gpcheckcat_20240215.log for detail

Extract from the log File:

20240215:14:15:45:029304 gpcheckcat:ravoorsh3MD6R:ravoorsh-[ERROR]:-Found 7 tables that use legacy opclass in distribution policy
20240215:14:15:45:029304 gpcheckcat:ravoorsh3MD6R:ravoorsh-[ERROR]:-legacy table list :
    1) public.t_old
    2) public.t1_old
    3) public.rank_old
    4) public.t_space
    5) public.t_dot
    6) public.t_dash
    7) public.t_multispecial
Total runtime for test 'legacy_distribution_policy': 0:00:00.00
20240215:14:15:45:029304 gpcheckcat:ravoorsh3MD6R:ravoorsh-[INFO]:-------------------------------------
20240215:14:15:45:029304 gpcheckcat:ravoorsh3MD6R:ravoorsh-[INFO]:-Check complete

ravoorsh avatar Feb 05 '24 11:02 ravoorsh