Skip to content
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

sql: show indexes with invalid encoding type in invalid_objects and DB console #106739

Closed
rafiss opened this issue Jul 13, 2023 · 1 comment
Closed
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@rafiss
Copy link
Collaborator

rafiss commented Jul 13, 2023

Is your feature request related to a problem? Please describe.
#97526 was a bug where secondary indexes can have the wrong encoding type. In some cases, it can lead to incorrect data being returned. There should be a way to easily detect if this problem is occurring in the cluster. It's even worse if a column is added to this invalid secondary index.

Describe the solution you'd like
We don't want to backport extra validation, since that could cause existing queries to fail. But we should have another way to get these invalid indexes in the crdb_internal.invalid_objects table, and alert the user in some way that the problem exists.

Jira issue: CRDB-29696

Epic CRDB-28665

@rafiss rafiss added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jul 13, 2023
fqazi added a commit to fqazi/cockroach that referenced this issue Jul 14, 2023
… a column

Previously, because of a bug we could end up with secondary indexes
being the only thing that stored a column. This could lead to data
loss if that secondary index was dropped. To address this, this patch
will block dropping such indexes with a link to the technical advisory.

Informs: cockroachdb#106739

Release note (bug fix): Block dropping of indexes impacted by
technical advisory 99561 if data loss could occur.
fqazi added a commit to fqazi/cockroach that referenced this issue Jul 14, 2023
…olumns

Previously, we had a bug were it was possible that the primary indexes
was not storing some non-virtual columns. Unfortunately, adding
validation in all cases would break existing customers, so as
a safety we have added validation to crdb_internal.invalid_objects
and the debug doctor command. To address this, this patch adds a
new validation level only for invalid_objects / doctor.

Fixes: cockroachdb#106794
Informs: cockroachdb#106739

Release note: None
fqazi added a commit to fqazi/cockroach that referenced this issue Jul 18, 2023
… a column

Previously, because of a bug we could end up with secondary indexes
being the only thing that stored a column. This could lead to data
loss if that secondary index was dropped. To address this, this patch
will block dropping such indexes with a link to the technical advisory.

Informs: cockroachdb#106739

Release note (bug fix): Block dropping of indexes impacted by
technical advisory 99561 if data loss could occur.
fqazi added a commit to fqazi/cockroach that referenced this issue Jul 18, 2023
…olumns

Previously, we had a bug were it was possible that the primary indexes
was not storing some non-virtual columns. Unfortunately, adding
validation in all cases would break existing customers, so as
a safety we have added validation to crdb_internal.invalid_objects
and the debug doctor command. To address this, this patch adds a
new validation level only for invalid_objects / doctor.

Fixes: cockroachdb#106794
Informs: cockroachdb#106739

Release note: None
rafiss pushed a commit that referenced this issue Jul 18, 2023
… a column

Previously, because of a bug we could end up with secondary indexes
being the only thing that stored a column. This could lead to data
loss if that secondary index was dropped. To address this, this patch
will block dropping such indexes with a link to the technical advisory.

Informs: #106739

Release note (bug fix): Block dropping of indexes impacted by
technical advisory 99561 if data loss could occur.
rafiss pushed a commit that referenced this issue Jul 18, 2023
…olumns

Previously, we had a bug were it was possible that the primary indexes
was not storing some non-virtual columns. Unfortunately, adding
validation in all cases would break existing customers, so as
a safety we have added validation to crdb_internal.invalid_objects
and the debug doctor command. To address this, this patch adds a
new validation level only for invalid_objects / doctor.

Fixes: #106794
Informs: #106739

Release note: None
rafiss pushed a commit that referenced this issue Jul 18, 2023
… a column

Previously, because of a bug we could end up with secondary indexes
being the only thing that stored a column. This could lead to data
loss if that secondary index was dropped. To address this, this patch
will block dropping such indexes with a link to the technical advisory.

Informs: #106739

Release note (bug fix): Block dropping of indexes impacted by
technical advisory 99561 if data loss could occur.
rafiss pushed a commit that referenced this issue Jul 18, 2023
…olumns

Previously, we had a bug were it was possible that the primary indexes
was not storing some non-virtual columns. Unfortunately, adding
validation in all cases would break existing customers, so as
a safety we have added validation to crdb_internal.invalid_objects
and the debug doctor command. To address this, this patch adds a
new validation level only for invalid_objects / doctor.

Fixes: #106794
Informs: #106739

Release note: None
@fqazi
Copy link
Collaborator

fqazi commented Jul 25, 2023

Opened a tracking issue for the console side: #107568

@fqazi fqazi closed this as completed Jul 25, 2023
celiala pushed a commit that referenced this issue Jul 26, 2023
… a column

Previously, because of a bug we could end up with secondary indexes
being the only thing that stored a column. This could lead to data
loss if that secondary index was dropped. To address this, this patch
will block dropping such indexes with a link to the technical advisory.

Informs: #106739

Release note (bug fix): Block dropping of indexes impacted by
technical advisory 99561 if data loss could occur.

(cherry picked from commit b70a985)
celiala pushed a commit that referenced this issue Jul 26, 2023
…olumns

Previously, we had a bug were it was possible that the primary indexes
was not storing some non-virtual columns. Unfortunately, adding
validation in all cases would break existing customers, so as
a safety we have added validation to crdb_internal.invalid_objects
and the debug doctor command. To address this, this patch adds a
new validation level only for invalid_objects / doctor.

Fixes: #106794
Informs: #106739

Release note: None

(cherry picked from commit 353e9c6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants