diff --git a/pkg/ccl/logictestccl/testdata/logic_test/zone b/pkg/ccl/logictestccl/testdata/logic_test/zone index 7f82e843fe78..36750d508100 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/zone +++ b/pkg/ccl/logictestccl/testdata/logic_test/zone @@ -762,3 +762,18 @@ ALTER RANGE default CONFIGURE ZONE USING num_replicas = 3 statement ok ALTER TABLE system.jobs CONFIGURE ZONE USING num_replicas = 3 + +# Test that index configurations don't infect partition configurations. +# Specifically we are testing that values written to infect@primary's +# zone configuration does not appear in partition p1 of infect@primary's zone config. +statement ok +CREATE TABLE infect (x INT PRIMARY KEY); +ALTER TABLE infect PARTITION BY LIST (x) ( PARTITION p1 VALUES IN (1)); +ALTER INDEX infect@primary CONFIGURE ZONE USING num_replicas=5; +ALTER PARTITION p1 OF TABLE infect CONFIGURE ZONE USING constraints='[+dc=dc1]' + +query TT +SELECT partition_name, zone_config FROM [SHOW PARTITIONS FROM TABLE infect] +---- +p1 constraints = '[+dc=dc1]' + diff --git a/pkg/cmd/roachtest/hibernate.go b/pkg/cmd/roachtest/hibernate.go index 2e07a5054184..93e513619360 100644 --- a/pkg/cmd/roachtest/hibernate.go +++ b/pkg/cmd/roachtest/hibernate.go @@ -129,7 +129,8 @@ func registerHibernate(r *testRegistry) { // Also note that this is expected to return an error, since the test suite // will fail. And it is safe to swallow it here. _ = c.RunE(ctx, node, - `cd /mnt/data1/hibernate/hibernate-core/ && ./../gradlew test -Pdb=cockroach`, + `cd /mnt/data1/hibernate/hibernate-core/ && `+ + `HIBERNATE_CONNECTION_LEAK_DETECTION=true ./../gradlew test -Pdb=cockroach`, ) t.Status("collecting the test results") diff --git a/pkg/cmd/roachtest/hibernate_blacklist.go b/pkg/cmd/roachtest/hibernate_blacklist.go index 1ef603a25d60..447cc246e511 100644 --- a/pkg/cmd/roachtest/hibernate_blacklist.go +++ b/pkg/cmd/roachtest/hibernate_blacklist.go @@ -64,7 +64,6 @@ var hibernateBlackList19_2 = blacklist{ "org.hibernate.test.annotations.lob.VersionedLobTest.testVersionUnchangedString": "26725", "org.hibernate.test.annotations.manytoone.referencedcolumnname.ManyToOneReferencedColumnNameTest.testReoverableExceptionInFkOrdering": "24062", "org.hibernate.test.annotations.onetoone.hhh9798.OneToOneJoinTableTest.storeNonUniqueRelationship": "5807", - "org.hibernate.test.annotations.query.QueryAndSQLTest.testNativeQueryWithFormulaAttributeWithoutAlias": "unknown", "org.hibernate.test.annotations.xml.hbm.HbmWithIdentityTest.testManyToOneAndInterface": "24062", "org.hibernate.test.bulkid.GlobalTemporaryTableBulkCompositeIdTest.testDeleteFromEngineer": "5807", "org.hibernate.test.bulkid.GlobalTemporaryTableBulkCompositeIdTest.testDeleteFromPerson": "5807", @@ -156,7 +155,6 @@ var hibernateBlackList19_2 = blacklist{ "org.hibernate.test.immutable.entitywithmutablecollection.inverse.VersionedEntityWithInverseOneToManyJoinTest.testOneToManyCollectionOptimisticLockingWithUpdate": "5807", "org.hibernate.test.immutable.entitywithmutablecollection.noninverse.EntityWithNonInverseOneToManyJoinTest.testOneToManyCollectionOptimisticLockingWithUpdate": "5807", "org.hibernate.test.immutable.entitywithmutablecollection.noninverse.VersionedEntityWithNonInverseOneToManyJoinTest.testOneToManyCollectionOptimisticLockingWithUpdate": "5807", - "org.hibernate.test.insertordering.InsertOrderingWithCascadeOnPersist.testInsertOrderingAvoidingForeignKeyConstraintViolation": "6583", "org.hibernate.test.insertordering.InsertOrderingWithJoinedTableInheritance.testBatchOrdering": "5807", "org.hibernate.test.insertordering.InsertOrderingWithJoinedTableInheritance.testBatchingAmongstSubClasses": "5807", "org.hibernate.test.insertordering.InsertOrderingWithJoinedTableMultiLevelInheritance.testBatchingAmongstSubClasses": "5807", @@ -209,21 +207,13 @@ var hibernateBlackList19_2 = blacklist{ "org.hibernate.test.locking.LockModeTest.testLegacyCriteriaAliasSpecific": "6583", "org.hibernate.test.locking.LockModeTest.testLoading": "6583", "org.hibernate.test.locking.LockModeTest.testQuery": "6583", - "org.hibernate.test.locking.LockModeTest.testQueryUsingLockOptions": "6583", "org.hibernate.test.locking.LockModeTest.testRefreshWithExplicitHigherLevelLockMode": "6583", "org.hibernate.test.locking.PessimisticReadSkipLockedTest.testPostgreSQLSkipLocked": "6583", "org.hibernate.test.locking.PessimisticWriteLockTimeoutTest.testNoWait": "6583", "org.hibernate.test.locking.PessimisticWriteLockTimeoutTest.testSkipLocked": "6583", "org.hibernate.test.locking.PessimisticWriteSkipLockedTest.testPostgreSQLSkipLocked": "6583", "org.hibernate.test.locking.UpgradeSkipLockedTest.testPostgreSQLSkipLocked": "6583", - "org.hibernate.test.locking.paging.PagingAndLockingTest.testCriteria": "6583", - "org.hibernate.test.locking.paging.PagingAndLockingTest.testHql": "6583", "org.hibernate.test.mixed.MixedTest.testMixedInheritance": "26725", - "org.hibernate.test.naturalid.mutable.cached.CachedMutableNaturalIdNonStrictReadWriteTest.testReattachementUnmodifiedInstance": "6583", - "org.hibernate.test.naturalid.mutable.cached.CachedMutableNaturalIdStrictReadWriteTest.testReattachementUnmodifiedInstance": "6583", - "org.hibernate.test.naturalid.nullable.NullableNaturalIdTest.testNaturalIdNullValueOnPersist": "6583", - "org.hibernate.test.naturalid.nullable.NullableNaturalIdTest.testNaturalIdQuerySupportingNullValues": "6583", - "org.hibernate.test.naturalid.nullable.NullableNaturalIdTest.testUniqueAssociation": "6583", "org.hibernate.test.notfound.OptionalEagerMappedByNotFoundTest.testOneToOneJoinException": "5807", "org.hibernate.test.notfound.OptionalEagerMappedByNotFoundTest.testOneToOneJoinIgnore": "5807", "org.hibernate.test.notfound.OptionalEagerMappedByNotFoundTest.testOneToOneSelectException": "5807", diff --git a/pkg/config/zone.go b/pkg/config/zone.go index 03bc9a3205a7..25e5f2e9cb83 100644 --- a/pkg/config/zone.go +++ b/pkg/config/zone.go @@ -516,6 +516,19 @@ func (z *ZoneConfig) GetSubzone(indexID uint32, partition string) *Subzone { return nil } +// GetSubzoneExact is similar to GetSubzone but does not find the most specific +// subzone that applies to a specified index and partition, as it finds either the +// exact config that applies, or returns nil. +func (z *ZoneConfig) GetSubzoneExact(indexID uint32, partition string) *Subzone { + for _, s := range z.Subzones { + if s.IndexID == indexID && s.PartitionName == partition { + copySubzone := s + return ©Subzone + } + } + return nil +} + // GetSubzoneForKeySuffix returns the ZoneConfig for the subzone that contains // keySuffix, if it exists and its position in the subzones slice. func (z ZoneConfig) GetSubzoneForKeySuffix(keySuffix []byte) (*Subzone, int32) { diff --git a/pkg/sql/set_zone_config.go b/pkg/sql/set_zone_config.go index f01890f30152..927b319358be 100644 --- a/pkg/sql/set_zone_config.go +++ b/pkg/sql/set_zone_config.go @@ -356,7 +356,7 @@ func (n *setZoneConfigNode) startExec(params runParams) error { var partialSubzone *config.Subzone if index != nil { - partialSubzone = partialZone.GetSubzone(uint32(index.ID), partition) + partialSubzone = partialZone.GetSubzoneExact(uint32(index.ID), partition) if partialSubzone == nil { partialSubzone = &config.Subzone{Config: *config.NewZoneConfig()} }