You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "vcrfxia (via GitHub)" <gi...@apache.org> on 2023/04/06 17:21:26 UTC

[GitHub] [kafka] vcrfxia opened a new pull request, #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

vcrfxia opened a new pull request, #13522:
URL: https://github.com/apache/kafka/pull/13522

   (This PR is stacked on https://github.com/apache/kafka/pull/13496 and https://github.com/apache/kafka/pull/13497. The first two commits do not need to be reviewed separately.)
   
   This PR updates foreign-key table-table join processors to ignore out-of-order records from versioned tables, as specified in [KIP-914](https://cwiki.apache.org/confluence/display/KAFKA/KIP-914%3A+Join+Processor+Semantics+for+Versioned+Stores). 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] vcrfxia commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "vcrfxia (via GitHub)" <gi...@apache.org>.
vcrfxia commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1171919367


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyJoinIntegrationTest.java:
##########
@@ -249,62 +272,62 @@ public void doJoinFromLeftThenDeleteLeftEntity() {
 
     @Test
     public void doJoinFromRightThenDeleteRightEntity() {
-        final Topology topology = getTopology(streamsConfig, materialized ? "store" : null, leftJoin, rejoin);
+        final Topology topology = getTopology(streamsConfig, materialized ? "store" : null, leftJoin, rejoin, leftVersioned, rightVersioned);
         try (final TopologyTestDriver driver = new TopologyTestDriver(topology, streamsConfig)) {
             final TestInputTopic<String, String> right = driver.createInputTopic(RIGHT_TABLE, new StringSerializer(), new StringSerializer());
             final TestInputTopic<String, String> left = driver.createInputTopic(LEFT_TABLE, new StringSerializer(), new StringSerializer());
             final TestOutputTopic<String, String> outputTopic = driver.createOutputTopic(OUTPUT, new StringDeserializer(), new StringDeserializer());
             final KeyValueStore<String, String> store = driver.getKeyValueStore("store");
 
             // Pre-populate the LHS records. This test is all about what happens when we add/remove RHS records
-            left.pipeInput("lhs1", "lhsValue1|rhs1");
-            left.pipeInput("lhs2", "lhsValue2|rhs2");
-            left.pipeInput("lhs3", "lhsValue3|rhs1");
+            left.pipeInput("lhs1", "lhsValue1|rhs1", baseTimestamp);
+            left.pipeInput("lhs2", "lhsValue2|rhs2", baseTimestamp + 1);
+            left.pipeInput("lhs3", "lhsValue3|rhs1", baseTimestamp + 2);
 
             assertThat(
                 outputTopic.readKeyValuesToMap(),
                 is(leftJoin
-                       ? mkMap(mkEntry("lhs1", "(lhsValue1|rhs1,null)"),
-                               mkEntry("lhs2", "(lhsValue2|rhs2,null)"),
-                               mkEntry("lhs3", "(lhsValue3|rhs1,null)"))
-                       : emptyMap()
+                    ? mkMap(mkEntry("lhs1", "(lhsValue1|rhs1,null)"),
+                    mkEntry("lhs2", "(lhsValue2|rhs2,null)"),
+                    mkEntry("lhs3", "(lhsValue3|rhs1,null)"))
+                    : emptyMap()

Review Comment:
   Ack, sorry about that. I tried looking to see if I have an auto-reformat setting on my IDE but everything looks to be disabled. I'll be on the lookout for this in the future; hopefully it won't be an issue again.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1164867385


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyJoinIntegrationTest.java:
##########
@@ -249,62 +272,62 @@ public void doJoinFromLeftThenDeleteLeftEntity() {
 
     @Test
     public void doJoinFromRightThenDeleteRightEntity() {
-        final Topology topology = getTopology(streamsConfig, materialized ? "store" : null, leftJoin, rejoin);
+        final Topology topology = getTopology(streamsConfig, materialized ? "store" : null, leftJoin, rejoin, leftVersioned, rightVersioned);
         try (final TopologyTestDriver driver = new TopologyTestDriver(topology, streamsConfig)) {
             final TestInputTopic<String, String> right = driver.createInputTopic(RIGHT_TABLE, new StringSerializer(), new StringSerializer());
             final TestInputTopic<String, String> left = driver.createInputTopic(LEFT_TABLE, new StringSerializer(), new StringSerializer());
             final TestOutputTopic<String, String> outputTopic = driver.createOutputTopic(OUTPUT, new StringDeserializer(), new StringDeserializer());
             final KeyValueStore<String, String> store = driver.getKeyValueStore("store");
 
             // Pre-populate the LHS records. This test is all about what happens when we add/remove RHS records
-            left.pipeInput("lhs1", "lhsValue1|rhs1");
-            left.pipeInput("lhs2", "lhsValue2|rhs2");
-            left.pipeInput("lhs3", "lhsValue3|rhs1");
+            left.pipeInput("lhs1", "lhsValue1|rhs1", baseTimestamp);
+            left.pipeInput("lhs2", "lhsValue2|rhs2", baseTimestamp + 1);
+            left.pipeInput("lhs3", "lhsValue3|rhs1", baseTimestamp + 2);
 
             assertThat(
                 outputTopic.readKeyValuesToMap(),
                 is(leftJoin
-                       ? mkMap(mkEntry("lhs1", "(lhsValue1|rhs1,null)"),
-                               mkEntry("lhs2", "(lhsValue2|rhs2,null)"),
-                               mkEntry("lhs3", "(lhsValue3|rhs1,null)"))
-                       : emptyMap()
+                    ? mkMap(mkEntry("lhs1", "(lhsValue1|rhs1,null)"),
+                    mkEntry("lhs2", "(lhsValue2|rhs2,null)"),
+                    mkEntry("lhs3", "(lhsValue3|rhs1,null)"))
+                    : emptyMap()

Review Comment:
   nit: avoid unnecessary reformatting (seems to be an IDE setting that triggered?)



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] vcrfxia commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "vcrfxia (via GitHub)" <gi...@apache.org>.
vcrfxia commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1171919730


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyVersionedJoinIntegrationTest.java:
##########
@@ -0,0 +1,301 @@
+/*
+ * 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.kafka.streams.integration;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.kafka.common.utils.Utils.mkEntry;
+import static org.apache.kafka.common.utils.Utils.mkMap;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.streams.StreamsConfig;
+import org.apache.kafka.streams.TestInputTopic;
+import org.apache.kafka.streams.TestOutputTopic;
+import org.apache.kafka.streams.Topology;
+import org.apache.kafka.streams.TopologyTestDriver;
+import org.apache.kafka.streams.state.KeyValueStore;
+import org.apache.kafka.test.IntegrationTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+@Category(IntegrationTest.class)
+public class KTableKTableForeignKeyVersionedJoinIntegrationTest extends KTableKTableForeignKeyJoinIntegrationTest {
+
+    public KTableKTableForeignKeyVersionedJoinIntegrationTest(final boolean leftJoin,
+                                                              final boolean materialized,
+                                                              final boolean leftVersioned,
+                                                              final boolean rightVersioned) {
+        // optimizations and rejoin are disabled for these tests, as these tests focus on versioning.
+        // see KTableKTableForeignKeyJoinIntegrationTest for test coverage for optimizations and rejoin
+        super(leftJoin, StreamsConfig.NO_OPTIMIZATION, materialized, false, leftVersioned, rightVersioned);
+    }
+
+    @Parameterized.Parameters(name = "leftJoin={0}, materialized={1}, leftVersioned={2}, rightVersioned={3}")
+    public static Collection<Object[]> data() {
+        final List<Boolean> booleans = Arrays.asList(true, false);
+        return buildParameters(booleans, booleans, booleans, booleans);
+    }
+
+    @Test
+    public void shouldIgnoreOutOfOrderRecordsIffVersioned() {

Review Comment:
   Ah yeah I meant for this to mean "if and only if." It does look like a typo at first glance haha.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] vcrfxia commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "vcrfxia (via GitHub)" <gi...@apache.org>.
vcrfxia commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1171919015


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyJoinIntegrationTest.java:
##########
@@ -140,9 +163,9 @@ public void doJoinFromLeftThenDeleteLeftEntity() {
             final KeyValueStore<String, String> store = driver.getKeyValueStore("store");
 
             // Pre-populate the RHS records. This test is all about what happens when we add/remove LHS records
-            right.pipeInput("rhs1", "rhsValue1");
-            right.pipeInput("rhs2", "rhsValue2");
-            right.pipeInput("rhs3", "rhsValue3"); // this unreferenced FK won't show up in any results
+            right.pipeInput("rhs1", "rhsValue1", baseTimestamp);

Review Comment:
   I'll leave it as is for readability, since I believe auto-advance would be per-topic and the test behavior is clearer this way since it's explicit that records from the two input topics do not overlap/interleave in their timestamps.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] vcrfxia commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "vcrfxia (via GitHub)" <gi...@apache.org>.
vcrfxia commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1160070653


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/foreignkeyjoin/ForeignJoinSubscriptionSendProcessorSupplier.java:
##########
@@ -217,5 +207,26 @@ public void process(final Record<K, Change<V>> record) {
                 }
             }
         }
+
+        @Override
+        public void close() {
+            primaryKeyValueGetter.close();
+        }
+
+        private void logSkippedRecordDueToNullForeignKey() {

Review Comment:
   Extracting the common code from `process()` into this helper method is purely a refactor, unrelated to the changes in this PR. I had to make the refactor in order to avoid a CyclomaticComplexity checkstyle failure upon adding a clause into `process()` for dropping out-of-order records. 



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] vcrfxia commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "vcrfxia (via GitHub)" <gi...@apache.org>.
vcrfxia commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1160073388


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyVersionedJoinIntegrationTest.java:
##########
@@ -0,0 +1,301 @@
+/*
+ * 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.kafka.streams.integration;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.kafka.common.utils.Utils.mkEntry;
+import static org.apache.kafka.common.utils.Utils.mkMap;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.streams.StreamsConfig;
+import org.apache.kafka.streams.TestInputTopic;
+import org.apache.kafka.streams.TestOutputTopic;
+import org.apache.kafka.streams.Topology;
+import org.apache.kafka.streams.TopologyTestDriver;
+import org.apache.kafka.streams.state.KeyValueStore;
+import org.apache.kafka.test.IntegrationTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+@Category(IntegrationTest.class)
+public class KTableKTableForeignKeyVersionedJoinIntegrationTest extends KTableKTableForeignKeyJoinIntegrationTest {

Review Comment:
   I've added a new test class which extends the existing FK join integration test class, rather than adding `leftVersioned` and `rightVersioned` into the parameters matrix for the existing class directly, in order to keep the number of test cases manageable. The existing test class already runs 96 tests (16 parameter combinations for each of 6 tests). Adding `leftVersioned` and `rightVersioned` into the parameter matrix would multiply that number by another factor of 4. By adding a new test class instead, and not testing for topology optimizations or rejoins in this new class, this new class only adds 108 new tests (16 parameter combinations for each of 7 tests) instead of three times that many.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1164874948


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyVersionedJoinIntegrationTest.java:
##########
@@ -0,0 +1,301 @@
+/*
+ * 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.kafka.streams.integration;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.kafka.common.utils.Utils.mkEntry;
+import static org.apache.kafka.common.utils.Utils.mkMap;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.streams.StreamsConfig;
+import org.apache.kafka.streams.TestInputTopic;
+import org.apache.kafka.streams.TestOutputTopic;
+import org.apache.kafka.streams.Topology;
+import org.apache.kafka.streams.TopologyTestDriver;
+import org.apache.kafka.streams.state.KeyValueStore;
+import org.apache.kafka.test.IntegrationTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+@Category(IntegrationTest.class)
+public class KTableKTableForeignKeyVersionedJoinIntegrationTest extends KTableKTableForeignKeyJoinIntegrationTest {
+
+    public KTableKTableForeignKeyVersionedJoinIntegrationTest(final boolean leftJoin,
+                                                              final boolean materialized,
+                                                              final boolean leftVersioned,
+                                                              final boolean rightVersioned) {
+        // optimizations and rejoin are disabled for these tests, as these tests focus on versioning.
+        // see KTableKTableForeignKeyJoinIntegrationTest for test coverage for optimizations and rejoin
+        super(leftJoin, StreamsConfig.NO_OPTIMIZATION, materialized, false, leftVersioned, rightVersioned);
+    }
+
+    @Parameterized.Parameters(name = "leftJoin={0}, materialized={1}, leftVersioned={2}, rightVersioned={3}")
+    public static Collection<Object[]> data() {
+        final List<Boolean> booleans = Arrays.asList(true, false);
+        return buildParameters(booleans, booleans, booleans, booleans);
+    }
+
+    @Test
+    public void shouldIgnoreOutOfOrderRecordsIffVersioned() {

Review Comment:
   `Iff` -> `If`



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1164864257


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyJoinIntegrationTest.java:
##########
@@ -140,9 +163,9 @@ public void doJoinFromLeftThenDeleteLeftEntity() {
             final KeyValueStore<String, String> store = driver.getKeyValueStore("store");
 
             // Pre-populate the RHS records. This test is all about what happens when we add/remove LHS records
-            right.pipeInput("rhs1", "rhsValue1");
-            right.pipeInput("rhs2", "rhsValue2");
-            right.pipeInput("rhs3", "rhsValue3"); // this unreferenced FK won't show up in any results
+            right.pipeInput("rhs1", "rhsValue1", baseTimestamp);

Review Comment:
   Should we use "auto advance" instead of passing in timestamps expliclity?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1164864257


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyJoinIntegrationTest.java:
##########
@@ -140,9 +163,9 @@ public void doJoinFromLeftThenDeleteLeftEntity() {
             final KeyValueStore<String, String> store = driver.getKeyValueStore("store");
 
             // Pre-populate the RHS records. This test is all about what happens when we add/remove LHS records
-            right.pipeInput("rhs1", "rhsValue1");
-            right.pipeInput("rhs2", "rhsValue2");
-            right.pipeInput("rhs3", "rhsValue3"); // this unreferenced FK won't show up in any results
+            right.pipeInput("rhs1", "rhsValue1", baseTimestamp);

Review Comment:
   Should we use "auto advance" instead of passing in timestamps expliclity? Could also be an advantage to keep it explicit for readability?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax commented on a diff in pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax commented on code in PR #13522:
URL: https://github.com/apache/kafka/pull/13522#discussion_r1164874948


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyVersionedJoinIntegrationTest.java:
##########
@@ -0,0 +1,301 @@
+/*
+ * 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.kafka.streams.integration;
+
+import static java.util.Collections.emptyMap;
+import static org.apache.kafka.common.utils.Utils.mkEntry;
+import static org.apache.kafka.common.utils.Utils.mkMap;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.streams.StreamsConfig;
+import org.apache.kafka.streams.TestInputTopic;
+import org.apache.kafka.streams.TestOutputTopic;
+import org.apache.kafka.streams.Topology;
+import org.apache.kafka.streams.TopologyTestDriver;
+import org.apache.kafka.streams.state.KeyValueStore;
+import org.apache.kafka.test.IntegrationTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+@Category(IntegrationTest.class)
+public class KTableKTableForeignKeyVersionedJoinIntegrationTest extends KTableKTableForeignKeyJoinIntegrationTest {
+
+    public KTableKTableForeignKeyVersionedJoinIntegrationTest(final boolean leftJoin,
+                                                              final boolean materialized,
+                                                              final boolean leftVersioned,
+                                                              final boolean rightVersioned) {
+        // optimizations and rejoin are disabled for these tests, as these tests focus on versioning.
+        // see KTableKTableForeignKeyJoinIntegrationTest for test coverage for optimizations and rejoin
+        super(leftJoin, StreamsConfig.NO_OPTIMIZATION, materialized, false, leftVersioned, rightVersioned);
+    }
+
+    @Parameterized.Parameters(name = "leftJoin={0}, materialized={1}, leftVersioned={2}, rightVersioned={3}")
+    public static Collection<Object[]> data() {
+        final List<Boolean> booleans = Arrays.asList(true, false);
+        return buildParameters(booleans, booleans, booleans, booleans);
+    }
+
+    @Test
+    public void shouldIgnoreOutOfOrderRecordsIffVersioned() {

Review Comment:
   `Iff` -> `If` (or is it `if and only if`)?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] mjsax merged pull request #13522: KAFKA-14834: [5/N] Drop out-of-order records from FK join with versioned tables

Posted by "mjsax (via GitHub)" <gi...@apache.org>.
mjsax merged PR #13522:
URL: https://github.com/apache/kafka/pull/13522


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org