-
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.
82873: storage: support MVCC range tombstones in `MVCCExportToSST` r=itsbilal a=erikgrinaker This patch adds support for exporting MVCC range tombstones in `MVCCExportToSST()`, and by extension in the KV `Export` method. This will only happen after two version gates are enabled: * `EnablePebbleFormatVersionRangeKeys`: begins emitting SSTs in `Pebblev2` format, which supports Pebble range keys. * `MVCCRangeTombstones`: allows writing MVCC range tombstones via KV. MVCC range tombstones are emitted in the same way as point tombstones: all tombstones if `ExportAllRevisions` is enabled, or the latest visible tombstone if `StartTS` is given. MVCC range tombstones are truncated to the SST bounds. For example, if exporting the span `a-f` then any range tombstones wider than the span will be truncated to `[a-f)`. If the export hits a limit e.g. at `c` then any MVCC range tombstones in the returned SST are truncated to `[a-c)`. If `StopMidKey` is enabled, then it's possible for two subsequent exports to contain overlapping MVCC range tombstones. For example, given the range tombstone `[a-f)`@5`,` if we return a resume key at `c@3` then the response will contain a truncated MVCC range tombstone `[a-c\0)`@5`` which covers the point keys at `c`, but resuming from `c@3` will contain the MVCC range tombstone `[c-f)`@5`` which overlaps with the MVCC range tombstone in the previous response for the interval `[c-c\0)`@5`.` `AddSSTable` will allow this overlap during ingestion once it supports MVCC range tombstones. Resolves #71398. Release note: None 83282: cli/demo,cdc: enable rangefeeds by default r=[knz,stevendanna] a=HonoreDB Fixes #82719, which made it annoying to run changefeeds in cockroach demo as you need to enable rangefeeds twice, once at the system level. Now cockroach demo enables rangefeeds at startup. You can override this behavior for performance or to demo the process of enabling rangefeeds with the flag `--auto-enable-rangefeeds=false`. Release note (cli change): cockroach demo now enables rangefeeds by default. You can restore the old behavior with --auto-enable-rangefeeds=false. Co-authored-by: Erik Grinaker <[email protected]> Co-authored-by: Aaron Zinger <[email protected]>
- Loading branch information
Showing
12 changed files
with
1,122 additions
and
45 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env expect -f | ||
|
||
source [file join [file dirname $argv0] common.tcl] | ||
|
||
start_test "Demo core changefeed using format=csv" | ||
spawn $argv demo --format=csv | ||
|
||
# We should start in a populated database. | ||
eexpect "movr>" | ||
|
||
# initial_scan=only prevents the changefeed from hanging waiting for more changes. | ||
send "CREATE CHANGEFEED FOR users WITH initial_scan='only';\r" | ||
|
||
# header for the results of a successful changefeed | ||
eexpect "table,key,value" | ||
|
||
# Statement execution time after the initial scan completes | ||
eexpect "Time:" | ||
|
||
eexpect "movr>" | ||
send_eof | ||
eexpect eof | ||
|
||
end_test | ||
|
||
start_test "Demo with rangefeeds disabled as they are in real life" | ||
spawn $argv demo --format=csv --auto-enable-rangefeeds=false | ||
|
||
# We should start in a populated database. | ||
eexpect "movr>" | ||
|
||
# initial_scan=only prevents the changefeed from hanging waiting for more changes. | ||
send "CREATE CHANGEFEED FOR users WITH initial_scan='only';\r" | ||
|
||
# changefeed should fail fast with an informative error. | ||
eexpect "ERROR: rangefeeds require the kv.rangefeed.enabled setting." | ||
|
||
eexpect "movr>" | ||
send_eof | ||
eexpect eof | ||
|
||
end_test |
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.