Files
documentdb/pg_documentdb/include
Vinod Sridharan c7876edc0b Merged PR 1583980: [Livesite] Skip downgrade of internal extensions from latest, fix idempotency of upgrade
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Infra
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
If the extension is at a higher version and it rolls back to a previous schema, then we should skip downgrades to the schema by a default version.

----
#### AI description  (iteration 1)
#### PR Classification
Code enhancement to skip downgrading internal extensions from the latest version.

#### PR Summary
This pull request introduces a mechanism to skip downgrading internal extensions if they are already at the latest version.
- `src/infrastructure/process_utility_hook.c`: Added logic to check and skip downgrading if the installed version is newer than the target version.
- `src/pgmongo.c`: Introduced a new configuration variable `pgmongo.skip_extension_downgrade_check` to control the downgrade check behavior.
- `src/test/regress/sql/extension_upgrade_cluster_version.sql` and `src/test/regress/expected/extension_upgrade_cluster_version.out`: Added tests to verify the new behavior of skipping downgrades.
- `src/test/regress/bin/normalize.sed`: Updated normalization script to handle new version format in test outputs.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-02-25 22:09:25 -08:00
..