-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: dynamically detect a query's home region with enforce_home_region
enforce_home_region phase 3 ---- This extends the `enforce_home_region` session setting to not error out right away when executing a locality-optimized search or join operation, and the operation must read rows from a remote region. Instead, it will retry the transaction, but with the local region, as marked in `evalCtx`, updated to indicate one of the remote regions in the cluster. This causes the locality-optimized Scan or Join operation to read from that remote region first. A follower_read_timestamp() is used when re-running the query with AOST, so no remote reads actually occur. If the query succeeds, the current fake local region is reported back to the user in an error, for example: ``` Query is not running in its home region. Try running the query from region 'us-east-1'. ``` All of the remote regions in the cluster are tried until the home region is found, or all remote regions are exhausted, in which case the original "Query has no home region" error is returned. This preview feature is only supported for SELECT queries. Epic: CRDB-18645 Fixes: #83819 Release note (sql change): The enforce_home_region session setting was extended with a new optional preview feature and session setting, which is disabled by default, to dynamically detect and report the home region for SELECT queries based on the locality of the queried rows, if different from the gateway region.
- Loading branch information
Mark Sirek
committed
Mar 7, 2023
1 parent
2afe786
commit d2594fc
Showing
26 changed files
with
547 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.