sql: validate primary / secondary region localities at end of txn#103362
sql: validate primary / secondary region localities at end of txn#103362craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
fa000a7 to
3db9d6b
Compare
|
While I think this works, is it possible to do the validation in the descriptor validation which is done at commit as well. |
|
@chengxiong-ruan Let me change this a tiny bit. I think we can have a model where we have an interface for validating zone config validation that gets pushed down into collections. |
3db9d6b to
d3137d1
Compare
Previously, if a database was restored with skip_localities, there was no way to modify this database to set the primary region since validation would kick in too early during the statement. This meant fixing the regions in a restored database was impossible if the primary region was no longer valid. To address this, this patch, delays locality validation till the end of the transaction. Fixes: cockroachdb#103290 Release note (bug fix): SET PRIMARY REGION and SET SECONDARY REGION did not validate transactionally, which could prevent cleaning up removed regions after a restore.
d3137d1 to
8b9f052
Compare
|
@chengxiong-ruan TFTR! |
|
bors r+ |
|
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 8b9f052 to blathers/backport-release-22.2-103362: 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 22.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
blathers backport 23.1 |
Previously, if a database was restored with skip_localities, there was no way to modify this database to set the primary region since validation would kick in too early during the statement. This meant fixing the regions in a restored database was impossible if the primary region was no longer valid. To address this, this patch, delays locality validation till the end of the transaction.
Fixes: #103290
Release note (bug fix): SET PRIMARY REGION and SET SECONDARY REGION did not validate transactionally, which could prevent cleaning up removed regions after a restore.