-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kv/bulk: write ImportEpoch to each MVCCValue during IMPORT
This patch makes IMPORT INTO on a non-empty table write the table's ImportEpoch to each ingested MVCC Value, via the SSTBatcher. In a future PR, the ImportEpoch will be used rollback an IMPORT INTO in some cases. This additional information will allow IMPORTing tables to be backed up and restored. As part of this change we now also assume we might see an MVCCValue during restore. * Version Gating Previously, callers could (and did) assume that the values present in the SSTs returned by export request could be interpreted directly as roachpb.Value objects using code like: roachpb.Value{RawBytes: valBytes} For MVCCValueHeaders to be exported by ExportRequest all callers need to be updated: 1. ExportRequest on system.descriptors in sql/catalog/lease 2. ExportRequest on system.descriptors in ccl/changefeedccl/schemafeed 3. ExportRequest used by `FINGERPRINT` 4. ExportRequest used by old binaries in a mixed-version cluster. (1) and (2) will be easy to update and likely don't matter in practice moment as those tables do not include values with exportable value headers at the moment. (3) will be easy to update, but we still need an option to exclude value headers (a) until value headers are included in rangefeeds and (b) so long as we want to compare fingerprints with 23.2 versions. (4) is impossible to update so if we want BACKUP/RESTORE to round-trip in mixed version cluster we must version gate including them in backups until the cluster is on a single version. To account for this we only increment ImportEpoch during IMPORTs that start on 24.1 or greater and we only request MVCCValueHeaders on BACKUPs that start on 24.1 or greater. The first condition is important to ensure that we can later detect a table that can be fully rolled back using the new rollback method. Note that this also marks a hard backward incompatibility for backup artifacts. Backups for 24.1 cannot be restored on 23.2 or older. This was already the case by policy. 23.2 backups should still work fine on 24.1 since all roachpb.Value's should properly decode as MVCCValue's. Informs #76722 Release note: None Co-authored-by: Steven Danna <[email protected]>
- Loading branch information
1 parent
c097c19
commit 2d4b601
Showing
19 changed files
with
451 additions
and
56 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
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.