Skip to content

Commit

Permalink
Add docs for auto-rehoming of RBR tables
Browse files Browse the repository at this point in the history
Fixes #11214
Fixes #11454
Fixes #11212

Depends on a link that will exist once we merge #12035
  • Loading branch information
rmloveland committed Oct 26, 2021
1 parent d2b192f commit a14ffc3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions v21.2/set-locality.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,34 @@ ALTER TABLE rides ADD COLUMN region crdb_internal_region AS (
{% include {{page.version.version}}/sql/locality-optimized-search.md %}
### Turn on auto-rehoming for `REGIONAL BY ROW` tables
{% include {{ page.version.version }}/misc/experimental-warning.md %}
When auto-rehoming is enabled, the [home region](#crdb_region) of rows in [`REGIONAL BY ROW`](#set-the-table-locality-to-regional-by-row) tables is automatically set to the home region of the [gateway node](ui-sessions-page.html#session-details-gateway-node) from which any [`UPDATE`](update.html) or [`UPSERT`](upsert.html) statements originate. This functionality is provided by adding [an `ON UPDATE` expression](add-column.html#on-update-expressions) to the [home region column](#crdb_region), such that when the column's `ON UPDATE` expression is re-evaluated, the column is updated to the result of that expression.

To set the [session setting](set-vars.html), issue the following statement:

{% include_cached copy-clipboard.html %}
~~~ sql
SET on_update_rehome_row_enabled = true;
~~~

~~~
SET
~~~

To set the [cluster setting](cluster-settings.html), issue the following statement:

{% include_cached copy-clipboard.html %}
~~~ sql
SET CLUSTER SETTING sql.defaults.experimental_auto_rehoming.enabled = on;
~~~

~~~
SET CLUSTER SETTING
~~~

<a name="global"></a>

### Set the table locality to `GLOBAL`
Expand Down
2 changes: 1 addition & 1 deletion v21.2/ui-sessions-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Click the **Session Duration** of any session to display details and possible ac

- **Session** shows the ID of the connected session.
- **Session Start Time** shows the timestamp at which the session started.
- **Gateway Node** shows the node ID and IP address/port of the [gateway](architecture/life-of-a-distributed-transaction.html#gateway) node handling the client connection.
- **Gateway Node** <a name="session-details-gateway-node"></a> shows the node ID and IP address/port of the [gateway](architecture/life-of-a-distributed-transaction.html#gateway) node handling the client connection.
- **Client Address** shows the IP address/port of the client that opened the session.
- **Memory Usage** shows the amount of memory currently allocated to this session, followed by the maximum amount of memory this session has ever allocated.
- The **Terminate Session** button ends the session. The client that holds this session will receive a "connection terminated" event.
Expand Down

0 comments on commit a14ffc3

Please sign in to comment.