JAkutenshi commented on code in PR #6813:
URL: https://github.com/apache/ignite-3/pull/6813#discussion_r2444813074
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1058,12 +1055,18 @@ public CompletableFuture<List<BinaryRow>> getAll(
HybridTimestamp readTimestamp,
@Nullable UUID transactionId,
@Nullable UUID coordinatorId,
- InternalClusterNode recipientNode
+ @Nullable InternalClusterNode recipientNode
) {
+ Function<Integer, CompletableFuture<InternalClusterNode>>
calculateRecipientNode = recipientNode == null
Review Comment:
Changed.
##########
modules/table/src/main/java/org/apache/ignite/internal/table/InternalTable.java:
##########
@@ -173,7 +173,8 @@ default CompletableFuture<List<BinaryRow>> getAll(
* @param readTimestamp Read timestamp.
* @param transactionId Transaction ID (might be {@code null}).
* @param coordinatorId Ephemeral ID of the transaction coordinator.
- * @param recipientNode Cluster node that will handle given get request.
+ * @param recipientNode Cluster node that will handle given get request.
In case if given node is {@code null} then for each partition
Review Comment:
Changed.
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/readonly/ItMultiGetInExplicitReadOnlyTxTest.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.tx.readonly;
+
+import static java.util.stream.Collectors.toList;
+
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.apache.ignite.table.KeyValueView;
+import org.apache.ignite.tx.Transaction;
+import org.apache.ignite.tx.TransactionOptions;
+import org.junit.jupiter.api.Test;
+
+class ItMultiGetInExplicitReadOnlyTxTest extends ClusterPerTestIntegrationTest
{
+ private static final String TABLE_NAME = "TEST_TABLE";
+
+ private static final int KEY_COUNT = 100;
+
+ @Override
+ protected int initialNodes() {
+ return 2;
+ }
+
+ @Test
+ void roTransactionNoticesGarbageCollectedTupleVersionsOnDataNodes() {
+ Ignite coordinator = node(0);
Review Comment:
Should we if the only override there is `initialNodes` with 2? I had added,
but we didn't assert this in mostly any such integration tests.
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/readonly/ItMultiGetInExplicitReadOnlyTxTest.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.tx.readonly;
+
+import static java.util.stream.Collectors.toList;
+
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.apache.ignite.table.KeyValueView;
+import org.apache.ignite.tx.Transaction;
+import org.apache.ignite.tx.TransactionOptions;
+import org.junit.jupiter.api.Test;
+
+class ItMultiGetInExplicitReadOnlyTxTest extends ClusterPerTestIntegrationTest
{
+ private static final String TABLE_NAME = "TEST_TABLE";
+
+ private static final int KEY_COUNT = 100;
+
+ @Override
+ protected int initialNodes() {
+ return 2;
+ }
+
+ @Test
+ void roTransactionNoticesGarbageCollectedTupleVersionsOnDataNodes() {
Review Comment:
I guess it's some old intention of the reproducer's author. Changed.
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/tx/readonly/ItMultiGetInExplicitReadOnlyTxTest.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.tx.readonly;
+
+import static java.util.stream.Collectors.toList;
+
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.apache.ignite.table.KeyValueView;
+import org.apache.ignite.tx.Transaction;
+import org.apache.ignite.tx.TransactionOptions;
+import org.junit.jupiter.api.Test;
+
+class ItMultiGetInExplicitReadOnlyTxTest extends ClusterPerTestIntegrationTest
{
+ private static final String TABLE_NAME = "TEST_TABLE";
+
+ private static final int KEY_COUNT = 100;
+
+ @Override
+ protected int initialNodes() {
+ return 2;
+ }
+
+ @Test
+ void roTransactionNoticesGarbageCollectedTupleVersionsOnDataNodes() {
+ Ignite coordinator = node(0);
+
+ coordinator.sql().executeScript("CREATE ZONE NEW_ZONE (PARTITIONS 2,
REPLICAS 1) STORAGE PROFILES ['default']");
+
+ coordinator.sql().executeScript("CREATE TABLE " + TABLE_NAME + " (ID
INT PRIMARY KEY, VAL VARCHAR) ZONE NEW_ZONE");
+
+ KeyValueView<Integer, String> kvView =
coordinator.tables().table(TABLE_NAME).keyValueView(Integer.class,
String.class);
+
+ insertOriginalValues(KEY_COUNT, kvView);
+
+ Transaction roTx = coordinator.transactions().begin(new
TransactionOptions().readOnly(true));
+
+ List<Integer> keys = IntStream.range(0,
KEY_COUNT).boxed().collect(toList());
+ kvView.getAll(roTx, keys);
Review Comment:
I'd better to add assertions that will be more verbose there.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]