-
Couldn't load subscription status.
- Fork 4k
workload/changefeed: allow changefeed-cursor #156276
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
Conversation
| log.Dev.Infof(ctx, "creating changefeed with stmt: %s with args %v", stmt, args) | ||
| if epoch, err := hlc.ParseHLC(cursorStr); err == nil { | ||
| log.Dev.Infof(ctx, "starting a changefeed after %s", timeutil.Since(epoch.GoTime())) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cursor is already in the command, so if we really want a more human readable version, I would probably parse the cursor up where we can more easily return an error and then pretty print in a single log message along with the stmt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, are you thinking we’d parse the timestamp from the input? I was hoping to calculate the time difference between the cursor timestamp and the changefeed creation time using timeutil.Since. Would I have to pass the parsed timestamp down here then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to calculate the time difference between the cursor timestamp and the changefeed creation time using timeutil.Since.
Right, I'm saying you can do the parsing immediately after we establish the custorStr above. Then you can log it as part of the log line at line 136.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, done, lmk if this matches with what you had in mind.
| log.Dev.Infof(ctx, "creating changefeed with stmt: %s with args %v", stmt, args) | ||
| if epoch, err := hlc.ParseHLC(cursorStr); err == nil { | ||
| log.Dev.Infof(ctx, "starting a changefeed after %s", timeutil.Since(epoch.GoTime())) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to calculate the time difference between the cursor timestamp and the changefeed creation time using timeutil.Since.
Right, I'm saying you can do the parsing immediately after we establish the custorStr above. Then you can log it as part of the log line at line 136.
This commit adds a new option, changefeed-cursor, which allows specifying the timestamp after which the changefeed should start emitting events and trigger a catch-up scan. If not specified, the changefeed defaults to using the current cluster logical timestamp. This helps tests specify catch-up scan behavior.
|
Test failure looks unrelated - TestInspectProgressWithMultiRangeTable. bors r+ |
Part of: https://cockroachlabs.atlassian.net/browse/CRDB-55203
Release note: none
workload/changefeed: allow changefeed-cursor
This commit adds a new option, changefeed-cursor, which allows specifying the
timestamp after which the changefeed should start emitting events and trigger a
catch-up scan. If not specified, the changefeed defaults to using the current
cluster logical timestamp. This helps tests specify catch-up scan behavior.
workload/changefeed: add more logs