-
Notifications
You must be signed in to change notification settings - Fork 48
spoc-504: 5.x -> 6.x upgrade path and version safety nets #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danolivo
wants to merge
5
commits into
main
Choose a base branch
from
spoc-504
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c3690ee
patches: expose SpockCorePatchsetVersion from PG core
danolivo 7bc0872
spock: refuse to load against a mismatched core patchset
danolivo 51d346c
spock: add 5.0.9 -> 6.0.0 extension update path
danolivo ab4fa80
tests: add 030 pg_upgrade 5.x -> 6.x via reloption survival + regress…
danolivo 68b6001
tests: 002_create_subscriber: use sync_event/wait_for_sync_event
danolivo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| Spock core-patchset: export patchset version via miscadmin.h and globals.c. | ||
|
|
||
| Adds SPOCK_CORE_PATCHSET_VERSION (compile-time constant) and | ||
| SpockCorePatchsetVersion (runtime global) to the standard places | ||
| PostgreSQL already uses for server-wide state. No new files. | ||
|
|
||
| --- a/src/include/miscadmin.h | ||
| +++ b/src/include/miscadmin.h | ||
| @@ -498,4 +498,11 @@ | ||
| /* in executor/nodeHash.c */ | ||
| extern size_t get_hash_memory_limit(void); | ||
|
|
||
| +/* | ||
| + * Spock core-patchset identity. Bump the version when the patchset | ||
| + * changes in a way visible to the extension binary. | ||
| + */ | ||
| +#define SPOCK_CORE_PATCHSET_VERSION 1 | ||
| +extern PGDLLIMPORT int SpockCorePatchsetVersion; | ||
| + | ||
| #endif /* MISCADMIN_H */ | ||
| --- a/src/backend/utils/init/globals.c | ||
| +++ b/src/backend/utils/init/globals.c | ||
| @@ -114,6 +114,9 @@ | ||
| bool IsBinaryUpgrade = false; | ||
| bool IsBackgroundWorker = false; | ||
|
|
||
| +/* Spock core-patchset identity. */ | ||
| +int SpockCorePatchsetVersion = SPOCK_CORE_PATCHSET_VERSION; | ||
| + | ||
| bool ExitOnAnyError = false; | ||
|
|
||
| int DateStyle = USE_ISO_DATES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| Spock core-patchset: export patchset version via miscadmin.h and globals.c. | ||
|
|
||
| Adds SPOCK_CORE_PATCHSET_VERSION (compile-time constant) and | ||
| SpockCorePatchsetVersion (runtime global) to the standard places | ||
| PostgreSQL already uses for server-wide state. No new files. | ||
|
|
||
| --- a/src/include/miscadmin.h | ||
| +++ b/src/include/miscadmin.h | ||
| @@ -510,4 +510,11 @@ | ||
| /* in executor/nodeHash.c */ | ||
| extern size_t get_hash_memory_limit(void); | ||
|
|
||
| +/* | ||
| + * Spock core-patchset identity. Bump the version when the patchset | ||
| + * changes in a way visible to the extension binary. | ||
| + */ | ||
| +#define SPOCK_CORE_PATCHSET_VERSION 1 | ||
| +extern PGDLLIMPORT int SpockCorePatchsetVersion; | ||
| + | ||
| #endif /* MISCADMIN_H */ | ||
| --- a/src/backend/utils/init/globals.c | ||
| +++ b/src/backend/utils/init/globals.c | ||
| @@ -114,6 +114,9 @@ | ||
| bool IsBinaryUpgrade = false; | ||
| bool IsBackgroundWorker = false; | ||
|
|
||
| +/* Spock core-patchset identity. */ | ||
| +int SpockCorePatchsetVersion = SPOCK_CORE_PATCHSET_VERSION; | ||
| + | ||
| bool ExitOnAnyError = false; | ||
|
|
||
| int DateStyle = USE_ISO_DATES; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| Spock core-patchset: export patchset version via miscadmin.h and globals.c. | ||
|
|
||
| Adds SPOCK_CORE_PATCHSET_VERSION (compile-time constant) and | ||
| SpockCorePatchsetVersion (runtime global) to the standard places | ||
| PostgreSQL already uses for server-wide state. No new files. | ||
|
|
||
| --- a/src/include/miscadmin.h | ||
| +++ b/src/include/miscadmin.h | ||
| @@ -525,4 +525,11 @@ | ||
| /* in executor/nodeHash.c */ | ||
| extern size_t get_hash_memory_limit(void); | ||
|
|
||
| +/* | ||
| + * Spock core-patchset identity. Bump the version when the patchset | ||
| + * changes in a way visible to the extension binary. | ||
| + */ | ||
| +#define SPOCK_CORE_PATCHSET_VERSION 1 | ||
| +extern PGDLLIMPORT int SpockCorePatchsetVersion; | ||
| + | ||
| #endif /* MISCADMIN_H */ | ||
| --- a/src/backend/utils/init/globals.c | ||
| +++ b/src/backend/utils/init/globals.c | ||
| @@ -117,6 +117,9 @@ | ||
| bool IsUnderPostmaster = false; | ||
| bool IsBinaryUpgrade = false; | ||
|
|
||
| +/* Spock core-patchset identity. */ | ||
| +int SpockCorePatchsetVersion = SPOCK_CORE_PATCHSET_VERSION; | ||
| + | ||
| bool ExitOnAnyError = false; | ||
|
|
||
| int DateStyle = USE_ISO_DATES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| Spock core-patchset: export patchset version via miscadmin.h and globals.c. | ||
|
|
||
| Adds SPOCK_CORE_PATCHSET_VERSION (compile-time constant) and | ||
| SpockCorePatchsetVersion (runtime global) to the standard places | ||
| PostgreSQL already uses for server-wide state. No new files. | ||
|
|
||
| --- a/src/include/miscadmin.h | ||
| +++ b/src/include/miscadmin.h | ||
| @@ -540,4 +540,11 @@ | ||
| /* in executor/nodeHash.c */ | ||
| extern size_t get_hash_memory_limit(void); | ||
|
|
||
| +/* | ||
| + * Spock core-patchset identity. Bump the version when the patchset | ||
| + * changes in a way visible to the extension binary. | ||
| + */ | ||
| +#define SPOCK_CORE_PATCHSET_VERSION 1 | ||
| +extern PGDLLIMPORT int SpockCorePatchsetVersion; | ||
| + | ||
| #endif /* MISCADMIN_H */ | ||
| --- a/src/backend/utils/init/globals.c | ||
| +++ b/src/backend/utils/init/globals.c | ||
| @@ -120,6 +120,9 @@ | ||
| bool IsUnderPostmaster = false; | ||
| bool IsBinaryUpgrade = false; | ||
|
|
||
| +/* Spock core-patchset identity. */ | ||
| +int SpockCorePatchsetVersion = SPOCK_CORE_PATCHSET_VERSION; | ||
| + | ||
| bool ExitOnAnyError = false; | ||
|
|
||
| int DateStyle = USE_ISO_DATES; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is smart idea in general. It does replace one patch with another though (but smaller). I am thinking one day we could have a spock-lite with reduced functionality that would work with plain Postgres. I will think about this some more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mason-sharp ,
It is trivial to guard our patches and the corresponding Spock machinery. That enables Spock to be used with upstream Postgres. But for production use, at least one patch (logical clock) is a requirement. So, for the safety and predictability, we should have a mechanism to detect patched postgres.