diff --git a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go index 75c916399539..245922df3bec 100644 --- a/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go +++ b/pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go @@ -124,6 +124,7 @@ type PartialRangeFeed struct { StartTS hlc.Timestamp NodeID roachpb.NodeID RangeID roachpb.RangeID + CreatedTime time.Time LastValueReceived time.Time Resolved hlc.Timestamp } @@ -262,8 +263,9 @@ func (ds *DistSender) partialRangeFeed( // Register partial range feed with registry. active := &activeRangeFeed{ PartialRangeFeed: PartialRangeFeed{ - Span: span, - StartTS: startFrom, + Span: span, + StartTS: startFrom, + CreatedTime: timeutil.Now(), }, } rr.ranges.Store(active, nil) diff --git a/pkg/sql/crdb_internal.go b/pkg/sql/crdb_internal.go index 463c779d6d5e..bd87bd98fd2f 100644 --- a/pkg/sql/crdb_internal.go +++ b/pkg/sql/crdb_internal.go @@ -5248,6 +5248,7 @@ CREATE TABLE crdb_internal.active_range_feeds ( diff BOOL, node_id INT, range_id INT, + created INT, range_start STRING, range_end STRING, resolved STRING, @@ -5270,6 +5271,7 @@ CREATE TABLE crdb_internal.active_range_feeds ( tree.MakeDBool(tree.DBool(rfCtx.WithDiff)), tree.NewDInt(tree.DInt(rf.NodeID)), tree.NewDInt(tree.DInt(rf.RangeID)), + tree.NewDInt(tree.DInt(rf.CreatedTime.UTC().UnixNano())), tree.NewDString(keys.PrettyPrint(nil /* valDirs */, rf.Span.Key)), tree.NewDString(keys.PrettyPrint(nil /* valDirs */, rf.Span.EndKey)), tree.NewDString(rf.Resolved.AsOfSystemTime()), diff --git a/pkg/sql/logictest/testdata/logic_test/create_statements b/pkg/sql/logictest/testdata/logic_test/create_statements index c25e30d80953..d28ee17abb54 100644 --- a/pkg/sql/logictest/testdata/logic_test/create_statements +++ b/pkg/sql/logictest/testdata/logic_test/create_statements @@ -39,6 +39,7 @@ CREATE TABLE crdb_internal.active_range_feeds ( diff BOOL NULL, node_id INT8 NULL, range_id INT8 NULL, + created INT8 NULL, range_start STRING NULL, range_end STRING NULL, resolved STRING NULL, @@ -50,6 +51,7 @@ CREATE TABLE crdb_internal.active_range_feeds ( diff BOOL NULL, node_id INT8 NULL, range_id INT8 NULL, + created INT8 NULL, range_start STRING NULL, range_end STRING NULL, resolved STRING NULL,