forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
74297: ptstorage: change Protect and GetRecord to work with target column r=arulajmani a=adityamaru Protected timestamp records now apply on a `ptpb.Target` instead of `roachpb.Spans`. This change modifies the `Protect` and `GetRecord` methods of the ptstorage interface. Protect will persist the `ptpb.Target` specified on the passed in `ptpb.Record` as an encoded protocol buffer in the `target` column, and `GetRecord` will read the `target` column when constructing a `ptpb.Record` to return to the caller. If we are running in a mixed version state where the migration that adds the `target` column to the system.pts_records table has not run, we use the existing logic to protect Spans. This logic has wholesale been moved to `deprecatedProtect` method. Once the migration has run, all calls to protect must have a non-nil `ptpb.Target` field on the record, as we will no longer be persisting the `DeprecatedSpans` field in the underlying system table. Post migration, we do not use the `kv.protectedts.max_spans` to enforce any limits, but continue to use `kv.protectedts.max_bytes` to enforce a ceiling on the total size of encoded targets we can store in the subsystem. Most tests in `ptstorage_test` continue to run in both a pre and post migration state to ensure that `Storage` is handling both span backed and target backed records correctly. This can be cleaned up in a future version when we get rid of spans from the pts record entirely. All other PTS tests in the `kvserver` package run on a version prior to the pts migration since the remainder of the new pts system is yet to be implemented. These tests will be revisited as and when we develop those pieces of the subsystem. Informs: cockroachdb#73727 Release note: None Co-authored-by: Aditya Maru <[email protected]>
- Loading branch information
Showing
17 changed files
with
502 additions
and
120 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
Oops, something went wrong.