[ https://issues.apache.org/jira/browse/IGNITE-19359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17723872#comment-17723872 ]
Ignite TC Bot commented on IGNITE-19359: ---------------------------------------- {panel:title=Branch: [pull/10727/head] Base: [master] : Possible Blockers (11)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1} {color:#d04437}Snapshots{color} [[tests 0 Exit Code , Failure on metric |https://ci.ignite.apache.org/viewLog.html?buildId=7237801]] {color:#d04437}[Check Code Style Ducktests]{color} [[tests 0 Exit Code |https://ci.ignite.apache.org/viewLog.html?buildId=7237743]] {color:#d04437}Cache 2{color} [[tests 0 TIMEOUT , Exit Code , Failure on metric |https://ci.ignite.apache.org/viewLog.html?buildId=7237721]] {color:#d04437}Disk Page Compressions 1{color} [[tests 1 Exit Code , Failure on metric |https://ci.ignite.apache.org/viewLog.html?buildId=7237819]] * IgnitePdsCompressionTestSuite: WalRecoveryWithPageCompressionAndTdeTest.testRecoveryLargeNoCheckpoint - Test has low fail rate in base branch 0,0% and is not flaky {color:#d04437}PDS 2{color} [[tests 0 TIMEOUT , Exit Code , Failure on metric |https://ci.ignite.apache.org/viewLog.html?buildId=7237775]] {color:#d04437}Disk Page Compressions 2{color} [[tests 0 TIMEOUT , Exit Code , Failure on metric |https://ci.ignite.apache.org/viewLog.html?buildId=7237820]] {color:#d04437}Basic 4{color} [[tests 1|https://ci.ignite.apache.org/viewLog.html?buildId=7237714]] * IgniteBasicTestSuite2: IgniteDiagnosticMessagesTest.testSeveralLongRunningTxs - Test has low fail rate in base branch 0,0% and is not flaky {color:#d04437}Queries 3{color} [[tests 1|https://ci.ignite.apache.org/viewLog.html?buildId=7237794]] * IgniteBinaryCacheQueryTestSuite3: BasicSqlTypesIndexTest.testSqlTimeTypeIndex - Test has low fail rate in base branch 0,0% and is not flaky {color:#d04437}Continuous Query 3{color} [[tests 1|https://ci.ignite.apache.org/viewLog.html?buildId=7237750]] * IgniteCacheQuerySelfTestSuite5: GridCacheContinuousQueryConcurrentTest.testRestartReplicated - Test has low fail rate in base branch 0,0% and is not flaky {color:#d04437}Queries 1{color} [[tests 1|https://ci.ignite.apache.org/viewLog.html?buildId=7237790]] * IgniteBinaryCacheQueryTestSuite: BasicIndexTest.testDynamicIdxOnStaticCacheWithIdxWithoutPersistence - Test has low fail rate in base branch 0,0% and is not flaky {panel} {panel:title=Branch: [pull/10727/head] Base: [master] : New Tests (80)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1} {color:#00008b}Platform .NET (Core Linux){color} [[tests 40|https://ci.ignite.apache.org/viewLog.html?buildId=7237788]] * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(6,2) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_SkipKey_LogsWarningAndBypassesPartitionAwareness - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithUserTypeAffinityKey_RequestIsRoutedToPrimaryNode(1,0) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithUserTypeAffinityKey_RequestIsRoutedToPrimaryNode(2,0) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(2,0) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(3,0) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(4,1) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(5,1) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(4,1) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(5,1) - PASSED{color} * {color:#013220}DotNetCore: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(6,2) - PASSED{color} ... and 29 new tests {color:#00008b}Platform .NET (Windows){color} [[tests 40|https://ci.ignite.apache.org/viewLog.html?buildId=7237789]] * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(4,1) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(5,1) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(6,2) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_SkipKey_LogsWarningAndBypassesPartitionAwareness - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(6,2) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(1,1) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(2,0) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKeyBinarizable_RequestIsRoutedToPrimaryNode(3,0) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(2,0) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(3,0) - PASSED{color} * {color:#013220}exe: PartitionAwarenessTest.CachePut_UserDefinedTypeWithAffinityKey_RequestIsRoutedToPrimaryNode(4,1) - PASSED{color} ... and 29 new tests {panel} [TeamCity *--> Run :: All* Results|https://ci.ignite.apache.org/viewLog.html?buildId=7237822&buildTypeId=IgniteTests24Java8_RunAll] > .NET: Thin client: 'Affinity keys are not supported exception' on put > --------------------------------------------------------------------- > > Key: IGNITE-19359 > URL: https://issues.apache.org/jira/browse/IGNITE-19359 > Project: Ignite > Issue Type: Bug > Components: platforms, thin client > Affects Versions: 2.14 > Reporter: Pavel Tupitsyn > Assignee: Pavel Tupitsyn > Priority: Major > Labels: .NET > Fix For: 2.16 > > > Reproducer from > [StackOverflow|https://stackoverflow.com/questions/76099508/why-cant-i-add-data-with-an-affinitykey-into-an-apache-ignite-cache] > {code:C#} > using Apache.Ignite.Core; > using Apache.Ignite.Core.Cache.Affinity; > using Apache.Ignite.Core.Cache.Configuration; > using Apache.Ignite.Core.Cache.Query; > using Apache.Ignite.Core.Client; > using Apache.Ignite.Core.Client.Cache; > public record PERSONKEY( > [property:AffinityKeyMapped] [property: QuerySqlField(NotNull = true)] > long COMPANYID, > [property: QuerySqlField(NotNull = true)] long PERSONID); > public record PERSONVALUE( > [property: QuerySqlField(NotNull = true)] string FIRSTNAME, > [property: QuerySqlField(NotNull = true)] string LASTNAME); > internal class Program > { > public static void Main(string[] args) > { > var cfg = new IgniteClientConfiguration > { > Endpoints = new[] {"10.7.116.49:10800"}, > }; > using var client = Ignition.StartClient(cfg); > var schemaBuilder = client.GetOrCreateCache<int, int>(new > CacheClientConfiguration > { > Name = "RR", SqlSchema = "PUBLIC" > }); > schemaBuilder.Query(new SqlFieldsQuery( > $@"CREATE TABLE IF NOT EXISTS PERSON ( > COMPANYID BIGINT NOT NULL, > PERSONID BIGINT NOT NULL, > FIRSTNAME VARCHAR NOT NULL, > LASTNAME VARCHAR NOT NULL, > PRIMARY KEY(COMPANYID, PERSONID) > ) WITH > ""TEMPLATE=PARTITIONED,BACKUPS=1,AFFINITY_KEY=COMPANYID,CACHE_NAME=PERSON, > > KEY_TYPE={typeof(PERSONKEY).FullName},VALUE_TYPE={typeof(PERSONVALUE).FullName}""" > ) { Schema = "PUBLIC" }).GetAll(); > > var cache = client.GetCache<PERSONKEY, PERSONVALUE>("PERSON"); > > var key = new PERSONKEY(1, 2); > var value = new PERSONVALUE("JOHN", "SMITH"); > > // Throws an exception > // Apache.Ignite.Core.Common.IgniteException: Affinity keys are not > supported. > // Object 'PERSONKEY { COMPANYID = 1, PERSONID = 2 }' has an affinity > key. > cache.Put(key, value); > > // Does not throw an exception > cache.PutAll(new[]{KeyValuePair.Create(key, value)}); > > var people = cache.Query(new SqlFieldsQuery("SELECT * FROM PERSON > WHERE COMPANYID = ?", key.COMPANYID)).GetAll(); > // Correctly prints "1 2 JOHN SMITH" > Console.WriteLine(string.Join("\n", people.Select(p => $"{p[0]} > {p[1]} {p[2]} {p[3]}"))); > } > } > {code} > *Exception:* > {code} > Apache.Ignite.Core.Common.IgniteException: Affinity keys are not supported. > Object 'PERSONKEY { COMPANYID = 1, PERSONID = 2 }' has an affinity key. > {code} > We should not throw an exception when partition can't be calculated. Instead, > log a warning and bypass partition awareness. -- This message was sent by Atlassian Jira (v8.20.10#820010)