Backwards compatible replication status to state transition (#10167)

* This effectively reverts 65226ad1d77629fe29e852393a19250a9a910024

It was NOT backwards compatible.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* This adds the new state fields back so that we can switch to them in v15

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Allow for safe/smooth upgrades within 14.0-SNAPSHOT

We are only appending the last io_thread_connecting field

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Avoid intermediate io_thread_connecting protobuf field

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Continue using replication states in v14 tests

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Translate SQL running status to state as well

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use backward compat ReplicaWasRunning check

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add backward compat SQLThreadWasRunning function

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add comment about when backward compat can be removed

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Support older clients with new tablets

Signed-off-by: Matt Lord <mattalord@gmail.com>

* feat: remove SQLThreadWasRunning unused function

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add an upgrade test to verify the replicationstatus is backward compatible

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: fix ReplicaWasRunning so that it doesn't have code dependent on the upgrade

Signed-off-by: Manan Gupta <manan@planetscale.com>

* refactor: rename function to reflect the output type

Signed-off-by: Manan Gupta <manan@planetscale.com>

Co-authored-by: Manan Gupta <manan@planetscale.com>
This commit is contained in:
Matt Lord 2022-04-29 13:59:24 -04:00 коммит произвёл GitHub
Родитель 8a5950df66
Коммит fbf574c835
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 449 добавлений и 63 удалений

Просмотреть файл

@ -75,7 +75,7 @@ func (s *ReplicationStatus) SQLHealthy() bool {
// ReplicationStatusToProto translates a Status to proto3.
func ReplicationStatusToProto(s ReplicationStatus) *replicationdatapb.Status {
return &replicationdatapb.Status{
replstatuspb := &replicationdatapb.Status{
Position: EncodePosition(s.Position),
RelayLogPosition: EncodePosition(s.RelayLogPosition),
FilePosition: EncodePosition(s.FilePosition),
@ -91,6 +91,21 @@ func ReplicationStatusToProto(s ReplicationStatus) *replicationdatapb.Status {
SqlState: int32(s.SQLState),
LastSqlError: s.LastSQLError,
}
// We need to be able to send gRPC response messages from v14 and newer tablets to
// v13 and older clients. The older clients will not be processing the IoState or
// SqlState values in the message but instead looking at the IoThreadRunning and
// SqlThreadRunning booleans so we need to map and share this dual state.
// Note: v13 and older clients considered the IO thread state of connecting to
// be equal to running. That is why we do so here when mapping the states.
// This backwards compatibility can be removed in v15+.
if s.IOState == ReplicationStateRunning || s.IOState == ReplicationStateConnecting {
replstatuspb.IoThreadRunning = true
}
if s.SQLState == ReplicationStateRunning {
replstatuspb.SqlThreadRunning = true
}
return replstatuspb
}
// ProtoToReplicationStatus translates a proto Status, or panics.
@ -118,7 +133,7 @@ func ProtoToReplicationStatus(s *replicationdatapb.Status) ReplicationStatus {
panic(vterrors.Wrapf(err, "cannot decode SourceUUID"))
}
}
return ReplicationStatus{
replstatus := ReplicationStatus{
Position: pos,
RelayLogPosition: relayPos,
FilePosition: filePos,
@ -134,6 +149,30 @@ func ProtoToReplicationStatus(s *replicationdatapb.Status) ReplicationStatus {
SQLState: ReplicationState(s.SqlState),
LastSQLError: s.LastSqlError,
}
// We need to be able to process gRPC response messages from v13 and older tablets.
// In those cases there will be no value (unknown) for the IoState or SqlState but
// the message will have the IoThreadRunning and SqlThreadRunning booleans and we
// need to revert to our assumptions about a binary state as that's all the older
// tablet can provide (really only applicable to the IO status as that is NOT binary
// but rather has three states: Running, Stopped, Connecting).
// This backwards compatibility can be removed in v15+.
if replstatus.IOState == ReplicationStateUnknown {
if s.IoThreadRunning {
replstatus.IOState = ReplicationStateRunning
} else {
replstatus.IOState = ReplicationStateStopped
}
}
if replstatus.SQLState == ReplicationStateUnknown {
if s.SqlThreadRunning {
replstatus.SQLState = ReplicationStateRunning
} else {
replstatus.SQLState = ReplicationStateStopped
}
}
return replstatus
}
// FindErrantGTIDs can be used to find errant GTIDs in the receiver's relay log, by comparing it against all known replicas,

Просмотреть файл

@ -24,6 +24,8 @@ import (
"testing"
"time"
replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -86,6 +88,15 @@ func GetPrimaryPosition(t *testing.T, vttablet Vttablet, hostname string) (strin
return pos, gtID
}
// GetReplicationStatus gets the replication status of given vttablet
func GetReplicationStatus(t *testing.T, vttablet *Vttablet, hostname string) *replicationdatapb.Status {
ctx := context.Background()
vtablet := getTablet(vttablet.GrpcPort, hostname)
pos, err := tmClient.ReplicationStatus(ctx, vtablet)
require.NoError(t, err)
return pos
}
// VerifyRowsInTabletForTable verifies the total number of rows in a table.
// This is used to check that replication has caught up with the changes on primary.
func VerifyRowsInTabletForTable(t *testing.T, vttablet *Vttablet, ksName string, expectedRows int, tableName string) {

Просмотреть файл

@ -378,3 +378,44 @@ func TestReparentDoesntHangIfPrimaryFails(t *testing.T) {
require.Error(t, err)
assert.Contains(t, out, "primary failed to PopulateReparentJournal")
}
func TestReplicationStatus(t *testing.T) {
defer cluster.PanicHandler(t)
clusterInstance := utils.SetupReparentCluster(t, true)
defer utils.TeardownCluster(clusterInstance)
tablets := clusterInstance.Keyspaces[0].Shards[0].Vttablets
utils.ConfirmReplication(t, tablets[0], []*cluster.Vttablet{tablets[1], tablets[2], tablets[3]})
// Stop the SQL_THREAD on tablets[1]
err := clusterInstance.VtctlclientProcess.ExecuteCommand("ExecuteFetchAsDba", tablets[1].Alias, `STOP SLAVE SQL_THREAD;`)
require.NoError(t, err)
// Check the replication status on tablets[1] and assert that the IO thread is read to be running and SQL thread is stopped
replicationStatus := cluster.GetReplicationStatus(t, tablets[1], utils.Hostname)
ioThread, sqlThread := utils.ReplicationThreadsStatus(t, replicationStatus, clusterInstance.VtctlMajorVersion, clusterInstance.VtTabletMajorVersion)
require.True(t, ioThread)
require.False(t, sqlThread)
// Stop replication on tablets[1] and verify that both the threads are reported as not running
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ExecuteFetchAsDba", tablets[1].Alias, `STOP SLAVE;`)
require.NoError(t, err)
replicationStatus = cluster.GetReplicationStatus(t, tablets[1], utils.Hostname)
ioThread, sqlThread = utils.ReplicationThreadsStatus(t, replicationStatus, clusterInstance.VtctlMajorVersion, clusterInstance.VtTabletMajorVersion)
require.False(t, ioThread)
require.False(t, sqlThread)
// Start replication on tablets[1] and verify that both the threads are reported as running
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ExecuteFetchAsDba", tablets[1].Alias, `START SLAVE;`)
require.NoError(t, err)
replicationStatus = cluster.GetReplicationStatus(t, tablets[1], utils.Hostname)
ioThread, sqlThread = utils.ReplicationThreadsStatus(t, replicationStatus, clusterInstance.VtctlMajorVersion, clusterInstance.VtTabletMajorVersion)
require.True(t, ioThread)
require.True(t, sqlThread)
// Stop IO_THREAD on tablets[1] and verify that the IO thread is read to be stopped and SQL thread is running
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ExecuteFetchAsDba", tablets[1].Alias, `STOP SLAVE IO_THREAD;`)
require.NoError(t, err)
replicationStatus = cluster.GetReplicationStatus(t, tablets[1], utils.Hostname)
ioThread, sqlThread = utils.ReplicationThreadsStatus(t, replicationStatus, clusterInstance.VtctlMajorVersion, clusterInstance.VtTabletMajorVersion)
require.False(t, ioThread)
require.True(t, sqlThread)
}

Просмотреть файл

@ -34,6 +34,7 @@ import (
"vitess.io/vitess/go/json2"
"vitess.io/vitess/go/vt/log"
querypb "vitess.io/vitess/go/vt/proto/query"
replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/mysql"
@ -744,3 +745,38 @@ func CheckReplicationStatus(ctx context.Context, t *testing.T, tablet *cluster.V
require.Equal(t, "No", res.Rows[0][11].ToString())
}
}
// ReplicationThreadsStatus returns the status of the IO and SQL thread. It reads the result of the replication status
// based on the vtctl major version provided. It also uses the vttabletVersion to assert on the expectation of the new fields
// being unknown for the old vttablets and that they match for the new vttablets
func ReplicationThreadsStatus(t *testing.T, status *replicationdatapb.Status, vtctlVersion, vttabletVersion int) (bool, bool) {
if vttabletVersion == 13 {
// If vttablet is version 13, then the new fields should be unknown
require.Equal(t, mysql.ReplicationStateUnknown, mysql.ReplicationState(status.IoState))
require.Equal(t, mysql.ReplicationStateUnknown, mysql.ReplicationState(status.SqlState))
} else {
// For the new vttablet, the new parameters should not be unknown. Moreover, the old parameters should also be provided
// and should agree with the new ones
require.NotEqual(t, mysql.ReplicationStateUnknown, mysql.ReplicationState(status.IoState))
require.NotEqual(t, mysql.ReplicationStateUnknown, mysql.ReplicationState(status.SqlState))
require.Equal(t, status.IoThreadRunning, mysql.ReplicationState(status.IoState) == mysql.ReplicationStateRunning)
require.Equal(t, status.SqlThreadRunning, mysql.ReplicationState(status.SqlState) == mysql.ReplicationStateRunning)
}
// if vtctlVersion provided is 13, then we should read the old parameters, since that is what old vtctl would do
if vtctlVersion == 13 {
return status.IoThreadRunning, status.SqlThreadRunning
}
// If we are at the latest vtctl version, we should read the latest parameters if provided otherwise the old ones
ioState := mysql.ReplicationState(status.IoState)
ioThread := status.IoThreadRunning
if ioState != mysql.ReplicationStateUnknown {
ioThread = ioState == mysql.ReplicationStateRunning
}
sqlState := mysql.ReplicationState(status.SqlState)
sqlThread := status.SqlThreadRunning
if sqlState != mysql.ReplicationStateUnknown {
sqlThread = sqlState == mysql.ReplicationStateRunning
}
return ioThread, sqlThread
}

Просмотреть файл

@ -91,7 +91,12 @@ type Status struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Position string `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
Position string `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
// These fields should be removed in Vitess 15+ and fully replaced by the io_state and sql_state fields
// reserved 2, 3;
// reserved "io_thread_running", "sql_thread_running";
IoThreadRunning bool `protobuf:"varint,2,opt,name=io_thread_running,json=ioThreadRunning,proto3" json:"io_thread_running,omitempty"`
SqlThreadRunning bool `protobuf:"varint,3,opt,name=sql_thread_running,json=sqlThreadRunning,proto3" json:"sql_thread_running,omitempty"`
ReplicationLagSeconds uint32 `protobuf:"varint,4,opt,name=replication_lag_seconds,json=replicationLagSeconds,proto3" json:"replication_lag_seconds,omitempty"`
SourceHost string `protobuf:"bytes,5,opt,name=source_host,json=sourceHost,proto3" json:"source_host,omitempty"`
SourcePort int32 `protobuf:"varint,6,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"`
@ -147,6 +152,20 @@ func (x *Status) GetPosition() string {
return ""
}
func (x *Status) GetIoThreadRunning() bool {
if x != nil {
return x.IoThreadRunning
}
return false
}
func (x *Status) GetSqlThreadRunning() bool {
if x != nil {
return x.SqlThreadRunning
}
return false
}
func (x *Status) GetReplicationLagSeconds() uint32 {
if x != nil {
return x.ReplicationLagSeconds
@ -356,64 +375,66 @@ var File_replicationdata_proto protoreflect.FileDescriptor
var file_replicationdata_proto_rawDesc = []byte{
0x0a, 0x15, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74,
0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xcd, 0x04, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf4, 0x04, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x36, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c,
0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x15, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67,
0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e,
0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2c,
0x0a, 0x12, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x73, 0x69,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x6c, 0x61,
0x79, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d,
0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x35, 0x0a, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f,
0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x09, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x6f, 0x67,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x75, 0x69,
0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
0x75, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x69, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22,
0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x69, 0x6f, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6f, 0x45, 0x72, 0x72,
0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x71, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x71, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x71, 0x6c,
0x45, 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10,
0x04, 0x52, 0x11, 0x69, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x75, 0x6e,
0x6e, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x73, 0x71, 0x6c, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64,
0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x77, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70,
0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64,
0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f,
0x72, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64,
0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65,
0x72, 0x22, 0x50, 0x0a, 0x0d, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23,
0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x2a, 0x3b, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4f,
0x41, 0x4e, 0x44, 0x53, 0x51, 0x4c, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x10, 0x00, 0x12, 0x10,
0x0a, 0x0c, 0x49, 0x4f, 0x54, 0x48, 0x52, 0x45, 0x41, 0x44, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01,
0x42, 0x2e, 0x5a, 0x2c, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69,
0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2a, 0x0a, 0x11, 0x69, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x75, 0x6e,
0x6e, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x6f, 0x54, 0x68,
0x72, 0x65, 0x61, 0x64, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x12, 0x73,
0x71, 0x6c, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e,
0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x54, 0x68, 0x72, 0x65,
0x61, 0x64, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63,
0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x72, 0x65, 0x70, 0x6c,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64,
0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x68, 0x6f, 0x73, 0x74,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f,
0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72,
0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50,
0x6f, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72,
0x65, 0x74, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x6c, 0x61,
0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x50, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66,
0x69, 0x6c, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x17, 0x66,
0x69, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x66, 0x69,
0x6c, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x75, 0x69, 0x64, 0x12, 0x19, 0x0a,
0x08, 0x69, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x69, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74,
0x5f, 0x69, 0x6f, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09,
0x73, 0x71, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x73, 0x71, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73,
0x74, 0x5f, 0x73, 0x71, 0x6c, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x71, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22,
0x77, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x65, 0x66, 0x6f,
0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x06, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x61, 0x66, 0x74,
0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x69,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x52, 0x05, 0x61, 0x66, 0x74, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x0d, 0x50, 0x72, 0x69, 0x6d,
0x61, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73,
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x69,
0x6c, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x3b, 0x0a, 0x13, 0x53, 0x74,
0x6f, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64,
0x65, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4f, 0x41, 0x4e, 0x44, 0x53, 0x51, 0x4c, 0x54, 0x48, 0x52,
0x45, 0x41, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x4f, 0x54, 0x48, 0x52, 0x45, 0x41,
0x44, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x42, 0x2e, 0x5a, 0x2c, 0x76, 0x69, 0x74, 0x65, 0x73,
0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76,
0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

Просмотреть файл

@ -129,6 +129,26 @@ func (m *Status) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x20
}
if m.SqlThreadRunning {
i--
if m.SqlThreadRunning {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
}
if m.IoThreadRunning {
i--
if m.IoThreadRunning {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if len(m.Position) > 0 {
i -= len(m.Position)
copy(dAtA[i:], m.Position)
@ -260,6 +280,12 @@ func (m *Status) SizeVT() (n int) {
if l > 0 {
n += 1 + l + sov(uint64(l))
}
if m.IoThreadRunning {
n += 2
}
if m.SqlThreadRunning {
n += 2
}
if m.ReplicationLagSeconds != 0 {
n += 1 + sov(uint64(m.ReplicationLagSeconds))
}
@ -419,6 +445,46 @@ func (m *Status) UnmarshalVT(dAtA []byte) error {
}
m.Position = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field IoThreadRunning", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.IoThreadRunning = bool(v != 0)
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field SqlThreadRunning", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.SqlThreadRunning = bool(v != 0)
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ReplicationLagSeconds", wireType)

Просмотреть файл

@ -150,7 +150,9 @@ func ReplicaWasRunning(stopStatus *replicationdatapb.StopReplicationStatus) (boo
return false, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "could not determine Before state of StopReplicationStatus %v", stopStatus)
}
return stopStatus.Before.IoState == int32(mysql.ReplicationStateRunning) || stopStatus.Before.SqlState == int32(mysql.ReplicationStateRunning), nil
replStatus := mysql.ProtoToReplicationStatus(stopStatus.Before)
return (replStatus.IOState == mysql.ReplicationStateRunning) ||
(replStatus.SQLState == mysql.ReplicationStateRunning), nil
}
// SetReplicationSource is used to set the replication source on the specified

Просмотреть файл

@ -25,9 +25,11 @@ package replicationdata;
// flavor-specific command and parsed into a Position and fields.
message Status {
string position = 1;
// These two fields were removed in Vitess 14 and replaced by the io_state and sql_state fields
reserved 2, 3;
reserved "io_thread_running", "sql_thread_running";
// These fields should be removed in Vitess 15+ and fully replaced by the io_state and sql_state fields
// reserved 2, 3;
// reserved "io_thread_running", "sql_thread_running";
bool io_thread_running = 2;
bool sql_thread_running = 3;
uint32 replication_lag_seconds = 4;
string source_host = 5;
int32 source_port = 6;

36
web/vtadmin/src/proto/vtadmin.d.ts поставляемый
Просмотреть файл

@ -26860,6 +26860,12 @@ export namespace replicationdata {
/** Status position */
position?: (string|null);
/** Status io_thread_running */
io_thread_running?: (boolean|null);
/** Status sql_thread_running */
sql_thread_running?: (boolean|null);
/** Status replication_lag_seconds */
replication_lag_seconds?: (number|null);
@ -26912,6 +26918,12 @@ export namespace replicationdata {
/** Status position. */
public position: string;
/** Status io_thread_running. */
public io_thread_running: boolean;
/** Status sql_thread_running. */
public sql_thread_running: boolean;
/** Status replication_lag_seconds. */
public replication_lag_seconds: number;
@ -28584,6 +28596,12 @@ export namespace vtctldata {
/** MaterializeSettings materialization_intent */
materialization_intent?: (vtctldata.MaterializationIntent|null);
/** MaterializeSettings source_time_zone */
source_time_zone?: (string|null);
/** MaterializeSettings target_time_zone */
target_time_zone?: (string|null);
}
/** Represents a MaterializeSettings. */
@ -28622,6 +28640,12 @@ export namespace vtctldata {
/** MaterializeSettings materialization_intent. */
public materialization_intent: vtctldata.MaterializationIntent;
/** MaterializeSettings source_time_zone. */
public source_time_zone: string;
/** MaterializeSettings target_time_zone. */
public target_time_zone: string;
/**
* Creates a new MaterializeSettings instance using the specified properties.
* @param [properties] Properties to set
@ -45813,6 +45837,12 @@ export namespace binlogdata {
/** BinlogSource external_cluster */
external_cluster?: (string|null);
/** BinlogSource source_time_zone */
source_time_zone?: (string|null);
/** BinlogSource target_time_zone */
target_time_zone?: (string|null);
}
/** Represents a BinlogSource. */
@ -45854,6 +45884,12 @@ export namespace binlogdata {
/** BinlogSource external_cluster. */
public external_cluster: string;
/** BinlogSource source_time_zone. */
public source_time_zone: string;
/** BinlogSource target_time_zone. */
public target_time_zone: string;
/**
* Creates a new BinlogSource instance using the specified properties.
* @param [properties] Properties to set

Просмотреть файл

@ -63272,6 +63272,8 @@ $root.replicationdata = (function() {
* @memberof replicationdata
* @interface IStatus
* @property {string|null} [position] Status position
* @property {boolean|null} [io_thread_running] Status io_thread_running
* @property {boolean|null} [sql_thread_running] Status sql_thread_running
* @property {number|null} [replication_lag_seconds] Status replication_lag_seconds
* @property {string|null} [source_host] Status source_host
* @property {number|null} [source_port] Status source_port
@ -63310,6 +63312,22 @@ $root.replicationdata = (function() {
*/
Status.prototype.position = "";
/**
* Status io_thread_running.
* @member {boolean} io_thread_running
* @memberof replicationdata.Status
* @instance
*/
Status.prototype.io_thread_running = false;
/**
* Status sql_thread_running.
* @member {boolean} sql_thread_running
* @memberof replicationdata.Status
* @instance
*/
Status.prototype.sql_thread_running = false;
/**
* Status replication_lag_seconds.
* @member {number} replication_lag_seconds
@ -63440,6 +63458,10 @@ $root.replicationdata = (function() {
writer = $Writer.create();
if (message.position != null && Object.hasOwnProperty.call(message, "position"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.position);
if (message.io_thread_running != null && Object.hasOwnProperty.call(message, "io_thread_running"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.io_thread_running);
if (message.sql_thread_running != null && Object.hasOwnProperty.call(message, "sql_thread_running"))
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.sql_thread_running);
if (message.replication_lag_seconds != null && Object.hasOwnProperty.call(message, "replication_lag_seconds"))
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.replication_lag_seconds);
if (message.source_host != null && Object.hasOwnProperty.call(message, "source_host"))
@ -63503,6 +63525,12 @@ $root.replicationdata = (function() {
case 1:
message.position = reader.string();
break;
case 2:
message.io_thread_running = reader.bool();
break;
case 3:
message.sql_thread_running = reader.bool();
break;
case 4:
message.replication_lag_seconds = reader.uint32();
break;
@ -63580,6 +63608,12 @@ $root.replicationdata = (function() {
if (message.position != null && message.hasOwnProperty("position"))
if (!$util.isString(message.position))
return "position: string expected";
if (message.io_thread_running != null && message.hasOwnProperty("io_thread_running"))
if (typeof message.io_thread_running !== "boolean")
return "io_thread_running: boolean expected";
if (message.sql_thread_running != null && message.hasOwnProperty("sql_thread_running"))
if (typeof message.sql_thread_running !== "boolean")
return "sql_thread_running: boolean expected";
if (message.replication_lag_seconds != null && message.hasOwnProperty("replication_lag_seconds"))
if (!$util.isInteger(message.replication_lag_seconds))
return "replication_lag_seconds: integer expected";
@ -63636,6 +63670,10 @@ $root.replicationdata = (function() {
var message = new $root.replicationdata.Status();
if (object.position != null)
message.position = String(object.position);
if (object.io_thread_running != null)
message.io_thread_running = Boolean(object.io_thread_running);
if (object.sql_thread_running != null)
message.sql_thread_running = Boolean(object.sql_thread_running);
if (object.replication_lag_seconds != null)
message.replication_lag_seconds = object.replication_lag_seconds >>> 0;
if (object.source_host != null)
@ -63680,6 +63718,8 @@ $root.replicationdata = (function() {
var object = {};
if (options.defaults) {
object.position = "";
object.io_thread_running = false;
object.sql_thread_running = false;
object.replication_lag_seconds = 0;
object.source_host = "";
object.source_port = 0;
@ -63696,6 +63736,10 @@ $root.replicationdata = (function() {
}
if (message.position != null && message.hasOwnProperty("position"))
object.position = message.position;
if (message.io_thread_running != null && message.hasOwnProperty("io_thread_running"))
object.io_thread_running = message.io_thread_running;
if (message.sql_thread_running != null && message.hasOwnProperty("sql_thread_running"))
object.sql_thread_running = message.sql_thread_running;
if (message.replication_lag_seconds != null && message.hasOwnProperty("replication_lag_seconds"))
object.replication_lag_seconds = message.replication_lag_seconds;
if (message.source_host != null && message.hasOwnProperty("source_host"))
@ -67737,6 +67781,8 @@ $root.vtctldata = (function() {
* @property {string|null} [tablet_types] MaterializeSettings tablet_types
* @property {string|null} [external_cluster] MaterializeSettings external_cluster
* @property {vtctldata.MaterializationIntent|null} [materialization_intent] MaterializeSettings materialization_intent
* @property {string|null} [source_time_zone] MaterializeSettings source_time_zone
* @property {string|null} [target_time_zone] MaterializeSettings target_time_zone
*/
/**
@ -67827,6 +67873,22 @@ $root.vtctldata = (function() {
*/
MaterializeSettings.prototype.materialization_intent = 0;
/**
* MaterializeSettings source_time_zone.
* @member {string} source_time_zone
* @memberof vtctldata.MaterializeSettings
* @instance
*/
MaterializeSettings.prototype.source_time_zone = "";
/**
* MaterializeSettings target_time_zone.
* @member {string} target_time_zone
* @memberof vtctldata.MaterializeSettings
* @instance
*/
MaterializeSettings.prototype.target_time_zone = "";
/**
* Creates a new MaterializeSettings instance using the specified properties.
* @function create
@ -67870,6 +67932,10 @@ $root.vtctldata = (function() {
writer.uint32(/* id 8, wireType 2 =*/66).string(message.external_cluster);
if (message.materialization_intent != null && Object.hasOwnProperty.call(message, "materialization_intent"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.materialization_intent);
if (message.source_time_zone != null && Object.hasOwnProperty.call(message, "source_time_zone"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.source_time_zone);
if (message.target_time_zone != null && Object.hasOwnProperty.call(message, "target_time_zone"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.target_time_zone);
return writer;
};
@ -67933,6 +67999,12 @@ $root.vtctldata = (function() {
case 9:
message.materialization_intent = reader.int32();
break;
case 10:
message.source_time_zone = reader.string();
break;
case 11:
message.target_time_zone = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
@ -68007,6 +68079,12 @@ $root.vtctldata = (function() {
case 2:
break;
}
if (message.source_time_zone != null && message.hasOwnProperty("source_time_zone"))
if (!$util.isString(message.source_time_zone))
return "source_time_zone: string expected";
if (message.target_time_zone != null && message.hasOwnProperty("target_time_zone"))
if (!$util.isString(message.target_time_zone))
return "target_time_zone: string expected";
return null;
};
@ -68060,6 +68138,10 @@ $root.vtctldata = (function() {
message.materialization_intent = 2;
break;
}
if (object.source_time_zone != null)
message.source_time_zone = String(object.source_time_zone);
if (object.target_time_zone != null)
message.target_time_zone = String(object.target_time_zone);
return message;
};
@ -68087,6 +68169,8 @@ $root.vtctldata = (function() {
object.tablet_types = "";
object.external_cluster = "";
object.materialization_intent = options.enums === String ? "CUSTOM" : 0;
object.source_time_zone = "";
object.target_time_zone = "";
}
if (message.workflow != null && message.hasOwnProperty("workflow"))
object.workflow = message.workflow;
@ -68109,6 +68193,10 @@ $root.vtctldata = (function() {
object.external_cluster = message.external_cluster;
if (message.materialization_intent != null && message.hasOwnProperty("materialization_intent"))
object.materialization_intent = options.enums === String ? $root.vtctldata.MaterializationIntent[message.materialization_intent] : message.materialization_intent;
if (message.source_time_zone != null && message.hasOwnProperty("source_time_zone"))
object.source_time_zone = message.source_time_zone;
if (message.target_time_zone != null && message.hasOwnProperty("target_time_zone"))
object.target_time_zone = message.target_time_zone;
return object;
};
@ -108016,6 +108104,8 @@ $root.binlogdata = (function() {
* @property {string|null} [external_mysql] BinlogSource external_mysql
* @property {boolean|null} [stop_after_copy] BinlogSource stop_after_copy
* @property {string|null} [external_cluster] BinlogSource external_cluster
* @property {string|null} [source_time_zone] BinlogSource source_time_zone
* @property {string|null} [target_time_zone] BinlogSource target_time_zone
*/
/**
@ -108114,6 +108204,22 @@ $root.binlogdata = (function() {
*/
BinlogSource.prototype.external_cluster = "";
/**
* BinlogSource source_time_zone.
* @member {string} source_time_zone
* @memberof binlogdata.BinlogSource
* @instance
*/
BinlogSource.prototype.source_time_zone = "";
/**
* BinlogSource target_time_zone.
* @member {string} target_time_zone
* @memberof binlogdata.BinlogSource
* @instance
*/
BinlogSource.prototype.target_time_zone = "";
/**
* Creates a new BinlogSource instance using the specified properties.
* @function create
@ -108159,6 +108265,10 @@ $root.binlogdata = (function() {
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.stop_after_copy);
if (message.external_cluster != null && Object.hasOwnProperty.call(message, "external_cluster"))
writer.uint32(/* id 10, wireType 2 =*/82).string(message.external_cluster);
if (message.source_time_zone != null && Object.hasOwnProperty.call(message, "source_time_zone"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.source_time_zone);
if (message.target_time_zone != null && Object.hasOwnProperty.call(message, "target_time_zone"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.target_time_zone);
return writer;
};
@ -108225,6 +108335,12 @@ $root.binlogdata = (function() {
case 10:
message.external_cluster = reader.string();
break;
case 11:
message.source_time_zone = reader.string();
break;
case 12:
message.target_time_zone = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
@ -108319,6 +108435,12 @@ $root.binlogdata = (function() {
if (message.external_cluster != null && message.hasOwnProperty("external_cluster"))
if (!$util.isString(message.external_cluster))
return "external_cluster: string expected";
if (message.source_time_zone != null && message.hasOwnProperty("source_time_zone"))
if (!$util.isString(message.source_time_zone))
return "source_time_zone: string expected";
if (message.target_time_zone != null && message.hasOwnProperty("target_time_zone"))
if (!$util.isString(message.target_time_zone))
return "target_time_zone: string expected";
return null;
};
@ -108425,6 +108547,10 @@ $root.binlogdata = (function() {
message.stop_after_copy = Boolean(object.stop_after_copy);
if (object.external_cluster != null)
message.external_cluster = String(object.external_cluster);
if (object.source_time_zone != null)
message.source_time_zone = String(object.source_time_zone);
if (object.target_time_zone != null)
message.target_time_zone = String(object.target_time_zone);
return message;
};
@ -108453,6 +108579,8 @@ $root.binlogdata = (function() {
object.external_mysql = "";
object.stop_after_copy = false;
object.external_cluster = "";
object.source_time_zone = "";
object.target_time_zone = "";
}
if (message.keyspace != null && message.hasOwnProperty("keyspace"))
object.keyspace = message.keyspace;
@ -108477,6 +108605,10 @@ $root.binlogdata = (function() {
object.stop_after_copy = message.stop_after_copy;
if (message.external_cluster != null && message.hasOwnProperty("external_cluster"))
object.external_cluster = message.external_cluster;
if (message.source_time_zone != null && message.hasOwnProperty("source_time_zone"))
object.source_time_zone = message.source_time_zone;
if (message.target_time_zone != null && message.hasOwnProperty("target_time_zone"))
object.target_time_zone = message.target_time_zone;
return object;
};