diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt
index 46d945857e1a..a6558f6da9db 100644
--- a/docs/generated/settings/settings-for-tenants.txt
+++ b/docs/generated/settings/settings-for-tenants.txt
@@ -79,7 +79,7 @@ server.web_session.purge.max_deletions_per_cycle integer 10 the maximum number o
server.web_session.purge.period duration 1h0m0s the time until old sessions are deleted
server.web_session.purge.ttl duration 1h0m0s if nonzero, entries in system.web_sessions older than this duration are periodically purged
server.web_session_timeout duration 168h0m0s the duration that a newly created web session will be valid
-sql.contention.txn_id_cache.max_size byte size 64 MiB the maximum byte size TxnID cache will use (set to 0 to disable)
+sql.contention.txn_id_cache.max_size byte size 0 B the maximum byte size TxnID cache will use (set to 0 to disable)
sql.cross_db_fks.enabled boolean false if true, creating foreign key references across databases is allowed
sql.cross_db_sequence_owners.enabled boolean false if true, creating sequences owned by tables from other databases is allowed
sql.cross_db_sequence_references.enabled boolean false if true, sequences referenced by tables from other databases are allowed
diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html
index b2c8b1b459cf..0c5d47c3a079 100644
--- a/docs/generated/settings/settings.html
+++ b/docs/generated/settings/settings.html
@@ -91,7 +91,7 @@
server.web_session.purge.period | duration | 1h0m0s | the time until old sessions are deleted |
server.web_session.purge.ttl | duration | 1h0m0s | if nonzero, entries in system.web_sessions older than this duration are periodically purged |
server.web_session_timeout | duration | 168h0m0s | the duration that a newly created web session will be valid |
-sql.contention.txn_id_cache.max_size | byte size | 64 MiB | the maximum byte size TxnID cache will use (set to 0 to disable) |
+sql.contention.txn_id_cache.max_size | byte size | 0 B | the maximum byte size TxnID cache will use (set to 0 to disable) |
sql.cross_db_fks.enabled | boolean | false | if true, creating foreign key references across databases is allowed |
sql.cross_db_sequence_owners.enabled | boolean | false | if true, creating sequences owned by tables from other databases is allowed |
sql.cross_db_sequence_references.enabled | boolean | false | if true, sequences referenced by tables from other databases are allowed |
diff --git a/pkg/ccl/serverccl/statusccl/tenant_status_test.go b/pkg/ccl/serverccl/statusccl/tenant_status_test.go
index e7c5400f9976..2633187ca8e2 100644
--- a/pkg/ccl/serverccl/statusccl/tenant_status_test.go
+++ b/pkg/ccl/serverccl/statusccl/tenant_status_test.go
@@ -56,6 +56,15 @@ func TestTenantStatusAPI(t *testing.T) {
testHelper := newTestTenantHelper(t, 3 /* tenantClusterSize */, knobs)
defer testHelper.cleanup(ctx, t)
+ for _, conn := range []*sqlutils.SQLRunner{
+ sqlutils.MakeSQLRunner(testHelper.hostCluster.ServerConn(0)),
+ testHelper.testCluster().tenantConn(0),
+ } {
+ conn.Exec(
+ t, "SET CLUSTER SETTING sql.contention.txn_id_cache.max_size = '10MB'",
+ )
+ }
+
t.Run("reset_sql_stats", func(t *testing.T) {
testResetSQLStatsRPCForTenant(ctx, t, testHelper)
})
diff --git a/pkg/sql/contention/txnidcache/cluster_settings.go b/pkg/sql/contention/txnidcache/cluster_settings.go
index 03fe9a2b40b5..8183b52a4d7e 100644
--- a/pkg/sql/contention/txnidcache/cluster_settings.go
+++ b/pkg/sql/contention/txnidcache/cluster_settings.go
@@ -17,5 +17,6 @@ var MaxSize = settings.RegisterByteSizeSetting(
settings.TenantWritable,
`sql.contention.txn_id_cache.max_size`,
"the maximum byte size TxnID cache will use (set to 0 to disable)",
- 64*1024*1024, // 64 MB
+ // See https://github.com/cockroachdb/cockroach/issues/76738.
+ 0,
).WithPublic()
diff --git a/pkg/sql/contention/txnidcache/txn_id_cache_test.go b/pkg/sql/contention/txnidcache/txn_id_cache_test.go
index adffdb932651..07759d8d6c9c 100644
--- a/pkg/sql/contention/txnidcache/txn_id_cache_test.go
+++ b/pkg/sql/contention/txnidcache/txn_id_cache_test.go
@@ -209,7 +209,7 @@ func TestTransactionIDCache(t *testing.T) {
})
t.Run("provisional_txn_id_cache_record", func(t *testing.T) {
- testConn.Exec(t, "RESET CLUSTER SETTING sql.contention.txn_id_cache.max_size")
+ testConn.Exec(t, "SET CLUSTER SETTING sql.contention.txn_id_cache.max_size = '10MB'")
callCaptured := uint32(0)
injector.setHook(func(
diff --git a/pkg/sql/contention/txnidcache/writer_test.go b/pkg/sql/contention/txnidcache/writer_test.go
index efcc383710d3..69048c861ca6 100644
--- a/pkg/sql/contention/txnidcache/writer_test.go
+++ b/pkg/sql/contention/txnidcache/writer_test.go
@@ -172,6 +172,8 @@ func TestTxnIDCacheCanBeDisabledViaClusterSetting(t *testing.T) {
st := cluster.MakeTestingClusterSettings()
ctx := context.Background()
+ MaxSize.Override(ctx, &st.SV, 1<<10)
+
sink := &counterSink{}
w := newWriter(st, sink)
w.Record(contentionpb.ResolvedTxnID{
@@ -191,7 +193,7 @@ func TestTxnIDCacheCanBeDisabledViaClusterSetting(t *testing.T) {
require.Equal(t, 1, sink.numOfRecord)
// This should re-enable txn id cache.
- MaxSize.Override(ctx, &st.SV, MaxSize.Default())
+ MaxSize.Override(ctx, &st.SV, 1<<10)
w.Record(contentionpb.ResolvedTxnID{
TxnID: uuid.FastMakeV4(),