ptupitsyn commented on code in PR #5752: URL: https://github.com/apache/ignite-3/pull/5752#discussion_r2087142778
########## modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java: ########## @@ -485,22 +488,23 @@ private <T> CompletableFuture<T> doSchemaOutInOpAsync( .thenCompose(v -> { ClientSchema schema = schemaFut.getNow(null); - PartitionMapping forCrd = getPreferredNodeName(tableId(), provider, partitionsFut.getNow(null), schema, true); - - return ClientLazyTransaction.ensureStarted(tx, ch, forCrd).thenCompose(tx0 -> { - @Nullable PartitionMapping forOp = getPreferredNodeName(tableId(), provider, partitionsFut.getNow(null), schema, - tx0 == null); // Force coordinator mode for implicit transactions. + Supplier<PartitionMapping> sup = + () -> getPreferredNodeName(tableId(), provider, partitionsFut.getNow(null), schema, true); + return ensureStarted(tx, ch, sup).thenCompose(tx0 -> { + // Force coordinator mode for implicit transactions. + @Nullable PartitionMapping forOp = + getPreferredNodeName(tableId(), provider, partitionsFut.getNow(null), schema, tx0 == null); WriteContext ctx = new WriteContext(); - ctx.pm = forOp; + // Force proxy mode for requests collocated with coordinator to reduce passed enlistment info on commit. Review Comment: ```suggestion // Force proxy mode for requests colocated with coordinator to reduce passed enlistment info on commit. ``` I think we agreed on this variant. ########## modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientTransactionsTest.java: ########## @@ -591,6 +622,133 @@ void testMixedMappingScenario2() { } } + @Test + void testMixedMappingScenarioWithNoopEnlistment() throws Exception { + // Inject spied instance. + TcpIgniteClient clent0 = (TcpIgniteClient) client(); + Field inflightsField = clent0.channel().getClass().getDeclaredField(INFLIGHTS_FIELD_NAME); + inflightsField.setAccessible(true); + ClientTransactionInflights inflights = clent0.channel().inflights(); + ClientTransactionInflights spyed = Mockito.spy(inflights); + inflightsField.set(clent0.channel(), spyed); + + for (ClientChannel channel : clent0.channel().channels()) { + Field f = channel.getClass().getDeclaredField(INFLIGHTS_FIELD_NAME); + f.setAccessible(true); + f.set(channel, spyed); + } + + Map<Partition, ClusterNode> map = table().partitionManager().primaryReplicasAsync().join(); + + ClientTable table = (ClientTable) table(); + + IgniteImpl server0 = TestWrappers.unwrapIgniteImpl(server(0)); + IgniteImpl server1 = TestWrappers.unwrapIgniteImpl(server(1)); + + List<Tuple> tuples0 = generateKeysForNode(500, 1, map, server0.clusterService().topologyService().localMember()); + List<Tuple> tuples1 = generateKeysForNode(510, 80, map, server1.clusterService().topologyService().localMember()); + + Map<Tuple, Tuple> data = new HashMap<>(); + + ClientLazyTransaction tx0 = (ClientLazyTransaction) client().transactions().begin(); + + // First operation is collocated with txn coordinator and not directly mapped. Review Comment: ```suggestion // First operation is colocated with txn coordinator and not directly mapped. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org