-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrations: add target column to system.pts_records #74281
migrations: add target column to system.pts_records #74281
Conversation
First commit is from #74211. |
b963f58
to
a5057c6
Compare
a5057c6
to
91e7bad
Compare
91e7bad
to
ce46759
Compare
@arulajmani @irfansharif rebased and RFAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note also in the PR message that the target column will store an encoded protocol buffer?
pkg/migration/migrations/alter_table_protected_timestamp_records.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @arulajmani)
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 64 at r1 (raw file):
// Inject the old copy of the descriptor. migrations.InjectLegacyTable(ctx, t, s, systemschema.ProtectedTimestampsRecordsTable, getDeprecatedProtectedTimestampRecordsDescriptor)
[nit] Line wrap.
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 66 at r1 (raw file):
migrations.InjectLegacyTable(ctx, t, s, systemschema.ProtectedTimestampsRecordsTable, getDeprecatedProtectedTimestampRecordsDescriptor) // Validate that the protected timestamp records table has the old schema. migrations.ValidateSchemaExists(
[nit] Wrap this in a tiny helper func:
validateSchemaExists := func (exp bool) { ...}
// ...
validateSchemaExists(false)
migrations.Migrate(...)
validateSchemaExists(true)
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 99 at r1 (raw file):
} // getDeprecatedTableStatisticsDescriptor returns the system.table_statistics
Comment needs to be updated.
ce46759
to
9c2e0c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner, @arulajmani, and @irfansharif)
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 64 at r1 (raw file):
Previously, irfansharif (irfan sharif) wrote…
[nit] Line wrap.
Done.
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 66 at r1 (raw file):
Previously, irfansharif (irfan sharif) wrote…
[nit] Wrap this in a tiny helper func:
validateSchemaExists := func (exp bool) { ...} // ... validateSchemaExists(false) migrations.Migrate(...) validateSchemaExists(true)
Done.
pkg/migration/migrations/alter_table_protected_timestamp_records_test.go, line 99 at r1 (raw file):
Previously, irfansharif (irfan sharif) wrote…
Comment needs to be updated.
Done.
This change adds a `BYTES` column to the system.pts_records table, that will store an encoded protocol buffer representing the `Target` on a protected timestamp record. We do not populate the column in this PR, that will be done in a followup. Additionally, we add a tenant migration to `ALTER TABLE ... ADD COLUMN` to run on the upgrade path for older clusters. Informs: cockroachdb#73727 Release note (sql change): `system.protected_timestamp_records` table now has an additional `target` column that will store an encoded protobuf that represents the target a record protects. This target can either be the entire cluster, tenants, or schema objects (databases/tables).
9c2e0c8
to
cdb829c
Compare
TFTR! bors r=ajwerner,irfansharif |
74281: migrations: add target column to system.pts_records r=ajwerner,irfansharif a=adityamaru This change adds a `BYTES` column to the system.pts_records table, that will store an encoded protocol buffer representing the `Target` on a protected timestamp record. We do not populate the column in this PR, that will be done in a followup. Additionally, we add a tenant migration to `ALTER TABLE ... ADD COLUMN` to run on the upgrade path for older clusters. Informs: #73727 Release note (sql change): `system.protected_timestamp_records` table now has an additional `target` column that will store an encoded protobuf that represents the target a record protects. This target can either be the entire cluster, tenants, or schema objects (databases/tables). Co-authored-by: Aditya Maru <[email protected]>
Build failed: |
TestComposeGSS flake bors r=ajwerner,irfansharif |
74281: migrations: add target column to system.pts_records r=ajwerner,irfansharif a=adityamaru This change adds a `BYTES` column to the system.pts_records table, that will store an encoded protocol buffer representing the `Target` on a protected timestamp record. We do not populate the column in this PR, that will be done in a followup. Additionally, we add a tenant migration to `ALTER TABLE ... ADD COLUMN` to run on the upgrade path for older clusters. Informs: #73727 Release note (sql change): `system.protected_timestamp_records` table now has an additional `target` column that will store an encoded protobuf that represents the target a record protects. This target can either be the entire cluster, tenants, or schema objects (databases/tables). 74418: authors: add sherman-grewal to authors r=sherman-grewal a=sherman-grewal Release note: None Co-authored-by: Aditya Maru <[email protected]> Co-authored-by: Sherman Grewal <[email protected]>
Build failed (retrying...): |
Build succeeded: |
This change adds a
BYTES
column to the system.pts_recordstable, that will store an encoded protocol buffer
representing the
Target
on a protected timestamprecord. We do not populate the column in this PR, that will
be done in a followup.
Additionally, we add a tenant migration to
ALTER TABLE ... ADD COLUMN
to run on the upgrade path for older clusters.
Informs: #73727
Release note (sql change):
system.protected_timestamp_records
tablenow has an additional
target
column that will store an encodedprotobuf that represents the target a record protects. This target
can either be the entire cluster, tenants, or schema objects
(databases/tables).