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

Secondary regions do not work with RBR tables #19436

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Secondary regions]({% link {{ page.version.version }}/multiregion-overview.md %}#secondary-regions) are not compatible with databases containing [`REGIONAL BY ROW`]({% link {{ page.version.version }}/table-localities.md %}#regional-by-row-tables) tables. CockroachDB does not prevent you from defining secondary regions on databases with regional by row tables, but the interaction of these features is not supported.

Therefore, Cockroach Labs recommends that you avoid defining secondary regions on databases that use regional by-row table configurations.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ To take advantage of regional by row tables:

For instructions showing how to set a table's locality to `REGIONAL BY ROW` and configure the home regions of its rows, see [`ALTER TABLE ... SET LOCALITY`]({% link {{ page.version.version }}/alter-table.md %}#crdb_region).

For more information on regional by row tables, see the [Cockroach Labs blog post](https://www.cockroachlabs.com/blog/regional-by-row/).
For more information on regional by row tables, see the [Cockroach Labs blog post](https://www.cockroachlabs.com/blog/regional-by-row/).

{{site.data.alerts.callout_danger}}
{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}
6 changes: 6 additions & 0 deletions src/current/v25.1/alter-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ If the [primary region](#set-primary-region) fails, the secondary region becomes

{{site.data.alerts.callout_danger}}
In order to add a secondary region with `ALTER DATABASE ... SET SECONDARY REGION`, you must first set a primary database region with [`SET PRIMARY REGION`](#set-primary-region), or when [creating the database]({% link {{ page.version.version }}/create-database.md %}). For an example showing how to add a secondary region with `ALTER DATABASE`, see [Set the secondary region](#set-the-secondary-region).

{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}

For examples, see [Manage regions](#manage-regions).
Expand Down Expand Up @@ -554,6 +556,10 @@ ALTER DATABASE SET SECONDARY REGION

Now, the `"us-west1"` region will act as the primary region if the original primary region fails.

{{site.data.alerts.callout_danger}}
{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}

#### Unset the secondary region

To unset an existing [database region]({% link {{ page.version.version }}/multiregion-overview.md %}#database-regions) as the [secondary region]({% link {{ page.version.version }}/multiregion-overview.md %}#secondary-regions) on a multi-region database, use the [`DROP SECONDARY REGION`](#drop-secondary-region) statement:
Expand Down
4 changes: 4 additions & 0 deletions src/current/v25.1/create-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ CREATE DATABASE

For more information about secondary regions, see [Secondary regions]({% link {{ page.version.version }}/multiregion-overview.md %}#secondary-regions).

{{site.data.alerts.callout_danger}}
{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}

## See also

- [`SHOW DATABASES`]({% link {{ page.version.version }}/show-databases.md %})
Expand Down
4 changes: 4 additions & 0 deletions src/current/v25.1/known-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,3 +702,7 @@ UNION ALL SELECT * FROM t1 LEFT JOIN t2 ON st_contains(t1.geom, t2.geom) AND t2.
#### Inverted join for `tsvector` and `tsquery` types is not supported

CockroachDB cannot index-accelerate queries with `@@` predicates when both sides of the operator are variables. [#102731](https://github.com/cockroachdb/cockroach/issues/102731)

#### Secondary Regions and Regional By-Row Tables

{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
4 changes: 4 additions & 0 deletions src/current/v25.1/migrate-to-multiregion-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ SHOW ZONE CONFIGURATION FROM TABLE users;

~~~

{{site.data.alerts.callout_danger}}
{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}

#### Global tables

A [`GLOBAL`]({% link {{ page.version.version }}/table-localities.md %}) table differs from the default by setting the following zone configuration settings:
Expand Down
4 changes: 4 additions & 0 deletions src/current/v25.1/multiregion-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ If you are using [super regions](#super-regions) in your cluster, there are addi
</ul>
{{site.data.alerts.end}}

{{site.data.alerts.callout_danger}}
{% include {{page.version.version}}/known-limitations/secondary-regions-with-regional-by-row-tables.md %}
{{site.data.alerts.end}}

## Survival goals

A _survival goal_ dictates how many simultaneous failure(s) a database can survive. All tables within the same database operate with the **same survival goal**. Each database can have its own survival goal setting.
Expand Down
2 changes: 1 addition & 1 deletion src/current/v25.1/table-localities.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ Use a [`GLOBAL` table locality]({% link {{ page.version.version }}/table-localit

For an in-depth data placement support comparison and a demonstration of how the [Federal Wire Act (1961)](https://en.wikipedia.org/wiki/Federal_Wire_Act) can only be satisfied with CockroachDB, watch the following video:

{% include_cached youtube.html video_id="3p9VcZOf1Y4" %}
{% include_cached youtube.html video_id="3p9VcZOf1Y4" %}
Loading