-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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,keys: disregard checks in *ZoneConfig*Batch #109774
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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 @annrpom and @nvanbenschoten)
pkg/sql/catalog/descs/collection.go
line 558 at r1 (raw file):
} if descID != keys.RootNamespaceID && !keys.IsPseudoTableID(uint32(descID)) {
i'm guessing if we do this change, we may want to remove this check too. but i'd like to understand this better.
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 @annrpom and @nvanbenschoten)
pkg/sql/catalog/descs/collection.go
line 558 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
i'm guessing if we do this change, we may want to remove this check too. but i'd like to understand this better.
The commit where this was added is ae5c0f6.
It may be related to the fact the RootNamespace and pseudo-tables both don't have descriptors... but i'm not sure
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 @nvanbenschoten and @rafiss)
pkg/sql/catalog/descs/collection.go
line 558 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
The commit where this was added is ae5c0f6.
It may be related to the fact the RootNamespace and pseudo-tables both don't have descriptors... but i'm not sure
+1: also, not sure if I need to keep the check for IsPseudoTableID either - system ranges belong to this category & altering a system range's zone config was (edit: and still is) supported at the time of the commit linked
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 @nvanbenschoten and @rafiss)
pkg/sql/catalog/descs/collection.go
line 558 at r1 (raw file):
Previously, annrpom (annie pompa) wrote…
+1: also, not sure if I need to keep the check for IsPseudoTableID either - system ranges belong to this category & altering a system range's zone config was supported at the time of the commit linked
update: the descID != keys.RootNamespaceID check makes sense in DeleteZoneConfigInBatch
, but I also noticed that the following would throw an error before we get to this check:
cockroach/pkg/sql/set_zone_config.go
Lines 539 to 541 in 4825e29
} else if targetID == keys.RootNamespaceID && deleteZone { | |
return pgerror.Newf(pgcode.CheckViolation, | |
"cannot remove default zone") |
4e1d2ac
to
2d9a10e
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.
@rafiss : [some for posterity] - after discussing with @Xiang-Gu, I aimed to fix this bug in the same nature Xiang detailed in # #88844 (heavy emphasis on the last paragraph in this commit); however, Chengxiong pointed out a good case for not solving it this way: this bug only happens in the case where descID == keys.RootNamespaceID || keys.IsPseudoTableID(uint32(descID))
in addition, no one can recall a proper reason as to why this check exists
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten and @rafiss)
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.
thanks for your research into the history of this code! i think this solution is good
This patch updates the PseudoTableIDs list to replace `PublicSchemaID` with `SystemPublicSchemaID`; while they are both the same value, the former is outdated. Epic: none Fixes: Release note: None
4c64864
to
a9588e9
Compare
Previously, a bug occured where a transactional schema change, `ALTER RANGE default CONFIGURE ZONE...`, statement would produce a CPut failure, even though both statements do take effect. This was due to a guard in the code that blocked us from adding the first zone config to the uncommitted cache, causing the expValues being updated to the KV batch to be the same for both statements. This patch addresses the issue by removing the check and allowing for `default` and psuedotables (like system ranges) to be added to the uncommitted cache. Epic: none Release note (bug fix): two `ALTER RANGE default CONFIGURE ZONE` statements on the same line no longer displays an error. Fixes: cockroachdb#108253
a9588e9
to
e56312f
Compare
TFTR! ('-')7 bors r=rafiss |
Build succeeded: |
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 e56312f to blathers/backport-release-23.1-109774: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Previously, a bug occured where a transactional schema change,
ALTER RANGE default CONFIGURE ZONE...
, statement wouldproduce a CPut failure, even though both statements do take effect.
This was due to a guard in the code that blocked us from adding the
first zone config to the uncommitted cache, causing the expValues
being updated to the KV batch to be the same for both statements.
This patch addresses the issue by removing the check and allowing
for
default
and psuedotables (like system ranges) to be added tothe uncommitted cache.
Epic: none
Release note (bug fix): two
ALTER RANGE default CONFIGURE ZONE
statements on the same line no longer displays an error.
Fixes: #108253