-
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
builtins: pg_get_constraintdef
broken during DROP CONSTRAINT in txn
#75825
Comments
Hi @otan, please add a C-ategory label to your issue. Check out the label system docs. While you're here, please consider adding an A- label to help keep our repository tidy. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
In #69008 we changed where we decide to reset the complete set of descriptors. I'm not totally sure I picked up on that subtle detail. We use to do it when we did a write. The idea was that's when we'd invalidate the set. @postamar changed it to be on read, which I sort of get, but I don't totally get. cockroach/pkg/sql/catalog/descs/descriptor.go Line 237 in be1b6c4
The idea being that you've got to check things out before you check them in, but I don't know, it doesn't seem to work here. I will note that new descriptors we avoid the whole descs collection. I don't know why that is. |
@fqazi I understand you've got a fix in the works, related to the random schema changer somehow. Feel free to re-triage this if this issue assignment doesn't make sense. |
I'll split it off and put up a pull request for it, I have it with the randomized schema changer fixes. |
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
76381: sql: stale descriptor state could be observed in crdb_internal tables r=fqazi a=fqazi 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 Co-authored-by: Faizan Qazi <[email protected]>
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 (bug fix): Certain crdb_internal tables could return incorrect information due to cached table descriptor information.
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
This is a new failure introduced between 4d6d79d...7897f24, so my guess is 617d300 is the cause of the regression.
The following should not error:
example output:
pg_get_constraintdef
:cockroach/pkg/sql/sem/builtins/pg_builtins.go
Lines 300 to 319 in be1b6c4
Refs #68363 (comment)
The text was updated successfully, but these errors were encountered: