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

feat(cdc): support disable cdc backfill and only consumes from latest changelog #14718

Merged
merged 15 commits into from
Feb 1, 2024

Conversation

StrikeW
Copy link
Contributor

@StrikeW StrikeW commented Jan 22, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

  • Introduces a new snapshot option to allow user to disable cdc backfill and only consumes from the latest changelog.
  • Only consume upstream events occurred after the table has been created

The streaming plan is same as table w/ cdc backfill.

create table orders_no_backfill (
   order_id int,
   order_date date,
   customer_name string,
   price decimal,
   product_id int,
   order_status boolean,
   PRIMARY KEY (order_id)
) with (
   snapshot = 'false'
) from pg_source table 'public.orders_tx';

close #14600
related: #13947

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@StrikeW StrikeW marked this pull request as ready for review January 22, 2024 11:36
@StrikeW StrikeW marked this pull request as draft January 22, 2024 13:40
@StrikeW StrikeW force-pushed the siyuan/cdc-backfill-disable branch from cd86185 to ef3f647 Compare January 24, 2024 08:04
@StrikeW StrikeW force-pushed the siyuan/cdc-backfill-disable branch from ef3f647 to 6ccc2a4 Compare January 24, 2024 08:24
@StrikeW StrikeW added user-facing-changes Contains changes that are visible to users and removed ci/run-build ci/run-build-other ci/run-e2e-source-tests labels Jan 24, 2024
) with (
snapshot = 'false'
) from mysql_mytest table 'mytest.orders';

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I see that we insert Sam as a record, but where? Do you think it's possible for the cdc tests to be inlined?

Seems a little confusing because we create the table here (in cdc.share_stream.slt).

But we check for the contents in a separate file: (e2e_test/source/cdc/cdc.check_new_rows.slt).

Not sure how they are synced up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I see that we insert Sam as a record, but where?

In the e2e-source-test.sh which is the "main" of e2e test.

And cdc.check_new_rows.slt is called after cluster restart, which is to test cdc source can resume after recovery. I feel it is also odd to kill the cluster and restart it in the .slt.

Copy link
Contributor

@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

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

For CDC Backfill without snapshot, how do we handle the case where CDC updates contain updates/deletes on a non-existent row (i.e. its from the snapshot which was not read).

@StrikeW StrikeW force-pushed the siyuan/cdc-backfill-disable branch from 609ff02 to 518dc0a Compare January 30, 2024 08:46
@StrikeW StrikeW force-pushed the siyuan/cdc-backfill-disable branch from dceb0df to 3370a88 Compare January 31, 2024 08:27
@StrikeW StrikeW enabled auto-merge January 31, 2024 11:43
auto-merge was automatically disabled January 31, 2024 23:49

Merge queue setting changed

@StrikeW StrikeW added this pull request to the merge queue Feb 1, 2024
Merged via the queue into main with commit b65afa3 Feb 1, 2024
29 of 30 checks passed
@StrikeW StrikeW deleted the siyuan/cdc-backfill-disable branch February 1, 2024 05:38
github-actions bot pushed a commit that referenced this pull request Feb 1, 2024
StrikeW added a commit that referenced this pull request Feb 1, 2024
StrikeW added a commit that referenced this pull request Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support attribute to disable backfill for cdc tables created from shared source
6 participants