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

sql: add max_prepared_transactions variable #129295

Merged
merged 1 commit into from
Dec 12, 2024
Merged
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
15 changes: 15 additions & 0 deletions pkg/cmd/roachtest/tests/pgjdbc.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ func registerPgjdbc(r registry.Registry) {
t.Fatal(err)
}

// Remove an unsupported deferrable qualifier (#31632) from the XA test
// suite setup. This prevents XADataSourceTest.mappingOfConstraintViolations
// from running properly (it fails either way), but it allows the rest of
// the XA tests to run.
if err := repeatRunE(
ctx,
t,
c,
node,
"removing unsupported deferrable qualifier from test",
"sed -i 's/ deferrable//' /mnt/data1/pgjdbc/pgjdbc/src/test/java/org/postgresql/test/xa/XADataSourceTest.java",
); err != nil {
t.Fatal(err)
}

t.Status("building pgjdbc (without tests)")
// Build pgjdbc and run a single test, this step involves some
// downloading, so it needs a retry loop as well. Just building was not
Expand Down
18 changes: 17 additions & 1 deletion pkg/cmd/roachtest/tests/pgjdbc_blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,23 @@ var pgjdbcBlockList = blocklist{
`org.postgresql.test.util.PasswordUtilTest.encryptionTypeValueOfOn()`: "73337",
`org.postgresql.test.util.PasswordUtilTest.mD5()`: "73337",
`org.postgresql.test.util.PasswordUtilTest.scramSha256()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.initializationError`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.autoCommit()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.commitByDifferentConnection()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.commitUnknownXid()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.committingCommittedXid()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.databaseRemovesPreparedBeforeCommit()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.databaseRemovesPreparedBeforeRollback()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.mappingOfConstraintViolations()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.networkIssueOnCommit()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.networkIssueOnRollback()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.onePhaseCommitOfPrepared()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.preparingPreparedXid()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.recover()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.repeatedRolledBack()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.rollback()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.rollbackByDifferentConnection()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.rollbackUnknownXid()`: "unknown",
`org.postgresql.test.xa.XADataSourceTest.twoPhaseCommit()`: "unknown",
}

var pgjdbcIgnoreList = blocklist{
Expand Down
31 changes: 16 additions & 15 deletions pkg/sql/explain_bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,21 +1132,22 @@ func (c *stmtEnvCollector) PrintTableStats(
// explicitly excluded from env.sql of the bundle (they were deemed unlikely to
// be useful in investigations).
var skipReadOnlySessionVar = map[string]struct{}{
"crdb_version": {}, // version is included separately
"integer_datetimes": {},
"lc_collate": {},
"lc_ctype": {},
"max_connections": {},
"max_identifier_length": {},
"max_index_keys": {},
"server_encoding": {},
"server_version": {},
"server_version_num": {},
"session_authorization": {},
"session_user": {},
"system_identity": {},
"tracing": {},
"virtual_cluster_name": {},
"crdb_version": {}, // version is included separately
"integer_datetimes": {},
"lc_collate": {},
"lc_ctype": {},
"max_connections": {},
"max_identifier_length": {},
"max_index_keys": {},
"max_prepared_transactions": {},
"server_encoding": {},
"server_version": {},
"server_version_num": {},
"session_authorization": {},
"session_user": {},
"system_identity": {},
"tracing": {},
"virtual_cluster_name": {},
}

// sessionVarNeedsQuotes contains all writable session variables that have
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/logictest/testdata/logic_test/information_schema
Original file line number Diff line number Diff line change
Expand Up @@ -3984,6 +3984,7 @@ log_timezone UTC
max_connections -1
max_identifier_length 128
max_index_keys 32
max_prepared_transactions 2147483647
max_retries_for_read_committed 10
node_id 1
null_ordered_last off
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/pg_catalog
Original file line number Diff line number Diff line change
Expand Up @@ -2993,6 +2993,7 @@ log_timezone UTC N
max_connections -1 NULL NULL NULL string
max_identifier_length 128 NULL NULL NULL string
max_index_keys 32 NULL NULL NULL string
max_prepared_transactions 2147483647 NULL NULL NULL string
max_retries_for_read_committed 10 NULL NULL NULL string
node_id 1 NULL NULL NULL string
null_ordered_last off NULL NULL NULL string
Expand Down Expand Up @@ -3194,6 +3195,7 @@ log_timezone UTC N
max_connections -1 NULL user NULL -1 -1
max_identifier_length 128 NULL user NULL 128 128
max_index_keys 32 NULL user NULL 32 32
max_prepared_transactions 2147483647 NULL user NULL 2147483647 2147483647
max_retries_for_read_committed 10 NULL user NULL 10 10
node_id 1 NULL user NULL 1 1
null_ordered_last off NULL user NULL off off
Expand Down Expand Up @@ -3392,6 +3394,7 @@ log_timezone NULL NULL NULL
max_connections NULL NULL NULL NULL NULL
max_identifier_length NULL NULL NULL NULL NULL
max_index_keys NULL NULL NULL NULL NULL
max_prepared_transactions NULL NULL NULL NULL NULL
max_retries_for_read_committed NULL NULL NULL NULL NULL
multiple_active_portals_enabled NULL NULL NULL NULL NULL
node_id NULL NULL NULL NULL NULL
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/logictest/testdata/logic_test/show_source
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ log_timezone UTC
max_connections -1
max_identifier_length 128
max_index_keys 32
max_prepared_transactions 2147483647
max_retries_for_read_committed 10
node_id 1
null_ordered_last off
Expand Down
4 changes: 4 additions & 0 deletions pkg/sql/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,10 @@ var varGen = map[string]sessionVar{
// See https://www.postgresql.org/docs/10/static/runtime-config-preset.html#GUC-MAX-INDEX-KEYS
`max_index_keys`: makeReadOnlyVar("32"),

// Supported for PG compatibility only. MaxInt32 indicates no limit.
// See https://www.postgresql.org/docs/10/runtime-config-resource.html#GUC-MAX-PREPARED-TRANSACTIONS
`max_prepared_transactions`: makeReadOnlyVar(strconv.Itoa(math.MaxInt32)),

// CockroachDB extension.
`node_id`: {
Get: func(evalCtx *extendedEvalContext, _ *kv.Txn) (string, error) {
Expand Down
Loading