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: mr specific database zone configs on region add should be set in type schema changer #60750

Closed
arulajmani opened this issue Feb 18, 2021 · 0 comments · Fixed by #61073
Closed
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@arulajmani
Copy link
Collaborator

Currently, we set zone configs on the database in the user txn that adds a region. This isn't ideal, as adding a region may roll back in the async type schema job. Instead we should move the code that sets zone configs on the database to the type schema changer, so that zone configs happen transactionally with a region add.

@arulajmani arulajmani added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Feb 18, 2021
@arulajmani arulajmani self-assigned this Feb 24, 2021
arulajmani added a commit to arulajmani/cockroach that referenced this issue Feb 24, 2021
Previously, database level zone configurations weren't updated when the
region drop was finalized. This patch adds that support.

This patch also moves setting zone configurations on ADD REGION from
the user txn to the type schema changer. This ensures that zone
configurations are added transactionally -- if the ADD REGION fails for
whatever reason, we no longer leave behind dangling zone config.

Lastly, I've refactored some test setup code that was being duplicated
and improved the tests around rollback to test additional scenarios.

Closes cockroachdb#60435
Closes cockroachdb#60750

Release note: None

Release justification: bug fixes and low-risk updates to new
functionality
arulajmani added a commit to arulajmani/cockroach that referenced this issue Feb 25, 2021
Previously, database level zone configurations weren't updated when the
region drop was finalized. This patch adds that support.

This patch also moves setting zone configurations on ADD REGION from
the user txn to the type schema changer. This ensures that zone
configurations are added transactionally -- if the ADD REGION fails for
whatever reason, we no longer leave behind dangling zone config.

Lastly, I've refactored some test setup code that was being duplicated
and improved the tests around rollback to test additional scenarios.

Closes cockroachdb#60435
Closes cockroachdb#60750

Release note: None

Release justification: bug fixes and low-risk updates to new
functionality
craig bot pushed a commit that referenced this issue Feb 26, 2021
61073: sql: update database zone configurations after region drop finalization r=otan a=arulajmani

Previously, database level zone configurations weren't updated when the
region drop was finalized. This patch adds that support.

This patch also moves setting zone configurations on ADD REGION from
the user txn to the type schema changer. This ensures that zone
configurations are added transactionally -- if the ADD REGION fails for
whatever reason, we no longer leave behind dangling zone config.

Lastly, I've refactored some test setup code that was being duplicated
and improved the tests around rollback to test additional scenarios.

Closes #60435
Closes #60750

Release note: None

Release justification: bug fixes and low-risk updates to new
functionality

Co-authored-by: arulajmani <[email protected]>
@craig craig bot closed this as completed in bd6d789 Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant