Skip to content

feat(backup): Implement database-specific logic for Cloudberry#14

Merged
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:cloudberry-support
Aug 5, 2025
Merged

feat(backup): Implement database-specific logic for Cloudberry#14
gfphoenix78 merged 1 commit intoapache:sync-with-upstreamfrom
robertmu:cloudberry-support

Conversation

@robertmu
Copy link
Copy Markdown
Contributor

@robertmu robertmu commented Aug 4, 2025

Following the introduction of database type detection (GPDB vs. CBDB) in the underlying common library, this commit applies that new capability throughout the gpbackup codebase.

Previously, all version-based feature checks implicitly assumed the target database was Greenplum. This was insufficient and could lead to incorrect behavior when running against Apache Cloudberry Database, as features might be enabled or disabled based on a versioning scheme that doesn't apply.

This change systematically updates version-sensitive conditional logic to be database-aware. It uses the new IsGPDB() and IsCBDB() helpers to create compound checks.

For example, logic previously guarded by version.AtLeast("7") is now updated to (version.IsGPDB() && version.AtLeast("7")) || version.IsCBDB(). This correctly scopes features to specific GPDB versions while enabling them by default for Cloudberry where appropriate.

This is a critical step to ensure that gpbackup functions reliably and generates correct backup files for both Greenplum and Cloudberry environments.

Following the introduction of database type detection (GPDB vs. CBDB)
in the underlying common library, this commit applies that new
capability throughout the gpbackup codebase.

Previously, all version-based feature checks implicitly assumed the
target database was Greenplum. This was insufficient and could lead
to incorrect behavior when running against Apache Cloudberry Database,
as features might be enabled or disabled based on a versioning
scheme that doesn't apply.

This change systematically updates version-sensitive conditional
logic to be database-aware. It uses the new `IsGPDB()` and `IsCBDB()`
helpers to create compound checks.

For example, logic previously guarded by `version.AtLeast("7")` is now
updated to `(version.IsGPDB() && version.AtLeast("7")) || version.IsCBDB()`.
This correctly scopes features to specific GPDB versions while
enabling them by default for Cloudberry where appropriate.

This is a critical step to ensure that gpbackup functions reliably
and generates correct backup files for both Greenplum and Cloudberry
environments.
@gfphoenix78 gfphoenix78 merged commit 1a786a1 into apache:sync-with-upstream Aug 5, 2025
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