-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changefeedccl: support inline results over pgwire
CREATE CHANGEFEED FOR <target> WITH <...> Notably the `INTO <sink>` clause is omitted. This triggers a fairly radical change in behavior. Instead of setting up a system.job to emit to a sink in the background and returning immediately with the job ID, the `CREATE CHANGEFEED` blocks forever and returns all changes as rows directly over pgwire. The types of these rows are `(topic STRING, key BYTES, value BYTES)` and they correspond exactly to what would be emitted to a sink. Because everything is funneled through the sql gateway and the client connection dies if it dies, there's no reason to run this as a system job. So we don't. This means the client is responsible for keeping track of the latest resolved timestamp emitted and, on errors, reconnecting with the `cursor=<timestamp>` option. This also "happens" to be exactly the interface we need for most of the unit tests, so switch them over to it. This allows the removal of the timing based aspects of the tests, which should reduce some the flake problems these tests have been having. NB: The system still internally buffers results, so changes are not returned immediately. Which means this is currently quite awkward and surprising to use as a client of CockroachDB. The fix initially seems like a decent amount of work so it'll wait for a followup PR. (The tests work around it with a hack to set `ConnResultsBufferBytes` to a very small value in the test servers.) Closes #26661 Closes #26682 Release note: None
- Loading branch information
Showing
13 changed files
with
517 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.