From 1d16e055b2b2f9a8552c21c01e4069774701163c Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Wed, 4 Sep 2024 12:21:39 -0400 Subject: [PATCH] sql: make sql.txn.repeatable_read_isolation.enabled public This commit makes the `sql.txn.repeatable_read_isolation.enabled` cluster setting public, as part of moving REPEATABLE READ isolation into a public preview. Epic: None Release note (sql change): The cluster setting sql.txn.repeatable_read_isolation.enabled was added and defaults to false. When set to true, the following statements will configure transactions to run under REPEATABLE READ isolation, rather than being automatically interpreted as SERIALIZABLE. - BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ - SET TRANSACTION ISOLATION LEVEL REPEATABLE READ - SET default_transaction_isolation = 'repeatable read' - SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL REPEATABLE READ This setting was added since REPEATABLE READ transactions are a preview feature, so usage of it is opt-in for v24.3. In a future CockroachDB major version, this setting will change to default to true. --- docs/generated/settings/settings-for-tenants.txt | 1 + docs/generated/settings/settings.html | 1 + pkg/sql/conn_executor.go | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index dec8e9d9e8e7..876c2eab9367 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -382,6 +382,7 @@ sql.ttl.default_select_batch_size integer 500 default amount of rows to select i sql.ttl.default_select_rate_limit integer 0 default select rate limit (rows per second) per node for each TTL job. Use 0 to signify no rate limit. application sql.ttl.job.enabled boolean true whether the TTL job is enabled application sql.txn.read_committed_isolation.enabled boolean true set to true to allow transactions to use the READ COMMITTED isolation level if specified by BEGIN/SET commands application +sql.txn.repeatable_read_isolation.enabled (alias: sql.txn.snapshot_isolation.enabled) boolean false set to true to allow transactions to use the REPEATABLE READ isolation level if specified by BEGIN/SET commands application sql.txn_fingerprint_id_cache.capacity integer 100 the maximum number of txn fingerprint IDs stored application storage.ingestion.value_blocks.enabled boolean true set to true to enable writing of value blocks in ingestion sstables application storage.max_sync_duration duration 20s maximum duration for disk operations; any operations that take longer than this setting trigger a warning log entry or process crash system-visible diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 3a5bed5f3f1c..7e2213ed2160 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -335,6 +335,7 @@
sql.ttl.default_select_rate_limit
integer0default select rate limit (rows per second) per node for each TTL job. Use 0 to signify no rate limit.Serverless/Dedicated/Self-Hosted
sql.ttl.job.enabled
booleantruewhether the TTL job is enabledServerless/Dedicated/Self-Hosted
sql.txn.read_committed_isolation.enabled
booleantrueset to true to allow transactions to use the READ COMMITTED isolation level if specified by BEGIN/SET commandsServerless/Dedicated/Self-Hosted +
sql.txn.repeatable_read_isolation.enabled
(alias: sql.txn.snapshot_isolation.enabled)
booleanfalseset to true to allow transactions to use the REPEATABLE READ isolation level if specified by BEGIN/SET commandsServerless/Dedicated/Self-Hosted
sql.txn_fingerprint_id_cache.capacity
integer100the maximum number of txn fingerprint IDs storedServerless/Dedicated/Self-Hosted
storage.experimental.eventually_file_only_snapshots.enabled
booleantrueset to false to disable eventually-file-only-snapshots (kv.snapshot_receiver.excise.enabled must also be false)Dedicated/Self-Hosted
storage.ingest_split.enabled
booleantrueset to false to disable ingest-time splitting that lowers write-amplificationDedicated/Self-Hosted diff --git a/pkg/sql/conn_executor.go b/pkg/sql/conn_executor.go index 89851dbdcd15..4ced0cd218aa 100644 --- a/pkg/sql/conn_executor.go +++ b/pkg/sql/conn_executor.go @@ -3533,10 +3533,10 @@ var allowRepeatableReadIsolation = settings.RegisterBoolSetting( settings.ApplicationLevel, "sql.txn.snapshot_isolation.enabled", "set to true to allow transactions to use the REPEATABLE READ isolation "+ - "level. At the time of writing, this setting is intended only for usage by "+ - "CockroachDB developers.", + "level if specified by BEGIN/SET commands", false, settings.WithName("sql.txn.repeatable_read_isolation.enabled"), + settings.WithPublic, ) var logIsolationLevelLimiter = log.Every(10 * time.Second)