Skip to content

Commit

Permalink
[DNM] ccl/changefeedccl: implement WITH diff option
Browse files Browse the repository at this point in the history
Fixes cockroachdb#28666.
First commit from cockroachdb#41788.

This commit adds a `WITH diff` option to CREATE CHANGEFEED. When the
option is provided, changefeeds publications will include a `before`
field, which includes the value of the row before the CDC update was
applied.

We are able to implement this efficiently by pushing the option into
Rangefeed and performing the scan of the previous value immediately
before applying the update in the Raft processing goroutine. cockroachdb#41788
allows us to avoid performing this lookup when `WITH diff` isn't
specified for Rangefeeds, so the small (unmeasured) perf hit is
strictly opt-in.

DNM: this still needs testing and a bit of polish. It's also not clear
how we want to handle catch-up scans when the option is provided.
  • Loading branch information
nvanbenschoten committed Oct 22, 2019
1 parent 54aab8a commit 73add2b
Show file tree
Hide file tree
Showing 23 changed files with 1,680 additions and 767 deletions.
87 changes: 84 additions & 3 deletions c-deps/libroach/protos/roachpb/api.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions c-deps/libroach/protos/roachpb/api.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 73add2b

Please sign in to comment.