-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PostgreSQL Cluster Sync Fixes and Refactoring #5297
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
renecannao
wants to merge
46
commits into
v3.0
Choose a base branch
from
fix/postgresql-cluster-sync_2
base: v3.0
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.
+4,908
−1,157
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
b67c7c1
feat: Implement PostgreSQL cluster synchronization for issue #5147
renecannao d96be35
fix: Add pgsql_servers_v2 to runtime_checksums_values table and creat…
renecannao e0dec1c
fix: Complete pgsql_servers_v2 checksum integration in runtime_checks…
renecannao 958d250
fix: Correct PostgreSQL query rules cluster sync implementation
renecannao 7a08167
fix: Correct PostgreSQL checksum structure field names
renecannao 87a64b7
fix: Add missing PostgreSQL includes and fix type conversion warnings
renecannao 187b71e
fix: Correct TAP test syntax according to TAP_TESTS_GUIDE.md
renecannao 697b68e
docs: Add comprehensive Doxygen documentation for PostgreSQL cluster …
renecannao 2444456
refactor: Add memory management helper to reduce code duplication
renecannao 1d73967
refactor: Add safe_update_peer_info helper function
renecannao 9ec6bef
refactor: Eliminate massive duplication in set_checksums() and fix cr…
renecannao a3130ca
feat: Complete PostgreSQL cluster synchronization with pgsql_variable…
renecannao e2d6411
Refactor ProxySQL_Cluster: Eliminate code duplication and modernize a…
renecannao 2c9bb51
refactor: Optimize process_component_checksum() and eliminate repetit…
renecannao 2c08e77
refactor: Implement loop-based sync decision optimization for admin_v…
renecannao c2a05ae
refactor: Apply enabled_check() pattern to ChecksumModuleInfo for uni…
renecannao c97cca0
refactor: unify ChecksumModuleInfo and SyncModuleConfig structures
renecannao c37481a
feat: add missing PostgreSQL variables sync metrics counters
renecannao 4503c58
refactor: unify duplicate get_peer_to_sync_* variables functions
renecannao 1beb5b9
fix: address review comments for PostgreSQL cluster sync PR
renecannao a8a7b56
fix: correct MySQL variables DELETE query variable name
renecannao ab2c4f3
feat: add PostgreSQL variables to unified cluster sync
renecannao 5af4011
feat: add CLUSTER_SYNC_INTERFACES_PGSQL interface filtering
renecannao 1b58c78
feat: implement PostgreSQL variables cluster sync core functionality
renecannao 086edfe
feat: add PostgreSQL replication hostgroups and hostgroup attributes …
renecannao d64b4c8
fix: resolve PostgreSQL cluster sync compilation issues
renecannao d11620e
refactor: remove redundant pgsql_variables sync logic
renecannao 777a829
refactor: implement unified pull framework for cluster sync
renecannao 5d61766
refactor: implement comprehensive memory management framework
renecannao ddf3aa0
refactor: extract magic strings to namespace-based constants
renecannao c591610
fix: complete all AI review fixes for PostgreSQL cluster synchronization
renecannao 172346e
fix: remove incorrect variable initializations from ProxySQL_Cluster_…
renecannao 1652e27
Revert "fix: remove incorrect variable initializations from ProxySQL_…
renecannao 6649604
fix: correct ProxySQL_Cluster_Nodes constructor initialization
renecannao cf8692a
fix: address AI review feedback for PostgreSQL cluster sync
renecannao 5154f9e
Merge branch 'v3.0' into fix/postgresql-cluster-sync_2
renecannao f9e3e85
fix: address all AI review concerns for PostgreSQL cluster sync
renecannao b177750
fix: correct PostgreSQL cluster sync architecture by removing separat…
renecannao 3575f54
fix: properly implement checksum_pgsql_variables gating behavior
renecannao 4cdf61c
cluster: complete PostgreSQL servers sync flow and fix TAP libtap sta…
renecannao 6dbd0e9
Merge branch 'v3.0' into fix/postgresql-cluster-sync_2
renecannao 5c7e616
PR5297: resolve remaining actionable review findings for PGSQL checks…
renecannao bf9fc81
test: strengthen pgsql cluster sync TAP follow-up
renecannao d702e7d
doc: summarize pgsql cluster sync branch status
renecannao c2e3837
doc: add non-CI todo for pgsql cluster sync
renecannao 859c89b
cluster: harden PostgreSQL cluster sync parity paths after real two-n…
renecannao 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
520 changes: 520 additions & 0 deletions
520
doc/proxysql_cluster/pgsql_cluster_sync_pr5297_status.md
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
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.
Double
wrunlock()inflush_pgsql_variables__from_memory_to_diskimplementation.The implementation in
lib/ProxySQL_Admin.cpp(lines 6029–6035) callsadmindb->wrunlock()twice while acquiring the lock only once:Calling
wrunlock()on an already-unlocked lock is undefined behavior — it can corrupt the lock state, cause a hang, or crash.🐛 Proposed fix
void ProxySQL_Admin::flush_pgsql_variables__from_memory_to_disk() { admindb->wrlock(); admindb->execute("PRAGMA foreign_keys = OFF"); admindb->execute("INSERT OR REPLACE INTO disk.global_variables SELECT * FROM main.global_variables WHERE variable_name LIKE 'pgsql-%'"); admindb->wrunlock(); - admindb->wrunlock(); }🤖 Prompt for AI Agents