-
Notifications
You must be signed in to change notification settings - Fork 45
Spock 382: Add per-subscription conflict statistics (PG18+) #356
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
4
commits into
main
Choose a base branch
from
spock-382
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
4 commits
Select commit
Hold shift + click to select a range
bb521b0
Add per-subscription conflict statistics using PG18 custom pgstat kind
danolivo e074083
Fix replication_set regression test for deterministic output
danolivo 153c7b0
Changes after the C-rabbit review.
danolivo 9a37393
Changes after Ibrar's review
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
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
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
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,46 @@ | ||
| /*------------------------------------------------------------------------- | ||
| * | ||
| * spock_conflict_stat.h | ||
| * spock subscription conflict statistics | ||
| * | ||
| * Copyright (c) 2022-2026, pgEdge, Inc. | ||
| * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group | ||
| * Portions Copyright (c) 1994, The Regents of the University of California | ||
| * | ||
| *------------------------------------------------------------------------- | ||
| */ | ||
| #ifndef SPOCK_CONFLICT_STAT_H | ||
| #define SPOCK_CONFLICT_STAT_H | ||
|
|
||
| #include "postgres.h" | ||
|
|
||
| #if PG_VERSION_NUM >= 180000 | ||
|
|
||
| #include "pgstat.h" | ||
|
|
||
| #include "spock_conflict.h" | ||
|
|
||
| /* Shared memory stats entry for spock subscription conflicts */ | ||
| typedef struct Spock_Stat_StatSubEntry | ||
| { | ||
| PgStat_Counter conflict_count[SPOCK_CONFLICT_NUM_TYPES]; | ||
| TimestampTz stat_reset_timestamp; | ||
| } Spock_Stat_StatSubEntry; | ||
|
|
||
| /* Pending (backend-local) entry for spock subscription conflicts */ | ||
| typedef struct Spock_Stat_PendingSubEntry | ||
| { | ||
| PgStat_Counter conflict_count[SPOCK_CONFLICT_NUM_TYPES]; | ||
| } Spock_Stat_PendingSubEntry; | ||
|
|
||
| extern void spock_stat_register_conflict_stat(void); | ||
|
|
||
| extern void spock_stat_report_subscription_conflict(Oid subid, | ||
| SpockConflictType type); | ||
| extern void spock_stat_create_subscription(Oid subid); | ||
| extern void spock_stat_drop_subscription(Oid subid); | ||
| extern Spock_Stat_StatSubEntry *spock_stat_fetch_stat_subscription(Oid subid); | ||
|
|
||
| #endif /* PG_VERSION_NUM >= 180000 */ | ||
|
|
||
| #endif /* SPOCK_CONFLICT_STAT_H */ |
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.