Skip to content

feat(analyze-schema): implement version-aware extension reporting#3286

Open
krishanu7 wants to merge 1 commit into
yugabyte:mainfrom
krishanu7:fix/2420-pg-extension-version-detection
Open

feat(analyze-schema): implement version-aware extension reporting#3286
krishanu7 wants to merge 1 commit into
yugabyte:mainfrom
krishanu7:fix/2420-pg-extension-version-detection

Conversation

@krishanu7

@krishanu7 krishanu7 commented Jan 15, 2026

Copy link
Copy Markdown
Contributor
  • Enhanced to report extension support based on the specified target YugabyteDB version.
  • Added a version support matrix for extensions like , , , and .
  • Updated NewExtensionsIssue to dynamically populate , allowing Voyager to filter false positives for supported versions.
  • Handled the removal of the extension for PG15-based YugabyteDB versions (2.25+).
  • Added a new unit test suite New Test Cases to verify version-specific support across multiple YugabyteDB series.

Describe the changes in this pull request

This pull request enhances the analyze-schema / assessment phase to detect unsupported PostgreSQL extensions based on the specified target YugabyteDB version, instead of relying on a static extension list.

Previously, YB Voyager used a fixed list of supported extensions, which caused false positives when extensions were newly supported in recent YugabyteDB releases.

Key changes:

  • Base Support Added

    • Added vector to the SupportedExtensionsOnYB list in helpers.go.
  • Version Support Matrix

    • Introduced a mapping of extensions to their minimum supported YugabyteDB versions in helpers.go.
    • The data is extracted from the validation logic already present in the migtests suite, ensuring consistency.
  • Dynamic Issue Metadata

    • Updated NewExtensionsIssue in issues_ddl.go to populate the MinimumVersionsFixedIn field.
    • This enables Voyager’s existing filtering logic to automatically suppress “unsupported extension” warnings when the specified target version supports the extension.
  • Deprecation Handling

    • Implemented version-aware logic for timetravel, marking it unsupported only for PG15-based versions (2.25+, 2025.1+), while preserving support for older versions.

Describe if there are any user-facing changes

  • Reports

    • schema_analysis_report.json and assessment reports will no longer flag extensions such as vector, pg_partman, or anon as unsupported when the provided --target-db-version supports them.
  • Command Line

    • No changes to existing flags.
  • Configuration

    • No changes.
  • Installation

    • No changes.

How was this pull request tested?

  • New Unit Tests

    • Added a comprehensive test suite in
      yb-voyager/src/query/queryissue/extensions_test.go
    • Covers extension support and unsupported scenarios across multiple YugabyteDB version series:
      • 2.25
      • 2024.1
      • 2024.2
      • 2025.1
  • Manual Verification

    • Ran analyze-schema with different --target-db-version values to verify:
      • vector is correctly detected as supported where applicable.
      • Version-specific extensions are flagged only when unsupported for the chosen target version.

Does your PR have changes in callhome/yugabyted payloads? If so, is the payload version incremented?

No.


Does your PR have changes to on-disk structures that can cause upgrade issues?

No.


Note

Medium Risk
Changes schema assessment output by dynamically suppressing/flagging UNSUPPORTED_EXTENSION issues based on target YugabyteDB version; incorrect version mappings could hide real incompatibilities or reintroduce false positives.

Overview
Makes UNSUPPORTED_EXTENSION reporting version-aware by attaching per-extension MinimumVersionsFixedIn data to NewExtensionsIssue, derived from a new extension→YB-series minimum-version matrix.

Updates the static supported extension list to include vector, and adds unit tests covering version-specific support/removal scenarios (e.g., pg_partman, anon, timetravel) plus unknown-extension behavior across multiple YugabyteDB versions.

Written by Cursor Bugbot for commit 461c29c. This will update automatically on new commits. Configure here.

Comment thread yb-voyager/src/query/queryissue/helpers.go
Comment thread yb-voyager/src/query/queryissue/helpers.go
"pg_parquet": {
ybversion.SERIES_2025_2: "2025.2.0.0",
},
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Version map uses wrong type for integration

Medium Severity

extensionsFixedInVersions stores version values as map[string]string, but MinimumVersionsFixedIn on the Issue struct expects map[string]*ybversion.YBVersion. Every existing usage of MinimumVersionsFixedIn in issues_ddl.go uses *ybversion.YBVersion constants directly. GetExtensionFixedVersions returns map[string]string, which is type-incompatible with the field it's designed to populate. This inconsistency means the data cannot be used without adding string-to-*ybversion.YBVersion parsing, making the integration unnecessarily error-prone.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

change the map type to map[string]map[string]*ybversion.YBVersion @krishanu7

- Enhanced  to report extension support based on the specified target YugabyteDB version.
- Added a version support matrix for extensions like , , , and .
- Updated [NewExtensionsIssue](yb-voyager/yb-voyager/src/query/queryissue/issues_ddl.go) to dynamically populate , allowing Voyager to filter false positives for supported versions.
- Handled the removal of the  extension for PG15-based YugabyteDB versions (2.25+).
- Added a new unit test suite [yb-voyager/yb-voyager/src/query/queryissue/extensions_test.go) to verify version-specific support across multiple YugabyteDB series.
@sincfaio sincfaio force-pushed the fix/2420-pg-extension-version-detection branch from bcdf2ce to 461c29c Compare February 27, 2026 07:25

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

issue.MinimumVersionsFixedIn = make(map[string]*ybversion.YBVersion)
for series, verStr := range fixedVersions {
ver, _ := ybversion.NewYBVersion(verStr)
issue.MinimumVersionsFixedIn[series] = ver

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ignored error could cause nil pointer panic

Medium Severity

The error from ybversion.NewYBVersion(verStr) is silently discarded. If parsing ever fails (e.g., a malformed version string is added to extensionsFixedInVersions in the future), ver will be nil and stored in MinimumVersionsFixedIn. Later, IsFixedIn retrieves this nil value and calls v.GreaterThanOrEqual(nil), which dereferences nil.Version and causes a runtime panic. While the current hardcoded version strings are all valid, this pattern creates a latent crash risk that's hard to diagnose.

Fix in Cursor Fix in Web

@sincfaio sincfaio 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.

Thank You @krishanu7 for solving this issue! If you can address the review comments, we can merge this soon.

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.

move these tests to issues_ddl.go?

"pg_parquet": {
ybversion.SERIES_2025_2: "2025.2.0.0",
},
}

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.

change the map type to map[string]map[string]*ybversion.YBVersion @krishanu7

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.

Version specific detection for PG extension in assessment phase

2 participants