Skip to content

Conversation

@tuhaihe
Copy link
Member

@tuhaihe tuhaihe commented Dec 12, 2025

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Import the diskquota extension source code from the archived Greenplum
repository.

The upstream repository is archived and no longer maintained. This
migration moves the code into the Apache Cloudberry codebase under
`gpcontrib` directory to ensure continued maintenance and future
adaptation for Apache Cloudberry.

Source: https://github.com/greenplum-db/diskquota-archive
Commit: 467fcf68254f678e19aaacc4cac9d84146501148
Cleanup the invalid files after importing diskquota extension from upstream.

The specific changes include:
1. Remove .github directory: The upstream GitHub Actions workflows are
   no longer applicable in the Cloudberry repository.
2. Remove .gitmessage, .editorconfig, .clang-format: Code style and
   commit templates should follow Cloudberry's main repository standards.
3. Remove SECURITY.md: Legacy security policy.
4. Remove concourse directory: Legacy CI scripts.

This cleanup makes the extension structure cleaner and more consistent
with other contrib modules.
Integrate diskquota extension into Apache Cloudberry build system and
adapt the codebase for Cloudberry 2.0+ (PostgreSQL 14 based).

Main changes:

Build system integration:
* Add new Makefile for building with Cloudberry source tree
    ```
    make
    make install
    make installcheck
    make clean
    ```
* Update gpcontrib/Makefile to include diskquota in build and installcheck
* Simplify CMakeLists.txt by removing GP6 version conditionals
* Add PG_SRC_DIR availability check for isolation2 tests

Code modernization (remove GP6 compatibility code):
* Remove GP_VERSION_NUM < 70000 conditionals throughout codebase
* Replace deprecated APIs:
    heap_open -> table_open,
    heap_beginscan_catalog -> table_beginscan_catalog,
    heap_endscan -> table_endscan, etc.
* Replace init_ps_display() with set_ps_display() for process status
* Replace StrNCpy() with snprintf() for safer string handling
* Remove WaitForBackgroundWorkerShutdown() polyfill (now in core)
* Remove MemoryAccounting_Reset() calls (removed in GP7+)
* Update tuple descriptor attribute access from pointer to direct access

Documentation:
* Rewrite README.md for Apache Cloudberry with updated build instructions

Other improvements:
* Update extension comment to be more descriptive
* Ensure postgres.h is included first in all source files

CI:
* add ic-diskquota to `build-cloudberry.yml` workflow
* For `build-deb-cloudberry.yml`, the installation and configure prefix
  are not consisent, which results in the test error. Will add
  ic-diskquota test back once updating the deb workflow.

See: https://lists.apache.org/thread/1zd80r1hvpwwh5fjd5yqgcc7sr4f27qr
Add diskquota extension license information to comply with Apache
release requirements.

Changes:
- Add diskquota entry to top-level LICENSE file under Greenplum section
- Create licenses/LICENSE-diskquota.txt with PostgreSQL License text
- Add gpcontrib/diskquota/** to pom.xml excludes for apache-rat checks

The diskquota extension is licensed under the PostgreSQL License,
originally developed by Pivotal Software and VMware.
@Smyatkin-Maxim Smyatkin-Maxim self-requested a review December 19, 2025 13:08
Copy link
Contributor

@leborchuk leborchuk left a comment

Choose a reason for hiding this comment

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

Checked it on my development ubuntu installation, all simple tests works fine

Here the output from examples

postgres=# select * from diskquota.show_fast_schema_quota_view;
 schema_name | schema_oid | quota_in_mb | nspsize_in_bytes
-------------+------------+-------------+------------------
 s1          |      17157 |           1 |            98304

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.

2 participants