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

[WIP] changefeedccl: support tables with more than one column family #30414

Closed
wants to merge 1 commit into from

Conversation

danhhz
Copy link
Contributor

@danhhz danhhz commented Sep 19, 2018

If a table has multiple column families and only one of them is changed
in a given statement, only the kv for that column family will be changed
by the sql system. This means we wouldn't have enough data to
reconstruct the row.

We can fetch the row's entire kv data with a prefix scan that's forced
to be at the timestamp of the changed kv. This has two issues

  • it introduces a blocking kv read (in the common case, this is not as
    bad as it sounds since this code is likely running on the leaseholder
    and the data can be served locally)
  • if N column families were updated at once, then we'll run this process
    N times and get N exact duplicates in the output

Release note (enterprise change): CHANGEFEEDs now support tables with
multiple column families, though with degraded performance.

Closes #28667

If a table has multiple column families and only one of them is changed
in a given statement, only the kv for that column family will be changed
by the sql system. This means we wouldn't have enough data to
reconstruct the row.

We can fetch the row's entire kv data with a prefix scan that's forced
to be at the timestamp of the changed kv. This has two issues

- it introduces a blocking kv read (in the common case, this is not as
  bad as it sounds since this code is likely running on the leaseholder
  and the data can be served locally)
- if N column families were updated at once, then we'll run this process
  N times and get N exact duplicates in the output

Release note (enterprise change): CHANGEFEEDs now support tables with
multiple column families, though with degraded performance.

Closes cockroachdb#28667
@danhhz danhhz requested a review from a team September 19, 2018 15:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@danhhz
Copy link
Contributor Author

danhhz commented Sep 19, 2018

@mrtracy This is slated for 2.2, so there's no rush to get it in. I've been dragging my feet on this because of the followup fetch, but realized it's not so bad since it's likely to be served by the local node. However, I think the duplicates probably make this unmergeable as-is. Thoughts?

@danhhz danhhz added the do-not-merge bors won't merge a PR with this label. label Sep 20, 2018
@danhhz danhhz closed this Jan 30, 2019
@danhhz danhhz deleted the cdc_colfam branch April 3, 2020 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge bors won't merge a PR with this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

changefeedccl: support tables with more than one column family
2 participants