-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
externalconn, streamingccl: support external connections as replication sources #96551
Conversation
8602515
to
6249058
Compare
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.
Big thank you for doing this! Overall lgtm barring one comment about the external connection type.
for _, scheme := range postgresSchemes() { | ||
externalconn.RegisterConnectionDetailsFromURIFactory( | ||
scheme, | ||
connectionpb.ConnectionProvider_sql, |
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.
heh, so I think we added this for experimental-sql
but didn't end up using it because of this TODO
// TODO (zinger): Not including SinkSchemeExperimentalSQL for now because A: it's undocumented |
ConnectionProvider_postgres
. On a similar note, I don't think this ExternalConnection object should be of type Storage
: ConnectionProvider_webhookhttp, ConnectionProvider_webhookhttps, ConnectionProvider_gcpubsub: |
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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @benbardin)
pkg/ccl/streamingccl/streamingest/external_connection.go
line 48 at r1 (raw file):
Previously, adityamaru (Aditya Maru) wrote…
heh, so I think we added this for
experimental-sql
but didn't end up using it because of this TODO. I don't know much about experimental sql sinks but does it makes sense to reuse this type or should we delete it and add a
// TODO (zinger): Not including SinkSchemeExperimentalSQL for now because A: it's undocumented ConnectionProvider_postgres
. On a similar note, I don't think this ExternalConnection object should be of typeStorage
:. Should we add a new type?
ConnectionProvider_webhookhttp, ConnectionProvider_webhookhttps, ConnectionProvider_gcpubsub:
As it happens, experimental-sql also requires a postgres connection string and connects the same way, so I don't think it does any harm to reuse the sql
type. For the connection type, sure, I can add a new one. Would "Source" make sense? Or "ForeignData" maybe, to borrow a postgres idiom?
SGTM TIL about |
6249058
to
e260ebe
Compare
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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @benbardin)
pkg/ccl/streamingccl/streamingest/external_connection.go
line 48 at r1 (raw file):
Previously, HonoreDB (Aaron Zinger) wrote…
As it happens, experimental-sql also requires a postgres connection string and connects the same way, so I don't think it does any harm to reuse the
sql
type. For the connection type, sure, I can add a new one. Would "Source" make sense? Or "ForeignData" maybe, to borrow a postgres idiom?
Done.
bors r=[adityamaru] |
Build failed: |
e260ebe
to
f805078
Compare
bors r+ |
Build failed (retrying...): |
bors r- needs a |
Canceled. |
…on sources This PR adds support for creating external connections with the postgresql scheme and using them in a `CREATE TENANT ... FROM REPLICATION OF external://name` statement. Among other benefits, this lets users validate their postgresql connection strings before creating the job, as creating the external connection will ping the source DB. Release note (enterprise change): Added support for `CREATE EXTERNAL CONNECTION ... AS "postgresql://"` or `"postgres://"`. These external connections may be specified as the source in streaming replication.
f805078
to
7fed328
Compare
Sorry about that. |
bors r+ |
Build succeeded: |
This PR adds support for creating external connections with the postgresql scheme and using them in a
CREATE TENANT ... FROM REPLICATION OF external://name
statement. Among other benefits, this lets users validate their postgresql connection strings before creating the job, as creating the external connection will ping the source DB.Release note (enterprise change): Added support for
CREATE EXTERNAL CONNECTION ... AS "postgresql://"
or"postgres://"
. These external connections may be specified as the source in streaming replication.Informs #93629