cockroachdb / cockroachdb/cockroach

sql/cdc: TestChangefeedRandomExpressions/kafka error: cannot subtract infinite dates

Open
#113,842 1 comment 0 reactions 0 assignees View on GitHub
A-cdc C-bug T-cdc
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Original error: https://teamcity.cockroachdb.com/viewLog.html?buildId=12496837&buildTypeId=Cockroach_BazelEssentialCi&tab=buildResultsDiv

Here's a reduced repro (no artifacts in the build):

```
CREATE TABLE seed (_date DATE, _inet INET);
INSERT INTO seed VALUES ('infinity'::DATE, '0.0.0.0'::INET);
CREATE CHANGEFEED WITH schema_change_policy='stop' AS SELECT rowid FROM seed WHERE (set_masklen(seed._inet::INET, (seed._date::DATE - seed._date::DATE)::INT8::INT8)::INET = seed._inet);

-- Note that the following statement without changefeed doesn't error, because the subtraction is optimized out of the plan.
SELECT rowid FROM seed WHERE (set_masklen(seed._inet::INET, (seed._date::DATE - seed._date::DATE)::INT8::INT8)::INET = seed._inet);
```

I would either expect 1) The subtraction can be removed from the changefeed plan, or 2) The randomized test can tolerate such failures.

Jira issue: CRDB-33219

Contributor guide

Open the contributing guide

Research direction

Start with the TestChangefeedRandomExpressions/kafka case and reproduce the reduced SQL changefeed example using an infinite DATE. Compare the changefeed plan with the standalone SELECT, then determine whether the subtraction should be removed or the randomized test should tolerate the failure. Done means the reported error is handled without breaking the test.

Written by the indexing model from the issue text.

Assessment

Tech stack
kafka, sql
Domain
databases, distributed-systems, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.