Skip to content

Commit

Permalink
ccl/changefeedccl: implement WITH diff option
Browse files Browse the repository at this point in the history
Fixes #28666.
First commit from #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. #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.

Release note (sql change): CHANGEFEED now supports a `WITH diff` option,
which instructs it to include a `before` field in each publication.
  • Loading branch information
nvanbenschoten committed Nov 21, 2019
1 parent 22a3108 commit a24cda0
Show file tree
Hide file tree
Showing 31 changed files with 2,684 additions and 1,137 deletions.
84 changes: 81 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.

80 changes: 80 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 a24cda0

Please sign in to comment.