-
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.
29445: release-2.1: cli: periodically flush csv/tsv output r=knz a=knz Backport 1/1 commits from #28688. /cc @cockroachdb/release --- Fixes #28654. The "sinkless" version of changefeeds continuously streams back results to the user over pgwire. Prior to this patch, this data could not be consumed effectively with `cockroach sql` using the tsv/csv output, because the tsv/csv formatter buffers rows internally. This patch makes tsv/csv output in `cockroach sql` an effective way to consume changefeeds by ensuring an upper bound on the time rows stays buffered inside the formatter. The flush period is fixed to 5 seconds. For context, all the other formatters except for `table` are line-buffered and thus flush on every row. `table` is a world of its own which buffers *all* the rows until the query is complete, and that is unlikely to change any time soon, so this patch doesn't touch that either. Release note (cli change): The `csv` and `tsv` formats for `cockroach` commands that output result rows now buffer data for a maximum of 5 seconds. This makes it possible to e.g. view SQL changefeeds interactively with `cockroach sql` and `cockroach demo`. Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
- Loading branch information
Showing
3 changed files
with
78 additions
and
22 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