Skip to content

Import gp_relsizes_stats extention from Greenplum#1757

Open
Vlasdislav wants to merge 2 commits into
apache:mainfrom
Vlasdislav:gp_relsizes_stats
Open

Import gp_relsizes_stats extention from Greenplum#1757
Vlasdislav wants to merge 2 commits into
apache:mainfrom
Vlasdislav:gp_relsizes_stats

Conversation

@Vlasdislav

@Vlasdislav Vlasdislav commented May 19, 2026

Copy link
Copy Markdown
  • Add new extension gp_relsizes_stats
  • Add in-tree build support while keeping standalone USE_PGXS=1 build mode
  • Adapt SQL for Cloudberry / PostgreSQL 14
  • Replace GP6 partition catalog usage with recursive pg_inherits traversal
  • Handle partition roots and intermediate partitioned tables with relfilenode = 0 by reporting size as 0
  • Remove unsupported OIDS=FALSE
  • Drop EXECUTE ON MASTER from manual collection function
  • Update README terminology and installation instructions for Cloudberry

Based on the implementation: https://github.com/open-gpdb/gp_relsizes_stats

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @Vlasdislav welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports the gp_relsizes_stats extension into the Cloudberry monorepo under gpcontrib/, integrating it into the in-tree build and adding regression tests.

Changes:

  • Adds the new gp_relsizes_stats extension (C code, SQL install/upgrade scripts, control file, docs).
  • Integrates the extension into gpcontrib/Makefile recursion targets and adds a dual-mode (PGXS vs in-tree) Makefile.
  • Adds regression tests and expected outputs for functionality and privilege behavior.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
gpcontrib/Makefile Adds gp_relsizes_stats to the gpcontrib build recurse targets.
gpcontrib/gp_relsizes_stats/Makefile Builds/installs the extension in-tree or via PGXS; wires up regression tests.
gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c Implements background worker orchestration and filesystem stats collection.
gpcontrib/gp_relsizes_stats/sql/gp_relsizes_stats--1.3.sql Creates schema/tables/views and declares C functions.
gpcontrib/gp_relsizes_stats/sql/gp_relsizes_stats--1.2--1.3.sql Upgrade script (grants).
gpcontrib/gp_relsizes_stats/sql/gp_relsizes_stats--1.1--1.2.sql Upgrade script (view changes).
gpcontrib/gp_relsizes_stats/sql/gp_relsizes_stats--1.0--1.1.sql Upgrade script (function signature change).
gpcontrib/gp_relsizes_stats/gp_relsizes_stats.control Registers extension metadata (version, module path, trusted flag).
gpcontrib/gp_relsizes_stats/test/sql/grants.sql Adds privileges/regression coverage for creator + granting to another role.
gpcontrib/gp_relsizes_stats/test/sql/gp_relsizes_stats.sql Adds functional regression coverage for stats collection and size reporting.
gpcontrib/gp_relsizes_stats/test/expected/grants.out Expected output for grants.sql.
gpcontrib/gp_relsizes_stats/test/expected/gp_relsizes_stats.out Expected output for gp_relsizes_stats.sql.
gpcontrib/gp_relsizes_stats/README.md Extension documentation.
gpcontrib/gp_relsizes_stats/LICENCE Bundled Apache 2.0 license text for the extension.
gpcontrib/gp_relsizes_stats/.gitignore Ignores local build artifacts in the extension directory.
gpcontrib/gp_relsizes_stats/.clang-format Local formatting configuration for the extension sources.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c Outdated
Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c Outdated
Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c
Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c Outdated
Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c Outdated
Comment thread gpcontrib/gp_relsizes_stats/test/sql/grants.sql
Comment thread gpcontrib/gp_relsizes_stats/test/sql/gp_relsizes_stats.sql
Comment thread gpcontrib/gp_relsizes_stats/README.md Outdated
Comment thread gpcontrib/gp_relsizes_stats/README.md Outdated
Comment thread gpcontrib/gp_relsizes_stats/Makefile Outdated
@tuhaihe

tuhaihe commented May 21, 2026

Copy link
Copy Markdown
Member

Hi @Vlasdislav thanks for your work. The following are my comments for your reference:

  1. Import the commit history to the gpcontrib/gp_relsizes_stats from the start for a better rebase:
git filter-repo --force --to-subdirectory-filter gpcontrib/gp_relsizes_stats
  1. Rewrite some commits for a better clean & lean commit history

  2. ASF license compliance. See more comments in the code.

Comment thread gpcontrib/gp_relsizes_stats/src/gp_relsizes_stats.c
Comment thread gpcontrib/gp_relsizes_stats/LICENCE
Comment thread gpcontrib/gp_relsizes_stats/Makefile Outdated
Comment thread gpcontrib/gp_relsizes_stats/test/expected/gp_relsizes_stats.out
@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch from 3514aa1 to 6ee3710 Compare May 21, 2026 16:03
@Vlasdislav Vlasdislav requested a review from tuhaihe May 22, 2026 11:07
Comment thread gpcontrib/Makefile
@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch from c0217c2 to 9c9866d Compare May 27, 2026 11:33
@Vlasdislav Vlasdislav changed the title Moved gp_relsizes_stats extention from Greenplum Import gp_relsizes_stats extention from Greenplum May 27, 2026
@Vlasdislav Vlasdislav requested review from leborchuk and tuhaihe May 27, 2026 17:29
@tuhaihe

tuhaihe commented May 29, 2026

Copy link
Copy Markdown
Member

Hi @Vladislav,

Thank you for your work. Here are my comments for your consideration:

  1. Please re-import the commit history into the gpcontrib/*** directory instead of placing it in the root directory -- from the first commit, though moving the files to gpcontrib at last. This change will help prevent conflicts with the top source code files in Cloudberry when rebasing the PR.
  2. It would be beneficial to clean up the commit history.

You can refer to this PR for guidance: #1629.

@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch 5 times, most recently from 16c18fd to 6f1a976 Compare June 2, 2026 16:35
@Vlasdislav

Copy link
Copy Markdown
Author

Hi @Vladislav,

Thank you for your work. Here are my comments for your consideration:

  1. Please re-import the commit history into the gpcontrib/*** directory instead of placing it in the root directory -- from the first commit, though moving the files to gpcontrib at last. This change will help prevent conflicts with the top source code files in Cloudberry when rebasing the PR.
  2. It would be beneficial to clean up the commit history.

You can refer to this PR for guidance: #1629.

Hi, @tuhaihe, See if I understood you correctly.

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked - all looks good for me, much more better than original version

Comment thread gpcontrib/gp_relsizes_stats/gp_relsizes_stats.control
@leborchuk

Copy link
Copy Markdown
Contributor

See regression in tests, check https://github.com/apache/cloudberry/actions/runs/26833894082/job/79174723029?pr=1757 - some issues with history stat and partition info

@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch from 6f1a976 to f07716d Compare June 3, 2026 08:03
@Vlasdislav

Vlasdislav commented Jun 3, 2026

Copy link
Copy Markdown
Author

See regression in tests, check https://github.com/apache/cloudberry/actions/runs/26833894082/job/79174723029?pr=1757 - some issues with history stat and partition info

If I understood your message correctly, then I looked at the error and the problem is not in the code (local it's OK), but in the configuration of running the CI test. There may be a fix in this commit: f07716d.

Comment thread pom.xml Outdated
@tuhaihe

tuhaihe commented Jun 8, 2026

Copy link
Copy Markdown
Member

Overall, LGTM now from the non-tech side, like the ASF-compliance related. Would like to have your technical comments on this PR, cc @my-ship-it @Smyatkin-Maxim, @yjhjstz

@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch 2 times, most recently from 0e88a45 to 438746c Compare June 8, 2026 16:04
@Smyatkin-Maxim

Copy link
Copy Markdown
Contributor

cc @my-ship-it @Smyatkin-Maxim, @yjhjstz

Will take a look

@my-ship-it my-ship-it left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@Smyatkin-Maxim Smyatkin-Maxim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we have to squash it to just two commits: @AndrewOvvv `s initial commit to keep authorship and the other one with @Vlasdislav changes.

@Vlasdislav Vlasdislav force-pushed the gp_relsizes_stats branch 2 times, most recently from fbce008 to 21be9f2 Compare June 22, 2026 08:26
@tuhaihe

tuhaihe commented Jun 22, 2026

Copy link
Copy Markdown
Member

Hi @Vlasdislav we are unable to complete the rebase and merge process due to certain conflicts. Perhaps you could try rebasing on your local machine.

@Vlasdislav

Copy link
Copy Markdown
Author

Hi @Vlasdislav we are unable to complete the rebase and merge process due to certain conflicts. Perhaps you could try rebasing on your local machine.

Hi, @tuhaihe should be OK now

Comment thread .github/workflows/yezzey-ci.yaml Outdated
@tuhaihe

tuhaihe commented Jun 24, 2026

Copy link
Copy Markdown
Member

The ic-isolations2 test prevents this pull request from being merged. Despite several attempts, it has consistently failed.

Updates:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants