Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: Add created column to active_range_feeds table. #77597

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/kv/kvclient/kvcoord/dist_sender_rangefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/crdb_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()),
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/create_statements
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down