Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
94285: Revert "sql: add replication start time to `SHOW TENANT WITH REPLICATION STATUS` r=lidorcarmel a=adityamaru

This reverts commit 3833eed. We decided that showing the `start_time` to the user is not useful. We already show the replicated_time and retention_time that is sufficient to pick a cutover time and fingerprint start time.

Fixes: cockroachdb#93447

Co-authored-by: adityamaru <[email protected]>
  • Loading branch information
craig[bot] and adityamaru committed Jan 5, 2023
2 parents d123302 + 6663cae commit 9317a5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
21 changes: 9 additions & 12 deletions pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,18 +907,17 @@ func TestTenantStreamingShowTenant(t *testing.T) {
replicationDetails := details.Details().(jobspb.StreamIngestionDetails)

var (
id int
dest string
status string
source string
sourceUri string
jobId int
maxReplTime time.Time
protectedTime time.Time
replicationStartTime time.Time
id int
dest string
status string
source string
sourceUri string
jobId int
maxReplTime time.Time
protectedTime time.Time
)
row := c.DestSysSQL.QueryRow(t, fmt.Sprintf("SHOW TENANT %s WITH REPLICATION STATUS", args.DestTenantName))
row.Scan(&id, &dest, &status, &source, &sourceUri, &jobId, &maxReplTime, &protectedTime, &replicationStartTime)
row.Scan(&id, &dest, &status, &source, &sourceUri, &jobId, &maxReplTime, &protectedTime)
require.Equal(t, 2, id)
require.Equal(t, "destination", dest)
require.Equal(t, "REPLICATING", status)
Expand All @@ -929,6 +928,4 @@ func TestTenantStreamingShowTenant(t *testing.T) {
require.Less(t, protectedTime, timeutil.Now())
require.GreaterOrEqual(t, maxReplTime, highWatermark.GoTime())
require.GreaterOrEqual(t, protectedTime, replicationDetails.ReplicationStartTime.GoTime())
require.Equal(t, replicationStartTime.UnixMicro(),
timeutil.Unix(0, replicationDetails.ReplicationStartTime.WallTime).UnixMicro())
}
1 change: 0 additions & 1 deletion pkg/sql/catalog/colinfo/result_columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ var TenantColumnsWithReplication = ResultColumns{
// The protected timestamp on the destination cluster, meaning we cannot
// cutover to before this time.
{Name: "retained_time", Typ: types.Timestamp},
{Name: "replication_start_time", Typ: types.Timestamp},
}

// RangesNoLeases is the schema for crdb_internal.ranges_no_leases.
Expand Down
4 changes: 0 additions & 4 deletions pkg/sql/show_tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ func (n *showTenantNode) Values() tree.Datums {
replicationJobId := tree.NewDInt(tree.DInt(n.tenantInfo.TenantReplicationJobID))
replicatedTimestamp := tree.DNull
retainedTimestamp := tree.DNull
replicationStartTimestamp := tree.DNull

if n.replicationInfo != nil {
sourceTenantName = tree.NewDString(string(n.replicationInfo.IngestionDetails.SourceTenantName))
Expand All @@ -213,8 +212,6 @@ func (n *showTenantNode) Values() tree.Datums {
}
// The protected timestamp on the destination cluster.
retainedTimestamp, _ = tree.MakeDTimestamp(timeutil.Unix(0, n.protectedTimestamp.WallTime), time.Nanosecond)
replicationStartTimestamp, _ = tree.MakeDTimestamp(
timeutil.Unix(0, n.replicationInfo.IngestionDetails.ReplicationStartTime.WallTime), time.Nanosecond)
}

return tree.Datums{
Expand All @@ -226,7 +223,6 @@ func (n *showTenantNode) Values() tree.Datums {
replicationJobId,
replicatedTimestamp,
retainedTimestamp,
replicationStartTimestamp,
}
}

Expand Down

0 comments on commit 9317a5f

Please sign in to comment.