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

cdc: test negative timestamp cdc #88058

Merged
merged 1 commit into from
Sep 19, 2022
Merged

cdc: test negative timestamp cdc #88058

merged 1 commit into from
Sep 19, 2022

Conversation

biradarganesh25
Copy link
Contributor

@biradarganesh25 biradarganesh25 commented Sep 16, 2022

The negative timestamp value is calculated as the difference between a
predefined time (this is the time from which we expect changefeed to run)
and the current statement time. knobs is used to get the current statement
time because it will only be available once the change feed statement
starts executing.

Resolves: #82350

Release note: None

@biradarganesh25 biradarganesh25 requested a review from a team as a code owner September 16, 2022 17:23
@biradarganesh25 biradarganesh25 requested review from ajwerner and removed request for a team September 16, 2022 17:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@biradarganesh25 biradarganesh25 changed the title cdc: test negative ts cdc cdc: test negative timestamp cdc Sep 16, 2022
Copy link
Contributor

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great.
Make sure you update PR description, and squash commits before merge.

@@ -328,6 +328,11 @@ func createChangefeedJobRecord(
}
var initialHighWater hlc.Timestamp
evalTimestamp := func(s string) (hlc.Timestamp, error) {
knobs := p.ExecCfg().DistSQLSrv.TestingKnobs.Changefeed.(*TestingKnobs)
if knobs.OverrideCursor != nil {
// Check TestChangefeedCursor for more info.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd drop this comment.

@@ -666,6 +666,7 @@ func TestChangefeedCursor(t *testing.T) {
// 'after', throw a couple sleeps around them. We round timestamps to
// Microsecond granularity for Postgres compatibility, so make the
// sleeps 10x that.
before := s.Server.Clock().Now()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consider renaming to beforeInsert

pkg/ccl/changefeedccl/changefeed_test.go Show resolved Hide resolved
Copy link
Contributor Author

@biradarganesh25 biradarganesh25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner and @miretskiy)


pkg/ccl/changefeedccl/changefeed_stmt.go line 333 at r2 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

i'd drop this comment.

Done.


pkg/ccl/changefeedccl/changefeed_test.go line 669 at r2 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

nit: consider renaming to beforeInsert

done


pkg/ccl/changefeedccl/changefeed_test.go line 696 at r2 (raw file):

Previously, miretskiy (Yevgeniy Miretskiy) wrote…

nit: Since this is a placeholder, consider putting really non-sensical
value that's guaranteed to fail the test (if it's not replaced); for example
'-5 days'

done

The negative timestamp value is calculated as the difference between a
predefined time (this is the time from which we expect changefeed to run)
and the current statement time. knobs is used to get the current statement
time because it will only be available once the change feed statement
starts executing.

Resolves: #82350

Release note: None
@biradarganesh25
Copy link
Contributor Author

going ahead with merge as github ci test has been failing on master too:
image
thanks @jayshrivastava for the help

@biradarganesh25
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 19, 2022

Build succeeded:

@craig craig bot merged commit ff51972 into master Sep 19, 2022
@craig craig bot deleted the test_negative_ts_cdc branch September 19, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

changefeedccl: Support interval expressions for cursor
3 participants