Skip to content

Commit 11c2913

Browse files
ejortegauClaude
andcommitted
Populate After.ServerVersion on StopReplicationAndGetStatus success path
The successful stop path set Before.ServerVersion but left After.ServerVersion empty, while the no-op paths return After: before and thus include it. Set after.ServerVersion = before.ServerVersion so the common success path is consistent, and extend the test to assert After.ServerVersion when present. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Eduardo Ortega <5791035+ejortegau@users.noreply.github.com>
1 parent 4bfe9c5 commit 11c2913

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

go/vt/vttablet/tabletmanager/rpc_replication.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ func (tm *TabletManager) StopReplicationAndGetStatus(ctx context.Context, stopRe
10861086
rs.RelayLogSourceBinlogEquivalentPosition = rsAfter.RelayLogSourceBinlogEquivalentPosition
10871087

10881088
before.ServerVersion = tm.getMySQLVersion(ctx)
1089+
after.ServerVersion = before.ServerVersion
10891090

10901091
return StopReplicationAndGetStatusResponse{
10911092
Status: &replicationdatapb.StopReplicationStatus{

go/vt/vttablet/tabletmanager/rpc_replication_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ func TestStopReplicationAndGetStatus_ServerVersion(t *testing.T) {
876876

877877
require.NotNil(t, resp.Status)
878878
require.Equal(t, "Ver 8.0.35", resp.Status.Before.ServerVersion)
879+
if resp.Status.After != nil {
880+
require.Equal(t, "Ver 8.0.35", resp.Status.After.ServerVersion)
881+
}
879882
})
880883
}
881884
}

0 commit comments

Comments
 (0)