vrepl: import from multiple external sources#6103
Conversation
|
Does it have to be via insert only or the workflow can be run with vtctl command as well? |
It's actually a vtctl VReplicationExec command. I just pasted the insert part of it. |
| te.txPool.Open(te.env.Config().DB.AppWithDB(), te.env.Config().DB.DbaWithDB(), te.env.Config().DB.AppDebugWithDB()) | ||
|
|
||
| if te.twopcEnabled && te.state == AcceptingReadAndWrite { | ||
| te.twoPC.Open(te.env.DBConfigs()) | ||
| te.twoPC.Open(te.env.Config().DB) |
There was a problem hiding this comment.
I am not liking these kind of calls Config().DB.AppWithDB. I like it before with DBConfig().func
There was a problem hiding this comment.
I can add a convenience function that shortcuts Config().DB to DBConfigs() keeping it backward compatible. Will that work?
|
@rohit-nayak-ps , interested in looking at vreplication changes? |
| te.txPool.Open(te.env.Config().DB.AppWithDB(), te.env.Config().DB.DbaWithDB(), te.env.Config().DB.AppDebugWithDB()) | ||
|
|
||
| if te.twopcEnabled && te.state == AcceptingReadAndWrite { | ||
| te.twoPC.Open(te.env.DBConfigs()) | ||
| te.twoPC.Open(te.env.Config().DB) |
There was a problem hiding this comment.
I can add a convenience function that shortcuts Config().DB to DBConfigs() keeping it backward compatible. Will that work?
go/cmd/vttablet/vttablet.go
Outdated
| config.DB = config.DB.Init(socketFile) | ||
| config.DB.Init(socketFile) | ||
| for _, cfg := range config.ExternalConnections { | ||
| cfg.Init("") |
There was a problem hiding this comment.
nit - Maybe it would be clearer to have InitWithSocket and Init() I found it a bit confusing that this is initialized with empty string without any context on why that's the case.
| } | ||
|
|
||
| func startExternalVReplication(t *testing.T, bls *binlogdatapb.BinlogSource) (cancelr func()) { | ||
| query := binlogplayer.CreateVReplication("test", bls, "", 9223372036854775807, 9223372036854775807, 0, vrepldb) |
There was a problem hiding this comment.
It seems that we are only testing vcopy in this test. I think we should also test a externalVReplication with a starting position provided. That will ensure that we go through the main methods of the interface (VStream and VStreamRows). I think this got lost when deleting the old tests.
There are upcoming use cases where we'll create new named subcomponents of tabletserver along with the global unnamed one. Specifically for vreplication external mysql. This change will tolerate such usage and we'll just reuse the vars created by the unnamed tabletserver. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
The binlog dump was using dba privileges, but it's better to use app, which is also expected to have privileges to request binlogs. Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
|
LGTM |
This change builds on top of the tabletserver componentization changes. With this change, you can add a section to the tablet_config yaml that configures external sources, like this:
You can then create replication streams from these external sources with these inserts: