Skip to content

Commit

Permalink
Update the vstream doc in v17.0 to reflect vitessio/vitess#11886
Browse files Browse the repository at this point in the history
  • Loading branch information
yoheimuta committed Mar 15, 2023
1 parent 0ba8a7f commit 9b5ad32
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions content/en/docs/17.0/reference/vreplication/vstream.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ The keyspace, shard, and GTID position list to start streaming from. If no `Shar
then a [table copy phase](https://github.com/vitessio/vitess/issues/6277) will be initiated for the tables matched
by the provided [filter](#filter) on the given shard.

If the `ShardGtid.Shard` value is omitted, this means that all shards in the keyspace specified by `ShardGtid.Keyspace` are included.
Additionally, if `ShardGtid.Keyspace` has a `/` prefix, you can use regular expressions such as `/.*` to include all the keyspaces.

#### Filter

**Type** [Filter](https://pkg.go.dev/vitess.io/vitess/go/vt/proto/binlogdata#Filter)\
Expand Down Expand Up @@ -197,6 +200,42 @@ for {
...
```
### Copy all tables from all shards in the ks keyspace
```go
vgtid := &binlogdatapb.VGtid{
ShardGtids: []*binlogdatapb.ShardGtid{{
Keyspace: "ks",
Gtid: "",
}},
}
filter := &binlogdatapb.Filter{
Rules: []*binlogdatapb.Rule{{
Match: "/.*/",
}},
}
flags := &vtgatepb.VStreamFlags{}
reader, err := gconn.VStream(ctx, topodatapb.TabletType_PRIMARY, vgtid, filter, flags)
```
### Copy all tables from all shards in all keyspaces
```go
vgtid := &binlogdatapb.VGtid{
ShardGtids: []*binlogdatapb.ShardGtid{{
Keyspace: "/.*",
Gtid: "",
}},
}
filter := &binlogdatapb.Filter{
Rules: []*binlogdatapb.Rule{{
Match: "/.*/",
}},
}
flags := &vtgatepb.VStreamFlags{}
reader, err := gconn.VStream(ctx, topodatapb.TabletType_PRIMARY, vgtid, filter, flags)
```
## Debugging
There is also an SQL interface that can be used for testing and debugging from a `vtgate`. Here's an example:
Expand Down

0 comments on commit 9b5ad32

Please sign in to comment.