Repository navigation
node, store: Add fdw_host and fdw_port to set the address for cross-shard postgres_fdw - #6827
Open
cjorge-thegraph wants to merge 1 commit into
Open
cjorge-thegraph wants to merge 1 commit into
cjorge-thegraph wants to merge 1 commit into
Conversation
…hard postgres_fdw Each shard's database reaches the other shards through postgres_fdw, and graph-node creates those foreign servers with the host and port from each shard's connection. When graph-node reaches a database at an address the databases can't use themselves, such as a connection pooler or a private endpoint in graph-node's own network, the foreign servers point at an address the databases can't connect to. fdw_host and fdw_port in [store.<name>] set the address the other shards' databases use for this shard. Both default to the host and port in connection, so existing configurations are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Each shard's database reaches the other shards through
postgres_fdw, andgraph-nodecreates those foreign servers with the host and port from each shard'sconnection. That assumes the addressgraph-nodeuses is one the databases can use too. It isn't whengraph-nodeconnects through something only it can reach, such as a connection pooler, or a private endpoint in its own network (for example a Private Service Connect endpoint for Cloud SQL, whose name the database instances themselves can't resolve). The foreign servers then point at an address the databases can't connect to, and cross-shard work fails, e.g.Mirroring primary tables failed … could not connect to server "shard_primary".This adds two optional settings to
[store.<name>]:fdw_host: the host the other shards' databases use to reach this shard throughpostgres_fdwfdw_port: the port that goes with itBoth default to the host and port in
connection, so existing configurations behave exactly as before. User, password and database name still come fromconnection.fdw_hostgets the same environment variable expansion asconnection.docs/config.mddocuments the settings, and there are tests for parsing the configuration and for the override inForeignServer.🤖 Generated with Claude Code