-
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
sql: stale descriptor state could be observed in crdb_internal tables #76381
Conversation
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 @fqazi and @postamar)
pkg/sql/catalog/descs/collection.go, line 212 at r1 (raw file):
// Invalidate all the cached descriptors since a stale copy of this may be // included. tc.kv.releaseAllDescriptors()
my sense is we should remove the code that calls this on the read path
587656c
to
5e466a8
Compare
Fixes: cockroachdb#75825 Previously, when an uncommitted descriptor was added to a descriptor collection, we would not reset the cache of all immutable descriptors (used by some crdb_internal functions). This was inadequate because this could result in incorrect results from crdb_internal tables which returned information related to constraints, columns. To address this, this patch will reset the descriptor cache for all fetched descriptors when an uncommitted descriptor is added into the collection. Release note: None
5e466a8
to
bb0d19e
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.
Reviewed 2 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @postamar)
@ajwerner TFTR! |
bors r+ |
Build succeeded: |
thanks for the fix! any chance for a 21.2 backport? i think it might be affecting #70008 (comment) too |
blathers backport 21.2 |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from bb0d19e to blathers/backport-release-21.2-76381: POST https://api.github.com/repos/cockroachlabs/cockroach/merges: 403 Resource not accessible by integration [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2 failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Fixes: #75825
Previously, when an uncommitted descriptor was added
to a descriptor collection, we would not reset the cache of
all immutable descriptors (used by some crdb_internal functions).
This was inadequate because this could result in
incorrect results from crdb_internal tables which returned
information related to constraints, columns. To address this,
this patch will reset the descriptor cache for all
fetched descriptors when an uncommitted descriptor is
added into the collection.
Release note: None