Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov merged PR #13095: URL: https://github.com/apache/ignite/pull/13095 -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5107191325 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9234928](https://ci2.ignite.apache.org/build/9234928) · 147 suites ran, 0 reused ✅ **No blockers** — nothing in this run looks caused by this PR. 19 pre-existing/flaky tests filtered out. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5105829591 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5102989174 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3664762184 ## modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageSerializationArchitectureTest.java: ## @@ -0,0 +1,149 @@ +/* + * 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.codegen; + +import com.tngtech.archunit.base.DescribedPredicate; +import com.tngtech.archunit.core.domain.JavaClasses; +import com.tngtech.archunit.core.domain.JavaMethodCall; +import com.tngtech.archunit.core.domain.JavaModifier; Review Comment: @anton-vinogradov , I guggest to remove both `tngtech` test before the merging. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5102774931 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5102747548 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664601389
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
+ * both. So whatever the cache-free pass does must stay correct when the
cache-aware pass runs it again.
+ *
+ * The distinction is the side effect. A plain {@code @Marshalled} field
unmarshals by assignment
+ * ({@code msg.x = ...}); assigning the same value twice is a no-op, so it is
idempotent and needs no guarding. A
+ * {@code @Marshalled} / {@code @Marshalled} field unmarshals by
mutation ({@code collection.add} /
Review Comment:
It is fixed already — the change is on the branch (pushed before the reply),
you are probably looking at an outdated revision of the diff. The class javadoc
now reads:
A message is finish-unmarshalled in two passes, cache-free and
cache-aware, and {@code MessageUnmarshalOnceCheck}
allows both. A field restored by assignment survives that: assigning the
same value twice is a no-op. A collection
or map one does not: {@code add}/{@code put} run twice double the
content.
No `@Marshalled / @Marshalled` left in the file (nor the stale
MessageMarshaller.Dedup link).
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664594564
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRecreateEvictionTest.java:
##
@@ -0,0 +1,136 @@
+/*
+ * 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.processors.cache.distributed.near;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+
+/**
+ * Checks that a near-write {@link GridDhtTxPrepareRequest} targeting a cache
incarnation older than the receiver's
+ * current one is answered with the key in {@code nearEvicted}, so the reader
is dropped instead of keeping a stale
+ * near entry.
+ */
+public class GridNearTxRecreateEvictionTest extends GridCommonAbstractTest {
Review Comment:
I would keep it here. The condition lives in a loop this PR rewrites anyway:
master bound the entry contexts inside GridDhtTxPrepareRequest#finishUnmarshal,
and with codegen serialization that binding moved into
processDhtTxPrepareRequest — the gap surfaced exactly there. Master only
dropped a near write when `cacheCtx == null`, but a cache recreated under the
same name keeps its cacheId, so a prepare addressed to the previous incarnation
passed the check and the near reader silently kept a stale entry instead of
being evicted. The fix is the second half of that `if`
(`topologyVersion().before(startTopologyVersion())`), i.e. two lines in a
statement we are touching regardless; moving it to another ticket would mean
shipping a knowingly incomplete condition here and editing the same line twice.
The test pins the behaviour — it is what proved the gap in the first place.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664587882
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java:
##
@@ -140,6 +145,16 @@ public boolean skipOnTimeout() {
return skipOnTimeout;
}
+/** Marks this message as marshalled. */
+void markMarshalled() {
+marshalled = true;
+}
+
+/** @return {@code true} if this message has been marshalled. */
+boolean marshalled() {
Review Comment:
These are the marshal side, and the double-unmarshal mechanics do not cover
it: MessageUnmarshalOnceCheck tracks finish-unmarshal of a payload and is gated
by IGNITE_MESSAGE_UNMARSHAL_ONCE_CHECK, i.e. it only runs under tests. The flag
here guards three different invariants of the prepare-once scheme on the send
path: `marshal()` asserts a wrap is never marshalled twice (marshalling is not
idempotent — GridCacheEntryInfo rebases expireTime, for one), `sendPrepared()`
asserts nothing unprepared is sent, and `sendMarshalled()` asserts nothing
unmarshalled reaches the wire. That is what makes prepare-once safe for both
fan-out (sendToMany) and retry (sendWithRetry), and it caught a real
double-marshal while the retry loop was being reworked in this PR.
MessageMarshalOnceTest covers two scenarios; the asserts cover every other
path, including future ones. Assertions are off in production, so the cost is a
boolean field on GridIoMessage.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664568089
##
modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java:
##
@@ -18,78 +18,175 @@
package org.apache.ignite.internal.plugin;
import java.lang.reflect.Constructor;
+import java.util.function.Supplier;
import org.apache.ignite.IgniteException;
-import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.MarshallableMessage;
import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.managers.communication.IgniteMessageFactory;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
+import org.apache.ignite.internal.processors.cache.GridCacheMessageDeployer;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
import org.apache.ignite.plugin.extensions.communication.Message;
-import org.apache.ignite.plugin.extensions.communication.MessageFactory;
import
org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
+import
org.apache.ignite.plugin.extensions.communication.NonMarshallableMessage;
+import org.jetbrains.annotations.Nullable;
/**
* An extension of {@link MessageFactoryProvider} allowing to use provided
schema-aware marshaller
- * and resolved class loader to register {@link MarshallableMessage}.
+ * to register {@link MarshallableMessage}.
*/
public abstract class AbstractMarshallableMessageFactoryProvider implements
MessageFactoryProvider {
+/** Generated-companion constructors per message class, including cached
negative lookups. */
+private static final ClassValue COMPANIONS = new
ClassValue<>() {
+@Override protected Companions computeValue(Class cls) {
+return new Companions(companionCtor(cls, "Serializer"),
companionCtor(cls, "Marshaller"), companionCtor(cls, "Deployer"));
+}
+};
+
/** Default schema-less marshaller. */
protected Marshaller dfltMarsh;
-/** Default class loader. */
-protected final ClassLoader dftlClsLdr = U.gridClassLoader();
-
/** Schema-aware marshaller like {@link BinaryMarshaller}. */
protected Marshaller schemaAwareMarsh;
-/** Resolved (configured) class loader like {@link
IgniteConfiguration#setClassLoader(ClassLoader)}. */
-protected ClassLoader resolvedClsLdr;
-
/**
* @param dfltMarsh Default schema-less marshaller like {@link
JdkMarshaller}.
* @param schemaAwareMarsh Schema-aware marshaller like {@link
BinaryMarshaller}.
- * @param resolvedClsLdr Resolved (configured) class loader like {@link
IgniteConfiguration#setClassLoader(ClassLoader)}.
*/
-public void init(Marshaller dfltMarsh, Marshaller schemaAwareMarsh,
ClassLoader resolvedClsLdr) {
+public void init(Marshaller dfltMarsh, Marshaller schemaAwareMarsh) {
this.dfltMarsh = dfltMarsh;
this.schemaAwareMarsh = schemaAwareMarsh;
-this.resolvedClsLdr = resolvedClsLdr;
}
-/** Registers message automatically generating message supplier and
serializer. */
-protected static void register(MessageFactory factory,
Class cls, short id, Marshaller marsh,
-ClassLoader clsLrd) {
+/** Registers a message with its generated serializer, marshaller (if
marshallable), and deployer (if any). */
+protected static void register(IgniteMessageFactory
factory, Class cls, short id, Marshaller marsh) {
Constructor ctor;
-MessageSerializer serializer;
try {
ctor = cls.getConstructor();
+}
+catch (NoSuchMethodException e) {
+throw new IgniteException("Failed to register message of type " +
cls.getSimpleName(), e);
+}
+
+register(factory, cls, id, () -> {
+try {
+return ctor.newInstance();
+}
+catch (Exception e) {
+throw new IgniteException("Failed to create message of type "
+ cls.getSimpleName(), e);
+}
+}, marsh);
+}
+
+/**
+ * Registers a message with a caller-provided {@code supplier} and its
generated serializer, marshaller (if
+ * marshallable), and deployer (if any). Use this overload when {@code
cls} is package-private and so cannot be
+ * instantiated by reflection from this package — pass an in-package
{@code ::new} reference as {@code supplier}.
+ */
+protected static void register(IgniteMessageFactory
factory, Class cls, short id,
+Supplier supplier, Marshaller marsh) {
+MessageSerializer serializer = requireGenerated(cls, "Serializer",
marsh);
+
+
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664530048
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##
@@ -460,6 +461,9 @@ public void resetMetrics() {
msg.getClass().getName() + ". Most likely
GridCommunicationSpi is being used directly, " +
"which is illegal - make sure to send messages
only via GridProjection API.");
}
+catch (IgniteCheckedException e) {
Review Comment:
Good catch — it was redundant and is gone now, together with the `throws
IgniteCheckedException` on `onMessage0` that made me add it. The body of
`onMessage0` is entirely wrapped in a try whose `catch
(IgniteCheckedException)` logs and continues (that is how master handles the
reserved-policy throw), and the `unmarshalNio` call this PR adds sits inside
that try — so nothing ever escaped. The listener is byte-identical to master
again.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -61,7 +62,10 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.batchId = batchId;
this.last = last;
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+mRows = new ArrayList<>(rows.size());
Review Comment:
It is the same conversion as on master, just without the stream pipeline:
master does `mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(toList())`, this is the equivalent loop into a
pre-sized ArrayList — no lambda/collector allocations per batch, same result.
(The lazy variant I had here earlier is reverted, as agreed in the F.view
thread.)
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +103,11 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+List rows = new ArrayList<>(mRows.size());
Review Comment:
Same on the read side: master's `rows()` is
`mRows.stream().map(GenericValueMessage::value).collect(toList())`, this is the
same thing as a loop into a pre-sized list.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664493489
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##
@@ -93,159 +60,69 @@ public class MessageSerializerGenerator {
private static final String COMPRESSED_MSG_ERROR = "CompressedMessage
should not be used explicitly. " +
"To compress the required field use the @Compress annotation.";
-/** Collection of lines for {@code writeTo} method. */
+/** */
private final List write = new ArrayList<>();
-/** Collection of lines for {@code readFrom} method. */
-private final List read = new ArrayList<>();
-
-/** Collection of message-specific imports. */
-private final Set imports = new TreeSet<>();
-
-/** Collection of Serializer class fields containing mappers for message
enum fields. */
-private final Set fields = new TreeSet<>();
-
/** */
-private final ProcessingEnvironment env;
-
-/** Stored type of the message being processed. */
-private TypeElement type;
-
-/** The marshallable message type. */
-private final TypeMirror marshallableMsgType;
+private final List read = new ArrayList<>();
-/** */
-private int indent;
+/** Class-field declarations (enum mappers/values, collection descriptors)
emitted at the top of the generated class. */
+private final Set clsFields = new TreeSet<>();
/** */
MessageSerializerGenerator(ProcessingEnvironment env) {
-this.env = env;
-
-marshallableMsgType =
env.getElementUtils().getTypeElement(MARSHALLABLE_MESSAGE_INTERFACE).asType();
+super(env);
}
-/** */
-void generate(TypeElement type, List fields) throws
Exception {
-assert this.type == null : "Message serializer generator isn't
stateless and is supposed to be single-use.";
-
-this.type = type;
+/** {@inheritDoc} */
+@Override String typeSuffix() {
+return "Serializer";
+}
+/** {@inheritDoc} */
+@Override void generateBody(List fields) throws Exception
{
generateMethods(fields);
+// Include superclass types in imports so generated code can cast to
them for inherited fields.
SystemViewRowAttributeWalkerProcessor.superclasses(env,
type).forEach(el -> imports.add(el.toString()));
-
-String serClsName = type.getSimpleName() + (marshallableMessage() ?
"Marshallable" : "") + "Serializer";
-String serFqnClsName = env.getElementUtils().getPackageOf(type) + "."
+ serClsName;
-String serCode = generateSerializerCode(serClsName);
-
-try {
-JavaFileObject file =
env.getFiler().createSourceFile(serFqnClsName);
-
-try (Writer writer = file.openWriter()) {
-writer.append(serCode);
-writer.flush();
-}
-}
-catch (FilerException e) {
-// IntelliJ IDEA parses Ignite's pom.xml and configures itself to
use this annotation processor on each Run.
-// During a Run, it invokes the processor and may fail when
attempting to generate sources that already exist.
-// There is no a setting to disable this invocation. The IntelliJ
community suggests a workaround — delegating
-// all Run commands to Maven. However, this significantly slows
down test startup time.
-// This hack checks whether the content of a generating file is
identical to already existed file, and skips
-// handling this class if it is.
-if (!identicalFileIsAlreadyGenerated(env, serCode, serFqnClsName))
{
-env.getMessager().printMessage(
-Diagnostic.Kind.ERROR,
-"MessageSerializer " + serClsName + " is already
generated. Try 'mvn clean install' to fix the issue.");
-
-throw e;
-}
-}
}
-/** Generates full code for a serializer class. */
-private String generateSerializerCode(String serClsName) throws
IOException {
-if (marshallableMessage()) {
-fields.add("private final Marshaller marshaller;");
-fields.add("private final ClassLoader clsLdr;");
-}
-
+/** {@inheritDoc} */
+@Override String buildClassCode(String serClsName) throws IOException {
try (Writer writer = new StringWriter()) {
-writeClassHeader(writer,
env.getElementUtils().getPackageOf(type).toString(), serClsName);
+imports.add(type.toString());
+
imports.add("org.apache.ignite.plugin.extensions.communication.MessageSerializer");
Review Comment:
Same sweep here — 15 constants for the Ignite types, JDK ones через
Class#getName() as this file already did for Throwable and Set.
--
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
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664492235
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageMarshallerGenerator.java:
##
@@ -0,0 +1,1180 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiFunction;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.QualifiedNameable;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.ArrayType;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.type.TypeVariable;
+import javax.lang.model.util.ElementFilter;
+import javax.tools.Diagnostic;
+import
org.apache.ignite.internal.systemview.SystemViewRowAttributeWalkerProcessor;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.internal.MessageProcessor.CACHE_OBJECT_CLS;
+import static org.apache.ignite.internal.MessageProcessor.KEY_CACHE_OBJECT_CLS;
+import static
org.apache.ignite.internal.MessageProcessor.MARSHALLABLE_MESSAGE_INTERFACE;
+import static org.apache.ignite.internal.MessageProcessor.MESSAGE_INTERFACE;
+import static
org.apache.ignite.internal.MessageProcessor.NON_MARSHALLABLE_MESSAGE_INTERFACE;
+
+/**
+ * Generates {@code *Marshaller} classes for {@code Message} types that are
not {@code NonMarshallableMessage}.
+ */
+public class MessageMarshallerGenerator extends MessageGenerator {
+/** Accumulated source lines for all generated marshal/unmarshal methods.
*/
+private final List marshall = new ArrayList<>();
+
+/** */
+private final TypeMirror marshallableMsgType;
+
+/** */
+private final TypeMirror msgType;
+
+/** */
+private final TypeMirror cacheObjType;
+
+/** */
+private final TypeMirror nonMarshallableType;
+
+/** */
+private final TypeMirror cacheGrpIdMsgType;
+
+/** */
+private final TypeMirror mapType;
+
+/** */
+private final TypeMirror colType;
+
+/** */
+private boolean marshallable;
+
+/** */
+private boolean hasMarshalled;
+
+/** Whether any generated method got a non-empty body; a marshaller
without one is skipped entirely. */
+private boolean hasStatements;
+
+/** Enclosed fields of the currently processed type. Computed once per
{@link #generateBody} call. */
+private Map enclosed;
+
+/** {@link MarshalledKind} of each {@code @Marshalled} enclosed field.
Computed once per {@link #generateBody} call. */
+private final Map kinds = new HashMap<>();
+
+/** Nesting depth of the current marshal for-loop; names loop variables
{@code e}, {@code e1}, {@code e2}… */
+private int loopDepth;
+
+/** Whether the currently generated method emitted a loop-nested facade
call and so needs the {@code msgFactory} local. */
+private boolean usesMsgFactory;
+
+/** */
+MessageMarshallerGenerator(ProcessingEnvironment env) {
+super(env);
+
+marshallableMsgType = type(MARSHALLABLE_MESSAGE_INTERFACE);
+msgType = type(MESSAGE_INTERFACE);
+cacheObjType = type(CACHE_OBJECT_CLS);
+nonMarshallableType = type(NON_MARSHALLABLE_MESSAGE_INTERFACE);
+cacheGrpIdMsgType =
type("org.apache.ignite.internal.processors.cache.GridCacheGroupIdMessage");
+mapType = type("java.util.Map");
+colType = type("java.util.Collection");
+}
+
+/** {@inheritDoc} */
+@Override String typeSuffix() {
+return "Marshaller";
+}
+
+/** {@inheritDoc} */
+@Override boolean shouldSkip(TypeElement type, List
fields) {
+return isNonMarshallableMessage(type);
+}
+
+/** {@inheritDoc} */
+@Override void generateBody(List
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5102507471 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5102440111 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664425507
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageGenerator.java:
##
@@ -0,0 +1,289 @@
+/*
+ * 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;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import javax.annotation.processing.FilerException;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.ElementFilter;
+import javax.lang.model.util.Elements;
+import javax.tools.Diagnostic;
+import javax.tools.FileObject;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardLocation;
+import
org.apache.ignite.internal.systemview.SystemViewRowAttributeWalkerProcessor;
+
+/**
+ * Base class for message code generators ({@link MessageSerializerGenerator},
{@link MessageMarshallerGenerator},
+ * {@link MessageDeploymentGenerator}).
+ */
+public abstract class MessageGenerator {
Review Comment:
Fair — renamed to `MessageCompanionGenerator`: what it produces are the
companion classes of a message (serializer, marshaller, deployer), not
messages. Its subclasses were already named after what each one emits, only the
base was ambiguous. The name never reaches the generated code (that carries
`@see MessageProcessor`), so no goldens changed.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3664372207 ## modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerOrderedPoisonMessageTest.java: ## @@ -0,0 +1,247 @@ +/* + * 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.managers.communication; + +import java.util.Map; +import java.util.Queue; +import java.util.UUID; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.CoreMessagesProvider; +import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.cache.CacheObjectContext; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.apache.ignite.plugin.AbstractTestPluginProvider; +import org.apache.ignite.plugin.ExtensionRegistry; +import org.apache.ignite.plugin.PluginContext; +import org.apache.ignite.plugin.extensions.communication.Message; +import org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider; +import org.apache.ignite.plugin.extensions.communication.MessageMarshaller; +import org.apache.ignite.plugin.extensions.communication.MessageReader; +import org.apache.ignite.plugin.extensions.communication.MessageSerializer; +import org.apache.ignite.plugin.extensions.communication.MessageWriter; +import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.ListeningTestLogger; +import org.apache.ignite.testframework.LogListener; +import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.jetbrains.annotations.Nullable; +import org.junit.Test; + +import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUBLIC_POOL; + +/** + * An ordered message whose payload fails to unmarshal must be skipped with an error logged, not abandon the rest of Review Comment: Right, "ordered" is overloaded here. Added to the class javadoc: messages sent via GridIoManager#sendOrderedMessage are delivered in the order of sending — the receiver accumulates them per topic in a GridCommunicationMessageSet and drains the set in one go (unwind) — and that has nothing to do with the @Order annotation of the direct protocol. The test is about that drain: a message that fails to unmarshal must not abandon the rest of the set. ## modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerOrderedPoisonMessageTest.java: ## @@ -0,0 +1,247 @@ +/* + * 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.managers.communication; + +import java.util.Map; +import java.util.Queue; +import java.util.UUID; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.internal.CoreMessagesProvider; +import org.apache.ignite.internal.GridKernalContext; +import org.apache.ignite.internal.IgniteEx; +import org.apache.ignite.internal.processors.cache.CacheObjectContext; +import
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664338027
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
+ * both. So whatever the cache-free pass does must stay correct when the
cache-aware pass runs it again.
+ *
+ * The distinction is the side effect. A plain {@code @Marshalled} field
unmarshals by assignment
+ * ({@code msg.x = ...}); assigning the same value twice is a no-op, so it is
idempotent and needs no guarding. A
+ * {@code @Marshalled} / {@code @Marshalled} field unmarshals by
mutation ({@code collection.add} /
Review Comment:
Then, fix it pls
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
+ * both. So whatever the cache-free pass does must stay correct when the
cache-aware pass runs it again.
+ *
+ * The distinction is the side effect. A plain {@code @Marshalled} field
unmarshals by assignment
+ * ({@code msg.x = ...}); assigning the same value twice is a no-op, so it is
idempotent and needs no guarding. A
+ * {@code @Marshalled} /
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3664319657
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
Review Comment:
Right, that link was stale — the class was renamed to
MessageUnmarshalOnceCheck. Fixed here and in the rule's `because(...)` message.
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
+ * both. So whatever the cache-free pass does must stay correct when the
cache-aware pass runs it again.
+ *
+ * The distinction is the side effect. A plain {@code @Marshalled} field
unmarshals by assignment
+ * ({@code msg.x = ...}); assigning the same value twice is a no-op, so it is
idempotent and needs no guarding. A
+ * {@code @Marshalled} / {@code @Marshalled} field unmarshals by
mutation ({@code collection.add} /
Review Comment:
Copy-paste left over from merging the @Marshalled* annotations into one:
both halves ended up the same. The sentence now just says "a collection or map
field", which is the actual distinction.
##
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3664295618 ## modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageSerializationArchitectureTest.java: ## @@ -0,0 +1,149 @@ +/* + * 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.codegen; + +import com.tngtech.archunit.base.DescribedPredicate; +import com.tngtech.archunit.core.domain.JavaClasses; +import com.tngtech.archunit.core.domain.JavaMethodCall; +import com.tngtech.archunit.core.domain.JavaModifier; Review Comment: The three rules pin the central invariant of this change: nobody outside the generated companions and the static facades may call `MessageSerializer.writeTo/readFrom`, `MessageMarshaller.marshal/unmarshal` or `GridCacheMessageDeployer.deploy` directly. That is not a stylistic wish — a direct call bypasses the dispatcher and, for the marshalling side, silently moves payload (de)serialization back onto the NIO thread and around the marshal-once contract. The rules have already earned their keep on this branch: every master merge that touched `GridNioServer` or the Calcite tests brought back a direct `msgSer.writeTo(...)` call, and the test caught it locally instead of in a suite run. There is no design-level way to enforce it with the compiler: `MessageSerializer` is a public SPI, its implementations are generated into other packages, and `factory.serializer(...)` is called from `GridNioServerWrapper` (core) and `MessageSerialization` (nio), so the instance methods cannot be package-private or hidden. Writing it without the library means bytecode analysis by hand (reflection cannot see call sites) — a home-grown ArchUnit of a couple hundred lines to maintain. The dependency is `test`-scoped and never ships; `modules/core/pom.xml` already carries `com.google.testing.compile` for exactly the same reason — a test-only library for one narrow check, and that one comes from master. If "no new dependencies" is the priority, I'd rather file a follow-up to rewrite these three rules without the library than drop the check — losing it means the next such regression lands in master unnoticed. WDYT? ## modules/core/pom.xml: ## @@ -243,6 +243,13 @@ test + +com.tngtech.archunit +archunit-junit4 Review Comment: Same topic as the thread in MessageSerializationArchitectureTest — answered there. Short version: it is `test`-scoped, it guards the invariant that everything goes through the static dispatchers (a direct instance call silently returns payload (de)serialization to the NIO thread), and it has already caught that regression on every master merge that touched GridNioServer. `modules/core/pom.xml` already has `com.google.testing.compile` as a test-only library for a similarly narrow check. Happy to file a follow-up to reimplement the rules without ArchUnit if you prefer, but I would not drop the check itself. ## modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageSerializationArchitectureTest.java: ## @@ -0,0 +1,149 @@ +/* + * 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.codegen; + +import com.tngtech.archunit.base.DescribedPredicate; +import com.tngtech.archunit.core.domain.JavaClasses; +import
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3658381032
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MessageSerializationArchitectureTest.java:
##
@@ -0,0 +1,149 @@
+/*
+ * 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.codegen;
+
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.domain.JavaModifier;
+import com.tngtech.archunit.core.domain.properties.HasOwner;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.managers.communication.MessageMarshalling;
+import org.apache.ignite.internal.processors.cache.GridCacheMessageDeployer;
+import org.apache.ignite.internal.util.nio.MessageSerialization;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.apache.ignite.plugin.extensions.communication.MessageSerializer;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.core.domain.JavaCall.Predicates.target;
+import static
com.tngtech.archunit.core.domain.JavaClass.Predicates.assignableTo;
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * Verifies that instance methods of {@link MessageSerializer}, {@link
MessageMarshaller} and
+ * {@link GridCacheMessageDeployer} are only called from classes that
implement these interfaces (i.e. generated
+ * serializers/marshallers/deployers and their hand-written wrappers). All
other code must use the static
+ * convenience methods:
+ *
+ * {@link MessageSerialization#writeTo}
+ * {@link MessageSerialization#readFrom}
+ * {@link MessageMarshalling#marshal}
+ * {@code MessageMarshalling.unmarshal}
+ * static {@code GridCacheMessageDeployer.deploy(factory, msg,
ctx)}
+ *
+ *
+ * The rules key on whether the called method is {@code static}, not on its
name — so any instance method added
+ * to these interfaces is covered automatically.
+ */
+public class MessageSerializationArchitectureTest {
+/** Matches method calls that resolve to a non-static (instance) method. */
+private static final DescribedPredicate TO_INSTANCE_METHOD
=
+new DescribedPredicate<>("to instance method") {
+@Override public boolean test(JavaMethodCall call) {
+return call.getTarget().resolveMember()
+.map(m -> !m.getModifiers().contains(JavaModifier.STATIC))
+.orElse(false);
+}
+};
+
+/** Classes under analysis: all production + test sources on the
classpath, excluding JARs. */
+private static JavaClasses classes;
+
+/** */
+@BeforeClass
+public static void importClasses() {
+classes = new ClassFileImporter()
+.withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_JARS)
+.importPackages("org.apache.ignite");
+}
+
+/**
+ * Instance methods of {@link MessageSerializer} ({@code writeTo}, {@code
readFrom}) must only be
+ * called from within classes that themselves implement {@link
MessageSerializer} — i.e. generated
+ * serializers and hand-written wrappers that delegate to the underlying
serializer — or the
+ * {@link MessageSerialization} dispatcher that resolves and calls them.
+ *
+ * Everyone else must use the static {@link MessageSerialization} entry
points.
+ */
+@Test
+public void serializerInstanceMethodsOnlyCalledFromImplementations() {
+ArchRule rule = noClasses()
+.that()
+// Exclude MessageSerializer implementations (generated +
wrappers) and the dispatch facade.
+.areNotAssignableTo(MessageSerializer.class)
+.and().areNotAssignableTo(MessageSerialization.class)
+.should()
+.callMethodWhere(TO_INSTANCE_METHOD
+
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3659417187
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -61,7 +62,10 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.batchId = batchId;
this.last = last;
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+mRows = new ArrayList<>(rows.size());
Review Comment:
Why changed?
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +103,11 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+List rows = new ArrayList<>(mRows.size());
Review Comment:
Same
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3660084124
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageDeploymentGenerator.java:
##
@@ -0,0 +1,247 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.type.WildcardType;
+import org.jetbrains.annotations.Nullable;
+
+import static org.apache.ignite.internal.MessageProcessor.CACHE_OBJECT_CLS;
+
+/**
+ * Generates a {@code *Deployer} class for messages whose {@code @Order}
fields have a type that indicates deployment
+ * need: {@code CacheObject} subtypes, {@code Collection}, {@code Iterable}, or a
+ * nested {@code GridCacheMessage} (whose deployment is delegated). The
strategy is inferred entirely from the field type.
+ *
+ * A message with deployment logic that cannot be inferred from field types
implements {@code DeployableMessage};
+ * the generated deployer then also delegates to its {@code deploy}, mirroring
{@code marshal}.
+ */
+public class MessageDeploymentGenerator extends MessageGenerator {
+/** */
+private final TypeMirror gridCacheMsgType;
+
+/** */
+private final TypeMirror deployableMsgType;
+
+/** */
+private final TypeMirror cacheObjType;
+
+/** */
+private final TypeMirror txEntryType;
+
+/** */
+private final TypeMirror colType;
+
+/** */
+private final TypeMirror iterableType;
+
+/** Accumulated source lines for the generated {@code
GridCacheMessageDeployer#deploy} implementation. */
+private final List deploy = new ArrayList<>();
+
+/** */
+private boolean needsCctx;
+
+/** */
+MessageDeploymentGenerator(ProcessingEnvironment env) {
+super(env);
+
+gridCacheMsgType =
type("org.apache.ignite.internal.processors.cache.GridCacheMessage");
Review Comment:
In `MessageProcessor` we use constants.
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##
@@ -93,159 +60,69 @@ public class MessageSerializerGenerator {
private static final String COMPRESSED_MSG_ERROR = "CompressedMessage
should not be used explicitly. " +
"To compress the required field use the @Compress annotation.";
-/** Collection of lines for {@code writeTo} method. */
+/** */
private final List write = new ArrayList<>();
-/** Collection of lines for {@code readFrom} method. */
-private final List read = new ArrayList<>();
-
-/** Collection of message-specific imports. */
-private final Set imports = new TreeSet<>();
-
-/** Collection of Serializer class fields containing mappers for message
enum fields. */
-private final Set fields = new TreeSet<>();
-
/** */
-private final ProcessingEnvironment env;
-
-/** Stored type of the message being processed. */
-private TypeElement type;
-
-/** The marshallable message type. */
-private final TypeMirror marshallableMsgType;
+private final List read = new ArrayList<>();
-/** */
-private int indent;
+/** Class-field declarations (enum mappers/values, collection descriptors)
emitted at the top of the generated class. */
+private final Set clsFields = new TreeSet<>();
/** */
MessageSerializerGenerator(ProcessingEnvironment env) {
-this.env = env;
-
-marshallableMsgType =
env.getElementUtils().getTypeElement(MARSHALLABLE_MESSAGE_INTERFACE).asType();
+super(env);
}
-/** */
-void generate(TypeElement type, List fields) throws
Exception {
-assert this.type == null : "Message serializer generator isn't
stateless and is supposed to be single-use.";
-
-this.type = type;
+/** {@inheritDoc} */
+
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3659381754
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -61,7 +62,10 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.batchId = batchId;
this.last = last;
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+mRows = new ArrayList<>(rows.size());
Review Comment:
Why changed?
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +103,11 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+List rows = new ArrayList<>(mRows.size());
Review Comment:
Same
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -61,7 +62,10 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.batchId = batchId;
this.last = last;
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+mRows = new ArrayList<>(rows.size());
Review Comment:
Why changed?
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +103,11 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+List rows = new ArrayList<>(mRows.size());
Review Comment:
Same
##
modules/codegen/src/main/java/org/apache/ignite/internal/MessageGenerator.java:
##
@@ -0,0 +1,289 @@
+/*
+ * 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;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import javax.annotation.processing.FilerException;
+import javax.annotation.processing.ProcessingEnvironment;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.ElementFilter;
+import javax.lang.model.util.Elements;
+import javax.tools.Diagnostic;
+import javax.tools.FileObject;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardLocation;
+import
org.apache.ignite.internal.systemview.SystemViewRowAttributeWalkerProcessor;
+
+/**
+ * Base class for message code generators ({@link MessageSerializerGenerator},
{@link MessageMarshallerGenerator},
+ * {@link MessageDeploymentGenerator}).
+ */
+public abstract class MessageGenerator {
Review Comment:
Sounds like something that generates messages. By a template maybe.
Actually, it produses various message processors like Deployer or Serializatior.
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRecreateEvictionTest.java:
##
@@ -0,0 +1,136 @@
+/*
+ * 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
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3657743349
##
modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/GridNioServerWrapper.java:
##
@@ -834,18 +851,18 @@ private MessageFactory get() {
};
GridNioMessageReaderFactory readerFactory = new
GridNioMessageReaderFactory() {
-private IgniteSpiContext context;
+private IgniteSpiContext spiCtx;
private MessageFormatter formatter;
-@Override public MessageReader reader(GridNioSession ses,
MessageFactory msgFactory)
+@Override public MessageReader reader(GridNioSession ses,
MessageFactory msgFactory)
throws IgniteCheckedException {
final IgniteSpiContext ctx =
stateProvider.getSpiContextWithoutInitialLatch();
-if (formatter == null || context != ctx) {
-context = ctx;
+if (formatter == null || this.spiCtx != ctx) {
Review Comment:
No need of `this`. Below too.
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##
@@ -460,6 +461,9 @@ public void resetMetrics() {
msg.getClass().getName() + ". Most likely
GridCommunicationSpi is being used directly, " +
"which is illegal - make sure to send messages
only via GridProjection API.");
}
+catch (IgniteCheckedException e) {
Review Comment:
Why changed?
##
modules/core/pom.xml:
##
@@ -243,6 +243,13 @@
test
+
+com.tngtech.archunit
+archunit-junit4
Review Comment:
It is used only in one or a couple tests. Can we rewrite these test so that
they would not use this additional library?
##
modules/core/src/test/java/org/apache/ignite/internal/codegen/MarshallerCacheFreeUnmarshalTest.java:
##
@@ -0,0 +1,110 @@
+/*
+ * 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.codegen;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import com.tngtech.archunit.base.DescribedPredicate;
+import com.tngtech.archunit.core.domain.JavaClass;
+import com.tngtech.archunit.core.domain.JavaClasses;
+import com.tngtech.archunit.core.domain.JavaCodeUnit;
+import com.tngtech.archunit.core.domain.JavaMethodCall;
+import com.tngtech.archunit.core.importer.ClassFileImporter;
+import com.tngtech.archunit.core.importer.ImportOption;
+import com.tngtech.archunit.lang.ArchRule;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
+
+/**
+ * A message is finish-unmarshalled in two passes — cache-free (via {@code
GridIoManager}) and cache-aware (via a
+ * subsystem) — and the mode-aware no-double-unmarshal check ({@link
MessageMarshaller.Dedup}) deliberately allows
Review Comment:
There is not `MessageMarshaller.Dedup`
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java:
##
@@ -140,6 +145,16 @@ public boolean skipOnTimeout() {
return skipOnTimeout;
}
+/** Marks this message as marshalled. */
+void markMarshalled() {
+marshalled = true;
+}
+
+/** @return {@code true} if this message has been marshalled. */
+boolean marshalled() {
Review Comment:
Is used only with asserts. Let's remove. We have the double0marshalling
check mechanics
##
modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java:
##
@@ -18,78 +18,175 @@
package org.apache.ignite.internal.plugin;
import java.lang.reflect.Constructor;
+import java.util.function.Supplier;
import org.apache.ignite.IgniteException;
-import
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5094255348 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9232278](https://ci2.ignite.apache.org/build/9232278) · 147 suites ran, 0 reused ✅ **No blockers** — nothing in this run looks caused by this PR. 28 pre-existing/flaky tests filtered out. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5093871039 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3658466235
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
Review Comment:
This is master's own shape, only re-typed. On master the class already
carries the same field pairs and the same guard — `KeyCacheObject key` plus
`@Order byte[] keyBytes`, with prepareMarshal(Marshaller) filling the
companions only `if (!isFiltered())`. What the PR changes is the wire type of
the companion: a marshaller blob becomes the typed KeyCacheObject/CacheObject
written directly by the generated serializer, which also removes the extra
round-trip through BinaryMarshaller.
The pair exists because the generated serializer writes @Order fields
unconditionally — there is no per-field conditional or converter facility in
the codegen — while the wire contract is that a filtered entry carries no
key/values and the local instance must keep them (an entry is marked filtered
after it was created with data, and consumers still read it afterwards, e.g.
CacheQueryReadEvent).
Agreed on the separate ticket: IGNITE-28922, with a TODO left on the hooks.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
+if (!isFiltered()) {
+keyWire = key;
+newValWire = newVal;
+oldValWire = oldVal;
+}
}
/** {@inheritDoc} */
-@Override public void prepareMarshal(Marshaller marsh) throws
IgniteCheckedException {
-if (!isFiltered()) {
-if (key != null)
-keyBytes = marsh.marshal(key);
+@Override public void unmarshal(Marshaller marsh, ClassLoader clsLdr)
throws IgniteCheckedException {
Review Comment:
Same contract, the unmarshal half — see the thread above. The wire -> local
move is what master's finishUnmarshal does as well (`key =
marsh.unmarshal(keyBytes, clsLdr)`): every consumer of the entry reads the
local fields, not the @Order ones. The null guard keeps the hook idempotent, so
a filtered entry stays without key/values — which is what
IgniteCacheContinuousQueryImmutableEntryTest asserts. Follow-up ticket:
IGNITE-28922.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3658464393
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -1184,7 +1198,29 @@ private void processDhtTxPrepareRequest(final UUID
nodeId, final GridDhtTxPrepar
if (nearTx != null)
res.nearEvicted(nearTx.evicted());
-List writesCacheMissed = req.nearWritesCacheMissed();
+List writesCacheMissed = new ArrayList<>();
Review Comment:
Two things there were mine and both are now gone. `e.initializeContext(ctx,
req.topologyVersion(), true)` was dead: the line above it does
`e.context(cacheCtx)`, and initializeContext starts with `if (this.ctx ==
null)`, so it was a guaranteed no-op — the real initialization of near entries
happens in GridNearTxRemote.addEntries, which also handles the destroyed-cache
case. And `writesCacheMissed != null` was always true here, since the list is
now built locally instead of coming from req.nearWritesCacheMissed() (which
master allowed to be null): that made an empty nearEvicted collection travel
back on every prepare response. It is `!writesCacheMissed.isEmpty()` now, i.e.
master's behaviour.
The loop itself moved here from GridDhtTxPrepareRequest#finishUnmarshal,
where master bound the entry contexts during unmarshalling; with codegen
serialization the binding belongs to the handler. The extra
topologyVersion().before(startTopologyVersion()) condition is the recreate fix
covered by GridNearTxRecreateEvictionTest.
##
modules/core/src/test/java/org/apache/ignite/plugin/extensions/communication/MessageMarshalOnceTest.java:
##
@@ -0,0 +1,256 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.CoreMessagesProvider;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.GridTopic;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.managers.communication.GridIoPolicy;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.plugin.AbstractTestPluginProvider;
+import org.apache.ignite.plugin.ExtensionRegistry;
+import org.apache.ignite.plugin.PluginContext;
+import org.apache.ignite.spi.IgniteSpiException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/**
+ * Verifies the marshal-once-before-fan-out contract of the collection {@code
send}: a message broadcast to N remote
+ * nodes is marshalled exactly once (prepared before the fan-out and
reused for every destination), not once per
+ * destination. A counting marshaller is registered for a test message;
broadcasting it to {@link #RMT_CNT} remote nodes
+ * must produce {@code RMT_CNT} sends but a single {@code marshal}. Counting
the sends keeps the check honest (a
+ * lone send would also marshal once). The unmarshal-once counterpart lives in
{@link MessageUnmarshalOnceTest}.
+ *
+ * The second scenario covers the send-retry path: a cache message whose
first send attempt fails is retried,
+ * and the retry must not re-marshal the payload (it is prepared once by
{@code GridCacheIoManager} before the
+ * retry loop, while {@code GridIoManager} marshals only the wrapper).
+ */
+public class MessageMarshalOnceTest extends GridCommonAbstractTest {
Review Comment:
They test different things with
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5092955606 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3658260020
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -60,8 +66,7 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.exchangeId = exchangeId;
this.batchId = batchId;
this.last = last;
-
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+this.rows = rows;
Review Comment:
Agreed on both points — reverted the constructor: the conversion runs on the
caller thread, not on a NIO one, so making it lazy bought little and cost API
surface. QueryBatchMessage is no longer a MarshallableMessage either (the
marshal/unmarshal hooks are gone), so it now differs from master only by
implementing DeferredUnmarshalMessage; the `loc` flag and the
MessageService.localNodeId() addition it required are gone as well. F.view
stays out for the reason you name: mRows is iterated twice on the send path
(the generated marshaller fills each wrapper's bytes, then the serializer
writes the collection), so a lazy view would hand fresh, unmarshalled wrappers
to the second pass.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java:
##
@@ -18,13 +18,13 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
/**
*
*/
-public class QueryCloseMessage implements Message {
+public class QueryCloseMessage implements DeferredUnmarshalMessage {
Review Comment:
Fair — reduced. The marker is now only on the four messages that actually
carry a marshalled payload (QueryStartRequest, QueryBatchMessage,
QueryStartResponse, CalciteErrorMessage) — exactly the ones a marshaller is
generated for. QueryCloseMessage, QueryInboxCloseMessage and
QueryBatchAcknowledgeMessage no longer implement it: for them the generic pass
resolves no marshaller and returns, so it is a no-op either way. The
receive-side ownership filter went back to
CalciteMessageFactory.isCalciteMessage (the direct-type range, as on master),
so the marker no longer doubles as the topic filter.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5092703193 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r365745
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
Review Comment:
Looks as a thrick, should be refactored.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3657210095
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
+if (!isFiltered()) {
+keyWire = key;
+newValWire = newVal;
+oldValWire = oldVal;
+}
}
/** {@inheritDoc} */
-@Override public void prepareMarshal(Marshaller marsh) throws
IgniteCheckedException {
-if (!isFiltered()) {
-if (key != null)
-keyBytes = marsh.marshal(key);
+@Override public void unmarshal(Marshaller marsh, ClassLoader clsLdr)
throws IgniteCheckedException {
Review Comment:
Should be refactored, may be i a separate ticket.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3657196765
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRecreateEvictionTest.java:
##
@@ -0,0 +1,136 @@
+/*
+ * 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.processors.cache.distributed.near;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+
+/**
+ * Checks that a near-write {@link GridDhtTxPrepareRequest} targeting a cache
incarnation older than the receiver's
+ * current one is answered with the key in {@code nearEvicted}, so the reader
is dropped instead of keeping a stale
+ * near entry.
+ */
+public class GridNearTxRecreateEvictionTest extends GridCommonAbstractTest {
Review Comment:
Which classes also are fixed in order to resolve this problem?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3657196765
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRecreateEvictionTest.java:
##
@@ -0,0 +1,136 @@
+/*
+ * 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.processors.cache.distributed.near;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+
+/**
+ * Checks that a near-write {@link GridDhtTxPrepareRequest} targeting a cache
incarnation older than the receiver's
+ * current one is answered with the key in {@code nearEvicted}, so the reader
is dropped instead of keeping a stale
+ * near entry.
+ */
+public class GridNearTxRecreateEvictionTest extends GridCommonAbstractTest {
Review Comment:
Which classes also are fixed in order to resolve this problem?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3656497810
##
modules/core/src/test/java/org/apache/ignite/plugin/extensions/communication/MessageMarshalOnceTest.java:
##
@@ -0,0 +1,256 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.CoreMessagesProvider;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.GridTopic;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import org.apache.ignite.internal.managers.communication.GridIoMessage;
+import org.apache.ignite.internal.managers.communication.GridIoPolicy;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.GridCacheMessage;
+import org.apache.ignite.lang.IgniteInClosure;
+import org.apache.ignite.plugin.AbstractTestPluginProvider;
+import org.apache.ignite.plugin.ExtensionRegistry;
+import org.apache.ignite.plugin.PluginContext;
+import org.apache.ignite.spi.IgniteSpiException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/**
+ * Verifies the marshal-once-before-fan-out contract of the collection {@code
send}: a message broadcast to N remote
+ * nodes is marshalled exactly once (prepared before the fan-out and
reused for every destination), not once per
+ * destination. A counting marshaller is registered for a test message;
broadcasting it to {@link #RMT_CNT} remote nodes
+ * must produce {@code RMT_CNT} sends but a single {@code marshal}. Counting
the sends keeps the check honest (a
+ * lone send would also marshal once). The unmarshal-once counterpart lives in
{@link MessageUnmarshalOnceTest}.
+ *
+ * The second scenario covers the send-retry path: a cache message whose
first send attempt fails is retried,
+ * and the retry must not re-marshal the payload (it is prepared once by
{@code GridCacheIoManager} before the
+ * retry loop, while {@code GridIoManager} marshals only the wrapper).
+ */
+public class MessageMarshalOnceTest extends GridCommonAbstractTest {
Review Comment:
Join with `MessageUnmarshalOnceTest`?
##
modules/core/src/test/java/org/apache/ignite/plugin/extensions/communication/MessageMarshalOnceTest.java:
##
@@ -0,0 +1,256 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.CoreMessagesProvider;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.GridTopic;
+import
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5090279198 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9229249](https://ci2.ignite.apache.org/build/9229249) · 16 suites ran, 131 reused ✅ **No blockers** — nothing in this run looks caused by this PR. 12 pre-existing/flaky tests filtered out. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5079190184 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9228469](https://ci2.ignite.apache.org/build/9228469) · 147 suites ran, 0 reused ✅ **No blockers** — nothing in this run looks caused by this PR. 21 pre-existing/flaky tests filtered out. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5078876712 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5078875044 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5078374923 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9228148](https://ci2.ignite.apache.org/build/9228148) · 147 suites ran, 0 reused ⚠️ **1 broken suite(s)** (no reliable run): - Open Census: Number of tests 3 is 96% less than 82 in build #16620 ❌ **5 blocker(s) in 1 suite(s):** - Cache (Expiry Policy): `org.apache.ignite.internal.processors.cache.expiry.IgniteCacheExpiryPolicyTestSuite: org.apache.ignite.internal.processors.cache.IgniteCacheExpireAndUpdateConsistencyTest.testTx2` - Cache (Expiry Policy): `org.apache.ignite.internal.processors.cache.expiry.IgniteCacheExpiryPolicyTestSuite: org.apache.ignite.internal.processors.cache.IgniteCacheExpireAndUpdateConsistencyTest.testTx3` - Cache (Expiry Policy): `org.apache.ignite.internal.processors.cache.expiry.IgniteCacheExpiryPolicyTestSuite: org.apache.ignite.internal.processors.cache.IgniteCacheExpireAndUpdateConsistencyTest.testAtomic1` - Cache (Expiry Policy): `org.apache.ignite.internal.processors.cache.expiry.IgniteCacheExpiryPolicyTestSuite: org.apache.ignite.internal.processors.cache.IgniteCacheExpireAndUpdateConsistencyTest.testAtomic2` - Cache (Expiry Policy): `org.apache.ignite.internal.processors.cache.expiry.IgniteCacheExpiryPolicyTestSuite: org.apache.ignite.internal.processors.cache.IgniteCacheExpireAndUpdateConsistencyTest.testAtomic3` ⏳ _Auto re-run **#1** in progress — 1 blocker + 1 broken suite(s) re-queued (attempt 1/2), **≈ settled by 15:16 MSK**. This comment updates when they settle._ -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5077837610 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5077837431 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5077637932 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649857392
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java:
##
@@ -201,26 +191,8 @@ public int marshalledSize(CacheObjectContext ctx) throws
IgniteCheckedException
return SIZE_OVERHEAD + size;
}
-/**
- * @param ctx Cache context.
- * @throws IgniteCheckedException In case of error.
- */
-public void marshal(GridCacheContext ctx) throws IgniteCheckedException {
-marshal(ctx.cacheObjectContext());
-}
-
-/**
- * @param ctx Cache context.
- * @throws IgniteCheckedException In case of error.
- */
-public void marshal(CacheObjectContext ctx) throws IgniteCheckedException {
-assert key != null;
-
-key.prepareMarshal(ctx);
-
-if (val != null)
-val.prepareMarshal(ctx);
-
+/** {@inheritDoc} */
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
Review Comment:
Filed: https://issues.apache.org/jira/browse/IGNITE-28920
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649849133
##
modules/core/src/test/resources/codegen/NioFieldOnNonMessageMessage.java:
##
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+import org.apache.ignite.plugin.extensions.communication.Message;
+
+public class NioFieldOnNonMessageMessage implements Message {
Review Comment:
The name mirrors the asserted diagnostic: the test checks the "@NioField has
no effect on non-Message field" error, i.e. @NioField placed on a field whose
type is not a Message. "NioFieldOnFieldMessage" would drop exactly that
discriminator — every @NioField sits on a field. It also lines up with the
sibling negative resources (CustomEnumMapperOnPrimitiveFieldMessage,
CustomEnumMapperOnArrayFieldMessage, NioFieldNeedsCtxMessage). If the double
"MessageMessage" reads awkwardly, NioFieldOnNonMessageFieldMessage would be the
convention-matching alternative.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java:
##
@@ -18,11 +18,12 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.communication.ErrorMessage;
/** */
-public class CalciteErrorMessage extends ErrorMessage {
+public class CalciteErrorMessage extends ErrorMessage implements
DeferredUnmarshalMessage {
Review Comment:
All Calcite messages implement DeferredUnmarshalMessage deliberately — the
marker does two jobs:
1. Keeps payload deserialization off NIO threads. Calcite messages travel on
TOPIC_QUERY with GridIoPolicy.CALLER_THREAD, which maps to SameThreadExecutor,
so the generic inbound pass (GridIoManager.processRegularMessage0 ->
unmarshalPayload) would run right on the NIO reader. For messages with real
payload — QueryStartRequest parameters, QueryBatchMessage rows, the Throwable
inside CalciteErrorMessage/QueryStartResponse — that would deserialize user
objects on a NIO thread, the very thing the pre-patch
CalciteContextMarshallableMessage existed to prevent.
CalciteMessageUnmarshalThreadIntegrationTest guards exactly this.
2. Serves as the ownership filter on the shared topic. TOPIC_QUERY is also
listened to by IgniteH2Indexing and RunningQueryManager;
MessageServiceImpl.onMessage accepts a message only if it is instanceof
DeferredUnmarshalMessage (previously: CalciteMessageFactory.isCalciteMessage).
Drop the marker from any Calcite message and the listener silently ignores it.
For the payload-free ones (e.g. QueryCloseMessage) the deferred unmarshal is
a no-op — no marshaller is generated for them, so the dispatch resolves nothing
and returns. The marker costs nothing there while keeping the invariant the
listener filter relies on.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java:
##
@@ -18,13 +18,13 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
/**
*
*/
-public class QueryCloseMessage implements Message {
+public class QueryCloseMessage implements DeferredUnmarshalMessage {
Review Comment:
Not unnecessary: besides deferring payload deserialization off the NIO
thread (CALLER_THREAD policy = SameThreadExecutor), the marker is what
MessageServiceImpl.onMessage uses to pick Calcite messages out of the shared
TOPIC_QUERY (H2 and RunningQueryManager listen there too). Without it the
message is silently dropped. Full details in the CalciteErrorMessage thread.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -17,13 +17,16 @@
package
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649848845
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -58,25 +58,25 @@ public class CacheContinuousQueryEntry implements
GridCacheDeployable, Marshalla
@GridToStringInclude
KeyCacheObject key;
-/** */
+/** {@code null} for a filtered entry. */
@Order(2)
-byte[] keyBytes;
+KeyCacheObject keyWire;
/** New value. */
@GridToStringInclude
CacheObject newVal;
-/** */
+/** {@code null} for a filtered entry. */
@Order(3)
-byte[] newValBytes;
+CacheObject newValWire;
/** Old value. */
@GridToStringInclude
CacheObject oldVal;
-/** */
+/** {@code null} for a filtered entry. */
@Order(4)
-byte[] oldValBytes;
+CacheObject oldValWire;
Review Comment:
Same as the thread at line 63: the master's local/wire pair (key +
keyBytes), only with a typed wire form.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
Review Comment:
These are the MarshallableMessage hooks; the contract is "populate the wire
form before send / restore the runtime form after receive", not necessarily
byte serialization. Other implementors do the same: QueryBatchMessage.marshal()
only wraps rows into mRows message objects, and GridDhtPartitionsFullMessage's
hook only does locParts = copyPartitionsMap(parts) — on master that same body
now lives in prepareMarshal(GridCacheSharedContext) after IGNITE-28914, still
with no serialization in it. On master this entry's hook produced byte[] only
because the wire form was a marshaller blob; with typed wire fields the step
degenerates to a reference transfer, but it is the same contract. Unlike
GridDhtPartitionsFullMessage this entry is not a GridCacheMessage, so there is
no cache-level hook to move this to.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
+if (!isFiltered()) {
+keyWire = key;
+newValWire = newVal;
+oldValWire = oldVal;
+}
}
/** {@inheritDoc} */
-@Override public void prepareMarshal(Marshaller marsh) throws
IgniteCheckedException {
-if (!isFiltered()) {
-if (key != null)
-keyBytes = marsh.marshal(key);
+@Override public void unmarshal(Marshaller marsh, ClassLoader clsLdr)
throws IgniteCheckedException {
Review Comment:
Same as above — the unmarshal side of the same wire-prepare contract.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java:
##
@@ -207,6 +208,19 @@ private void processRequest(final UUID nodeId, final
DataStreamerRequest req) {
}
}
+// The generic receive pass skips this request (entries must stay
serialized for the update job and its
+// peer-deployment loader), so the response topic is restored
here; it carries only internal classes.
+try {
+if (req.resTopicMsg != null)
+MessageMarshalling.unmarshal(req.resTopicMsg, ctx);
Review Comment:
DataStreamerRequest is a DeferredUnmarshalMessage: the generic inbound pass
deliberately skips it (GridIoManager.unmarshalPayload), because the entries
must stay serialized until DataStreamerUpdateJob unmarshals them with the
peer-deployment loader. The flip side of that contract is that the consumer
itself unmarshals what it needs, and the response topic is needed before the
job is ever submitted — it is how deployment and updater-unmarshal failures are
reported back to the sender, cases where the job never runs. This is not
hand-rolled marshalling: MessageMarshalling.unmarshal(req.resTopicMsg, ctx) is
exactly the registered-marshaller dispatch the generic pass would have applied,
just scoped to the one nested message needed early. The alternatives look
worse: unmarshalling the whole request here defeats the deferred contract, and
turning resTopicMsg into a @NioField would move its deserialization onto NIO
threads.
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649848406
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java:
##
@@ -315,83 +305,18 @@ public boolean skipCompletedVersion() {
return txLbl;
}
-/**
- * {@inheritDoc}
- *
- * @param ctx
- */
-@Override public void prepareMarshal(GridCacheSharedContext ctx)
throws IgniteCheckedException {
-super.prepareMarshal(ctx);
-
+/** {@inheritDoc} */
+@Override public void deploy(GridCacheSharedContext ctx) throws
IgniteCheckedException {
if (owned != null && ownedKeys == null) {
-ownedKeys = owned.keySet();
-
-ownedVals = owned.values();
-
-for (IgniteTxKey key: ownedKeys) {
+for (IgniteTxKey key : owned.keySet()) {
GridCacheContext cctx = ctx.cacheContext(key.cacheId());
-key.prepareMarshal(cctx);
-
if (addDepInfo)
-prepareObject(key, cctx);
+deployObject(key, cctx);
Review Comment:
It actually is driven by the generated deployer:
GridDhtTxPrepareRequestDeployer deploys the type-inferable fields
(reads/writes/nearWrites via deployTx) and then delegates to this deploy(),
exactly like generated marshallers delegate the non-inferable part to
MarshallableMessage#marshal. The generator infers deployment from the field
type only (CacheObject, Collection of CacheObjects, Iterable,
nested message). Here the target is the keys of Map, each resolved against its own cache via key.cacheId() (the
tx may span several caches, so there is no single msg.cacheId()) and guarded by
addDepInfo — none of that is derivable from the type, which is what the
DeployableMessage hook exists for. The body mirrors master's prepareMarshal
one-to-one.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java:
##
@@ -124,24 +125,14 @@ public Collection preloadEntries() {
}
/** {@inheritDoc} */
-@Override public void prepareMarshal(GridCacheSharedContext ctx)
throws IgniteCheckedException {
-super.prepareMarshal(ctx);
+@Override public void deploy(GridCacheSharedContext ctx) throws
IgniteCheckedException {
+if (preloadEntries != null) {
+GridCacheContext cctx = ctx.cacheContext(cacheId);
-GridCacheContext cctx = ctx.cacheContext(cacheId);
-
-if (preloadEntries != null)
-marshalInfos(preloadEntries, cctx.shared(),
cctx.cacheObjectContext());
-}
-
-/** {@inheritDoc} */
-@Override public void finishUnmarshal(GridCacheSharedContext ctx,
ClassLoader ldr) throws IgniteCheckedException {
-super.finishUnmarshal(ctx, ldr);
-
-if (preloadEntries != null)
-unmarshalInfos(preloadEntries, ctx.cacheContext(cacheId), ldr);
+deployInfos(preloadEntries, cctx);
Review Comment:
Same pattern as in GridDhtTxPrepareRequest: the generated
GridDhtLockResponseDeployer deploys the inferable field (vals) and then
delegates to this deploy(). preloadEntries is a Collection,
and GridCacheEntryInfo is not a CacheObject — deploying it means unwrapping and
registering the key and value user objects of each info (deployInfos), which
cannot be inferred from the field type. This is the only message in the
codebase that deploys entry infos, so it stays behind the DeployableMessage
hook rather than a dedicated one-off generator strategy.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java:
##
@@ -1033,9 +1033,6 @@ private void map(Iterable entries) {
}
assert added.dhtLocal();
-
-if (added.ownerVersion() != null)
Review Comment:
This populated GridDhtLockRequest#owned, which was dead on the receiving
side: the only reader of owned() in master is
IgniteTxHandler#startNearRemoteTx, and it takes a GridDhtTxPrepareRequest
(populated in GridDhtTxPrepareFuture — that path is kept intact).
GridDhtLockRequest#owned was filled here, marshalled, unmarshalled — and never
read, so instead of porting a write-only field to codegen, the field and this
write were removed.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -60,8 +66,7 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.exchangeId = exchangeId;
this.batchId = batchId;
this.last = last;
-
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+this.rows = rows;
Review Comment:
mRows
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649847997
##
modules/core/src/test/resources/codegen/TestMarshalledCollectionMessage.java:
##
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+import java.util.Set;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.plugin.extensions.communication.Message;
+
+public class TestMarshalledCollectionMessage implements Message {
Review Comment:
The generator does not discriminate collection interfaces: any Collection
subtype takes the same code path (erasure check + (Collection)
cast), and the serializer-side Set-vs-List distinction (the set flag of the
collection descriptor) is covered by TestCollectionsMessage (23 List + 3 Set
fields). The @Marshalled flavours are keyed by the wire-field shape and all
four had dedicated test messages. The one generator branch without a golden was
the array-backed map reconstruction (as in TxLocksResponse.nearTxKeyLocks) —
added TestMarshalledArrayMapMessage covering it, both the regular and the
final-map form.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectNotResolvedException.java:
##
@@ -0,0 +1,32 @@
+/*
+ * 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.processors.cache;
+
+/**
+ * Thrown by {@link KeyCacheObjectImpl#hashCode()} when the object has not
been deserialized yet,
+ * which happens when the owning cache has been removed before {@code
unmarshal} could complete.
+ */
+public class CacheObjectNotResolvedException extends RuntimeException {
Review Comment:
It has to be unchecked — it is thrown from KeyCacheObjectImpl#hashCode(),
which cannot declare checked exceptions. On master this situation was `assert
val != null`: with assertions enabled the AssertionError escapes into
onMessage0's catch-all and trips the failure processor (node stop); without
them IgniteUtils.hashCode(null) silently returns 0. The dedicated runtime
exception is caught in GridCacheIoManager.unmarshall next to
BinaryObjectException and converted to onClassError, so the node answers via
processFailedMessage instead of failing. It extends RuntimeException directly
because it uses the stackless constructor, which IgniteException does not
expose; the throw site is unique and self-describing (can switch the base if
you prefer it over the stackless property). Negative-path coverage added:
GridNearTxPrepareDestroyedCacheTest drives exactly this exception through that
catch.
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponseUnmarshalTest.java:
##
@@ -0,0 +1,85 @@
+/*
+ * 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
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3649847194
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java:
##
@@ -71,6 +73,9 @@ public class GridIoMessage implements Message, SpanTransport,
MessageWrapper {
@GridToStringInclude
public @Nullable OperationContextMessage opCtxMsg;
+/** Set once the payload is marshalled; guards double marshal and
unmarshalled transmit. Not on the wire. */
+private transient boolean marshalled;
Review Comment:
Removed — the message travels only via the direct protocol (@Order fields),
JDK serialization never applies to it.
##
modules/core/src/test/resources/codegen/TestMarshallableMessageMarshallableSerializer.java:
##
@@ -108,13 +104,20 @@ public
TestMarshallableMessageMarshallableSerializer(Marshaller marshaller, Clas
reader.incrementState();
}
-try {
-msg.finishUnmarshal(marshaller, clsLdr);
-}
-catch (IgniteCheckedException e) {
-throw new IgniteException("Failed to unmarshal object " +
msg.getClass().getSimpleName(), e);
-}
-
return true;
}
-}
+
+/** */
+@Override public void marshal(TestMarshallableMessage msg,
GridKernalContext kctx, GridCacheContext nested) throws
IgniteCheckedException {
+GridCacheContext ctx = nested;
Review Comment:
Right — a leftover golden from an earlier design iteration where
marshal/unmarshal lived on the serializer (those methods no longer exist on
MessageSerializer). Removed. Cross-checked every resource under codegen/
against the tests: this was the only unreferenced one.
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteMessageUnmarshalThreadIntegrationTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * 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.processors.query.calcite.message;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import
org.apache.ignite.internal.processors.query.calcite.exec.task.AbstractQueryTaskExecutor;
+import
org.apache.ignite.internal.processors.query.calcite.integration.AbstractBasicIntegrationTest;
+import org.junit.Test;
+
+import static java.util.stream.Collectors.toList;
+
+/**
+ * Verifies that payload of calcite messages is unmarshalled on the query task
executor, not on a NIO thread: probe
+ * objects travel as {@code QueryStartRequest} parameters and as {@code
QueryBatchMessage} rows, and record the thread
+ * that deserializes them.
+ */
+public class CalciteMessageUnmarshalThreadIntegrationTest extends
AbstractBasicIntegrationTest {
+/** */
+private static final int ROWS = 200;
+
+/** Names of the threads that deserialized a {@link Probe}. */
+private static final Queue unmarshalThreads = new
ConcurrentLinkedQueue<>();
+
+/** {@inheritDoc} */
+@Override protected int nodeCount() {
+return 2;
+}
+
+/** */
+@Test
+public void testPayloadUnmarshalledOnQueryExecutor() {
+sql("CREATE TABLE t(id INT PRIMARY KEY, oth OTHER)");
+
+for (int i = 0; i < ROWS; i++)
+sql("INSERT INTO t VALUES (?, ?)", i, new Probe());
+
+unmarshalThreads.clear();
+
+List> res = sql("SELECT id, oth FROM t WHERE oth != ?", new
Probe());
+
+assertEquals(ROWS, res.size());
+
+assertFalse("No probe deserialization recorded",
unmarshalThreads.isEmpty());
+
+List nioThreads = unmarshalThreads.stream().filter(t ->
t.contains("nio")).collect(toList());
+
+assertTrue("Message payload unmarshalled on NIO threads: " +
nioThreads, nioThreads.isEmpty());
+
+assertTrue("No probe deserialization on the query task executor: " +
unmarshalThreads,
+unmarshalThreads.stream().anyMatch(t ->
t.startsWith(AbstractQueryTaskExecutor.THREAD_PREFIX)));
Review Comment:
Applied.
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5077599454 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5077422928 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3638622845
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRecreateEvictionTest.java:
##
@@ -0,0 +1,136 @@
+/*
+ * 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.processors.cache.distributed.near;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareRequest;
+import
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareResponse;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.junit.Test;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
+import static
org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
+
+/**
+ * Checks that a near-write {@link GridDhtTxPrepareRequest} targeting a cache
incarnation older than the receiver's
+ * current one is answered with the key in {@code nearEvicted}, so the reader
is dropped instead of keeping a stale
+ * near entry.
+ */
+public class GridNearTxRecreateEvictionTest extends GridCommonAbstractTest {
Review Comment:
You have found some kind of a bug during refactoring? Please, explain why
test was added?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5059194243 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9223963](https://ci2.ignite.apache.org/build/9223963) · 147 suites ran, 0 reused ⚠️ **2 broken suite(s)** (no reliable run): - Platform C++ CMake (Win x64 | Release): IgniteCoreTest terminated abnormally - the test binary died, its remaining tests never ran - Cache 20: non-zero exit code · Number of tests 0 is 100% less than 215 in build #276 ✅ No test blockers otherwise; 20 pre-existing/flaky filtered out. ⏳ _Auto re-run **#1** in progress — 2 broken suite(s) re-queued (attempt 1/2). This comment updates when they settle._ -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3638204125
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##
@@ -1450,11 +1469,22 @@ private void processRegularMessage0(GridIoMessage msg,
UUID nodeId) {
if (lsnr == null)
return;
-Object obj = msg.message();
+unmarshalPayload(msg);
-assert obj != null;
+invokeListener(msg.policy(), lsnr, nodeId, msg.message());
+}
-invokeListener(msg.policy(), lsnr, nodeId, obj);
+/** */
+private void unmarshalPayload(GridIoMessage msg) {
+if (msg.message() instanceof DeferredUnmarshalMessage)
Review Comment:
Where `DeferredUnmarshalMessage` will be unmarhalled then?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3638204125
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java:
##
@@ -1450,11 +1469,22 @@ private void processRegularMessage0(GridIoMessage msg,
UUID nodeId) {
if (lsnr == null)
return;
-Object obj = msg.message();
+unmarshalPayload(msg);
-assert obj != null;
+invokeListener(msg.policy(), lsnr, nodeId, msg.message());
+}
-invokeListener(msg.policy(), lsnr, nodeId, obj);
+/** */
+private void unmarshalPayload(GridIoMessage msg) {
+if (msg.message() instanceof DeferredUnmarshalMessage)
Review Comment:
Where `DeferredUnmarshalMessage` will be unmarhalled then?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3638049172
##
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java:
##
@@ -1318,15 +1319,19 @@ else if (e instanceof IgniteCheckedException)
startTimer.finishGlobalStage("Await exchange");
}
+/** Test entry to {@link #initMessageFactory()}, which production reaches
via {@link #start}. */
+@TestOnly
+public void initMessageFactoryForTest() throws IgniteCheckedException {
Review Comment:
Why we adding such method? It is used only in one test. Let's remove it.
`initMessageFactory` can be invoked via `U.invoke`:
`U.invoke(IgniteKernal.class, cacheIoMgr.context().kernalContext().grid(),
"initMessageFactory");`
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3638049172
##
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java:
##
@@ -1318,15 +1319,19 @@ else if (e instanceof IgniteCheckedException)
startTimer.finishGlobalStage("Await exchange");
}
+/** Test entry to {@link #initMessageFactory()}, which production reaches
via {@link #start}. */
+@TestOnly
+public void initMessageFactoryForTest() throws IgniteCheckedException {
Review Comment:
Why we adding such method? It is used only in one test. Let's remove it.
`initMessageFactory` can be invoked in the test via `U.invoke`:
`U.invoke(IgniteKernal.class, cacheIoMgr.context().kernalContext().grid(),
"initMessageFactory");`
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3637919506
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -430,12 +432,21 @@ public IgniteInternalFuture
prepareNearTxLocal(
IgniteTxEntry firstEntry;
try {
-IgniteTxEntry firstWrite = unmarshal(req.writes());
-IgniteTxEntry firstRead = unmarshal(req.reads());
+IgniteTxEntry firstWrite = initialize(req.writes(),
req.topologyVersion());
+IgniteTxEntry firstRead = initialize(req.reads(),
req.topologyVersion());
firstEntry = firstWrite != null ? firstWrite : firstRead;
}
catch (IgniteCheckedException e) {
+try {
+req.onClassError(e);
Review Comment:
Can you explain necessity of changes it in more human frendly form and more
briefly?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3637919506
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -430,12 +432,21 @@ public IgniteInternalFuture
prepareNearTxLocal(
IgniteTxEntry firstEntry;
try {
-IgniteTxEntry firstWrite = unmarshal(req.writes());
-IgniteTxEntry firstRead = unmarshal(req.reads());
+IgniteTxEntry firstWrite = initialize(req.writes(),
req.topologyVersion());
+IgniteTxEntry firstRead = initialize(req.reads(),
req.topologyVersion());
firstEntry = firstWrite != null ? firstWrite : firstRead;
}
catch (IgniteCheckedException e) {
+try {
+req.onClassError(e);
Review Comment:
Can you explain nesseccity of changes it in more human frendly form and more
briefly?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5058210928 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchAcknowledgeMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryInboxCloseMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5058209176 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3637935632
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponseUnmarshalTest.java:
##
@@ -0,0 +1,85 @@
+/*
+ * 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.processors.cache.query;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.managers.communication.MessageMarshalling;
+import
org.apache.ignite.internal.processors.cache.CacheObjectNotResolvedException;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/**
+ * Verifies that a query result row key arrives resolved from {@code
GridCacheQueryResponse} unmarshalling: a
+ * {@code KeyCacheObject} travels bytes-only and forbids lazy resolution (see
{@code @Marshalled}).
+ */
+public class GridCacheQueryResponseUnmarshalTest extends
GridCommonAbstractTest {
+/** An unresolved key (only its bytes present) must fail fast rather than
resolve lazily. */
+@Test
+public void testUnresolvedKeyThrows() {
+KeyCacheObject unresolved = new KeyCacheObjectImpl(null, new byte[]
{1, 2, 3}, -1);
+
+GridTestUtils.assertThrows(log, unresolved::hashCode,
CacheObjectNotResolvedException.class, null);
+}
+
+/** {@inheritDoc} */
+@Override protected void afterTest() throws Exception {
+super.afterTest();
+
+stopAllGrids();
+}
+
+/** */
+@Test
+public void testRowKeyResolved() throws Exception {
Review Comment:
We test only happy-path. Where test of node behaviour during throwing of
`CacheObjectNotResolvedException`?
##
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryResponseUnmarshalTest.java:
##
@@ -0,0 +1,85 @@
+/*
+ * 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.processors.cache.query;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.managers.communication.MessageMarshalling;
+import
org.apache.ignite.internal.processors.cache.CacheObjectNotResolvedException;
+import org.apache.ignite.internal.processors.cache.GridCacheContext;
+import org.apache.ignite.internal.processors.cache.KeyCacheObject;
+import org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+/**
+ * Verifies that a query result row key arrives resolved from {@code
GridCacheQueryResponse} unmarshalling: a
+ * {@code KeyCacheObject} travels bytes-only and forbids lazy resolution (see
{@code @Marshalled}).
+ */
+public class GridCacheQueryResponseUnmarshalTest extends
GridCommonAbstractTest {
+/** An unresolved key (only its bytes present) must fail fast rather
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3637910547
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -1215,7 +1229,29 @@ private void processDhtTxPrepareRequest(final UUID
nodeId, final GridDhtTxPrepar
if (nearTx != null)
res.nearEvicted(nearTx.evicted());
-List writesCacheMissed =
req.nearWritesCacheMissed();
+List writesCacheMissed = new ArrayList<>();
+
+Collection writes = req.nearWrites();
+
+for (Iterator it = writes.iterator();
it.hasNext();) {
+IgniteTxEntry e = it.next();
+
+GridCacheContext cacheCtx =
ctx.cacheContext(e.cacheId());
+
+// A missing cache or one recreated after the request was
sent: report the key back as evicted,
+// so the near node drops its stale entry.
+if (cacheCtx == null
Review Comment:
Thi logic differs from old one from
`GridDhtTxPrepareRequest#finishUnmarshal`. Why?
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
Review Comment:
Not a marhalling.
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -430,12 +432,21 @@ public IgniteInternalFuture
prepareNearTxLocal(
IgniteTxEntry firstEntry;
try {
-IgniteTxEntry firstWrite = unmarshal(req.writes());
-IgniteTxEntry firstRead = unmarshal(req.reads());
+IgniteTxEntry firstWrite = initialize(req.writes(),
req.topologyVersion());
+IgniteTxEntry firstRead = initialize(req.reads(),
req.topologyVersion());
firstEntry = firstWrite != null ? firstWrite : firstRead;
}
catch (IgniteCheckedException e) {
+try {
+req.onClassError(e);
Review Comment:
Can you explain it in more human frendly form and more briefly?
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEntry.java:
##
@@ -359,35 +324,38 @@ CacheObject oldValue() {
return depInfo;
}
-
/** {@inheritDoc} */
-@Override public String toString() {
-return S.toString(CacheContinuousQueryEntry.class, this);
+@Override public void marshal(Marshaller marsh) throws
IgniteCheckedException {
+if (!isFiltered()) {
+keyWire = key;
+newValWire = newVal;
+oldValWire = oldVal;
+}
}
/** {@inheritDoc} */
-@Override public void prepareMarshal(Marshaller marsh) throws
IgniteCheckedException {
-if (!isFiltered()) {
-if (key != null)
-keyBytes = marsh.marshal(key);
+@Override public void unmarshal(Marshaller marsh, ClassLoader clsLdr)
throws IgniteCheckedException {
Review Comment:
Not an unmarhalling.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3637302281
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteMessageUnmarshalThreadIntegrationTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * 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.processors.query.calcite.message;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import
org.apache.ignite.internal.processors.query.calcite.exec.task.AbstractQueryTaskExecutor;
+import
org.apache.ignite.internal.processors.query.calcite.integration.AbstractBasicIntegrationTest;
+import org.junit.Test;
+
+import static java.util.stream.Collectors.toList;
+
+/**
+ * Verifies that payload of calcite messages is unmarshalled on the query task
executor, not on a NIO thread: probe
+ * objects travel as {@code QueryStartRequest} parameters and as {@code
QueryBatchMessage} rows, and record the thread
+ * that deserializes them.
+ */
+public class CalciteMessageUnmarshalThreadIntegrationTest extends
AbstractBasicIntegrationTest {
+/** */
+private static final int ROWS = 200;
+
+/** Names of the threads that deserialized a {@link Probe}. */
+private static final Queue unmarshalThreads = new
ConcurrentLinkedQueue<>();
+
+/** {@inheritDoc} */
+@Override protected int nodeCount() {
+return 2;
+}
+
+/** */
+@Test
+public void testPayloadUnmarshalledOnQueryExecutor() {
+sql("CREATE TABLE t(id INT PRIMARY KEY, oth OTHER)");
+
+for (int i = 0; i < ROWS; i++)
+sql("INSERT INTO t VALUES (?, ?)", i, new Probe());
+
+unmarshalThreads.clear();
+
+List> res = sql("SELECT id, oth FROM t WHERE oth != ?", new
Probe());
+
+assertEquals(ROWS, res.size());
+
+assertFalse("No probe deserialization recorded",
unmarshalThreads.isEmpty());
+
+List nioThreads = unmarshalThreads.stream().filter(t ->
t.contains("nio")).collect(toList());
+
+assertTrue("Message payload unmarshalled on NIO threads: " +
nioThreads, nioThreads.isEmpty());
+
+assertTrue("No probe deserialization on the query task executor: " +
unmarshalThreads,
+unmarshalThreads.stream().anyMatch(t ->
t.startsWith(AbstractQueryTaskExecutor.THREAD_PREFIX)));
Review Comment:
```suggestion
unmarshalThreads.stream().allMatch(t ->
t.startsWith(AbstractQueryTaskExecutor.THREAD_PREFIX)));
```
##
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteMessageUnmarshalThreadIntegrationTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * 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.processors.query.calcite.message;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import
org.apache.ignite.internal.processors.query.calcite.exec.task.AbstractQueryTaskExecutor;
+import
org.apache.ignite.internal.processors.query.calcite.integration.AbstractBasicIntegrationTest;
+import
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636324887
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +104,29 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+return rows;
Review Comment:
Rows just can be lazily initialized here. Also we can use `F.transform`
here.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636339730
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java:
##
@@ -18,13 +18,13 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
/**
*
*/
-public class QueryCloseMessage implements Message {
+public class QueryCloseMessage implements DeferredUnmarshalMessage {
Review Comment:
+1 unnecessary change.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636318031
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +104,29 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+return rows;
+}
+
+/** {@inheritDoc} */
+@Override public void marshal(Marshaller marsh) {
Review Comment:
Not a marshallable. Scope of Marsahallable messages should be reduced.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636353413
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartResponse.java:
##
@@ -18,15 +18,15 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.communication.ErrorMessage;
-import org.apache.ignite.plugin.extensions.communication.Message;
import org.jetbrains.annotations.Nullable;
/**
*
*/
-public class QueryStartResponse implements Message {
+public class QueryStartResponse implements DeferredUnmarshalMessage {
Review Comment:
Why?
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636332467
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -17,13 +17,16 @@
package org.apache.ignite.internal.processors.query.calcite.message;
+import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import java.util.stream.Collectors;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
+import org.apache.ignite.internal.MarshallableMessage;
import org.apache.ignite.internal.Order;
+import org.apache.ignite.marshaller.Marshaller;
/** */
-public class QueryBatchMessage implements ExecutionContextAware {
+public class QueryBatchMessage implements MarshallableMessage,
DeferredUnmarshalMessage, ExecutionContextAware {
Review Comment:
```suggestion
public class QueryBatchMessage implements ExecutionContextAware {
```
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636318031
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +104,29 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+return rows;
+}
+
+/** {@inheritDoc} */
+@Override public void marshal(Marshaller marsh) {
Review Comment:
Not a marshallable one. Scope of Marsahallable messages should be reduced.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
shishkovilja commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3636324887
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -99,6 +104,29 @@ public boolean last() {
* @return Rows.
*/
public List rows() {
-return
mRows.stream().map(GenericValueMessage::value).collect(Collectors.toList());
+return rows;
Review Comment:
Rows just can be eagerly initialized here. Also we can use `F.transform`
here.
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryBatchMessage.java:
##
@@ -60,8 +66,7 @@ public QueryBatchMessage(UUID qryId, long fragmentId, long
exchangeId, int batch
this.exchangeId = exchangeId;
this.batchId = batchId;
this.last = last;
-
-mRows = rows.stream().map(o -> o == null ? null : new
GenericValueMessage(o)).collect(Collectors.toList());
+this.rows = rows;
Review Comment:
Can be replaced by lighweight view (`F.view`).
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
Vladsz83 commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3630826986
##
modules/core/src/test/resources/codegen/NioFieldOnNonMessageMessage.java:
##
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+import org.apache.ignite.plugin.extensions.communication.Message;
+
+public class NioFieldOnNonMessageMessage implements Message {
Review Comment:
Suggestion: `NioFieldOnFieldMessage`
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryCloseMessage.java:
##
@@ -18,13 +18,13 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
-import org.apache.ignite.plugin.extensions.communication.Message;
/**
*
*/
-public class QueryCloseMessage implements Message {
+public class QueryCloseMessage implements DeferredUnmarshalMessage {
Review Comment:
Why it is a `DeferredUnmarshalMessage`? And many other who `implements
DeferredUnmarshalMessage`
##
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/CalciteErrorMessage.java:
##
@@ -18,11 +18,12 @@
package org.apache.ignite.internal.processors.query.calcite.message;
import java.util.UUID;
+import org.apache.ignite.internal.DeferredUnmarshalMessage;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.communication.ErrorMessage;
/** */
-public class CalciteErrorMessage extends ErrorMessage {
+public class CalciteErrorMessage extends ErrorMessage implements
DeferredUnmarshalMessage {
Review Comment:
Why it is a `DeferredUnmarshalMessage`?
##
modules/nio/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageRegistry.java:
##
@@ -0,0 +1,73 @@
+/*
+ * 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.plugin.extensions.communication;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.IgniteException;
+import
org.apache.ignite.internal.managers.communication.UnknownMessageException;
+
+/**
+ * Registry of message class to direct type mappings behind {@link
Message#directType()}, populated during factory
+ * initialization via {@link Message#registerAsDirectType(short)}. Kept
package-private so the map is mutable only
+ * through the validated registration path.
+ */
+final class MessageRegistry {
+/** Message class to direct type mappings. */
+private static final Map, Short> REGISTRATIONS =
new ConcurrentHashMap<>();
+
+/** Per-class cache over {@link #REGISTRATIONS}; keeps {@link #directType}
off the map lookup done for every sent message. */
+private static final ClassValue DIRECT_TYPES = new ClassValue<>() {
Review Comment:
Let's use just a `ConcurrentMap`? WDYT?
##
modules/core/src/test/resources/codegen/TestMessageMarshaller.java:
##
@@ -0,0 +1,63 @@
+/*
+ * 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
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5038320635 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9220592](https://ci2.ignite.apache.org/build/9220592) · 147 suites ran, 0 reused ⚠️ **1 broken suite(s)** (no reliable run): - Platform C++ CMake (Win x64 | Release): IgniteCoreTest terminated abnormally - the test binary died, its remaining tests never ran ✅ No test blockers otherwise; 67 pre-existing/flaky filtered out. ⏳ _Auto re-run **#1** in progress — 1 broken suite(s) re-queued (attempt 1/2). This comment updates when they settle._ -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5036909896 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5036776769 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3623372393 ## modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java: ## Review Comment: Filed: https://issues.apache.org/jira/browse/IGNITE-28912 -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5022925478 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5022787781 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5006227039 **[Ignite PR Checker](https://ignite-pr-checker.is-a.dev/?pr=13095)** verdict · RunAll build [9216359](https://ci2.ignite.apache.org/build/9216359) · 147 suites ran, 0 reused ⚠️ **2 broken suite(s)** (no reliable run): - Platform C++ CMake (Win x64 | Release): IgniteCoreTest terminated abnormally - the test binary died, its remaining tests never ran · Number of tests 458 is 23% less than 595 in build #18333 - Cache (Failover) 5: execution timeout · non-zero exit code · Number of tests 33 is 51% less than 67 in build #254 🔍 **2 suite(s) ran fewer tests than on master** (tests that never ran can't fail): - Cache (Failover) 5: 33 tests vs 67 on master (**−51%**) - Platform C++ CMake (Win x64 | Release): 458 tests vs 595 on master (**−23%**) ✅ No test blockers otherwise; 26 pre-existing/flaky filtered out. ⏳ _Auto re-run **#1** in progress — 2 broken suite(s) re-queued (attempt 1/2), **≈ settled by 21:51 MSK**. This comment updates when they settle._ -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5004998354 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5004810480 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-5004085633 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3599444192
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java:
##
@@ -430,12 +432,21 @@ public IgniteInternalFuture
prepareNearTxLocal(
IgniteTxEntry firstEntry;
try {
-IgniteTxEntry firstWrite = unmarshal(req.writes());
-IgniteTxEntry firstRead = unmarshal(req.reads());
+IgniteTxEntry firstWrite = initialize(req.writes(),
req.topologyVersion());
+IgniteTxEntry firstRead = initialize(req.reads(),
req.topologyVersion());
firstEntry = firstWrite != null ? firstWrite : firstRead;
}
catch (IgniteCheckedException e) {
+try {
+req.onClassError(e);
Review Comment:
Reopening with new data — the removal turned out to be a real regression,
and my earlier concession was based on an incomplete test set. RunAll on the
branch went red in `IgniteCacheRecreateTest` (implicit tx + cache
destroy/recreate, 3 tests timing out; never failed in 68 master runs), and a
local A/B pinned it to exactly this block: without it 3/3 hang on
`updFut.get(10s)`, with it 3/3 pass plus the whole class 13/13. The explanation
reconciles both sides: master lives with the bare `return new
GridFinishedFuture<>(e)` because there these errors surface earlier — in
`GridCacheIoManager.unmarshall`, where `processFailedMessage` sends the error
response before the handler runs. This PR moved the entry context binding
(`initialize(entries, topVer)`) into `prepareNearTx`, so a "cache recreated"
failure now surfaces past `GridCacheIoManager`'s catch — and the response duty
moved here with it. Your breakpoint experiment was right for its case: P2p
class errors are still caught a
t the message level and never reach this block; the recreate path is the one
that does. Restored the block with a comment explaining why it must stay.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4997439945 /runall -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996980401 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996970119 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3599158866
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java:
##
@@ -1136,11 +1138,13 @@ public void send(ClusterNode node, GridCacheMessage
msg, byte plc) throws Ignite
if (log.isDebugEnabled())
log.debug("Sending cache message [msg=" + msg + ", node=" +
U.toShortString(node) + ']');
+GridIoMessage ioMsg = cctx.gridIO().prepare(TOPIC_CACHE, msg, plc,
false, 0, false);
Review Comment:
Done — went further per your suggestion: the retry loop itself moved into
the transport. `GridIoManager.sendWithRetry(node, topic, msg, ...)` prepares
once and retries only the transmission, waiting `getNetworkSendRetryDelay()`
between attempts; the caller supplies a `SendRetryPolicy` lambda (`onFailure(e,
attempt)`) carrying the cache-level knowledge — liveness/ping checks, retry
limit, stopping flag, logging. Both `GridCacheIoManager` loops are now
one-liner policies, `prepare` is private, and `GridIoMessage` no longer leaves
`GridIoManager`.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996926396 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3599187103 ## modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java: ## Review Comment: Done — filed https://issues.apache.org/jira/browse/IGNITE-28901 (revise the filters marshalling: the filter needs the peer-deployment loader resolved at processing time, so it stays outside the generated flow for now — possibly a deferred `@Marshalled` flavour) and added `// TODO IGNITE-28901: revise the filters marshalling.` over `finishUnmarshalFilters`. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3599159121
##
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java:
##
@@ -1197,11 +1201,19 @@ public void sendOrderedMessage(ClusterNode node, Object
topic, GridCacheMessage
msg.lastAffinityChangedTopologyVersion(cctx.exchange().lastAffinityChangedTopologyVersion(msg.topologyVersion()));
+if (node.isLocal()) {
+cctx.gridIO().sendOrderedMessage(node, topic, msg, plc, timeout,
false);
+
+return;
+}
+
+GridIoMessage ioMsg = cctx.gridIO().prepare(topic, msg, plc, true,
timeout, false);
Review Comment:
Done via the encapsulation above: with `sendWithRetry` owning prepare-once +
retry inside the transport, callers neither see the flag nor the wrap —
`prepare` is private now. The flag itself got generalized along the way
(`marshalled`, set and asserted at every marshal point, asserted again at
transmit), so a future re-marshal on any path trips an assertion without a
per-message base class.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3598905778
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/MessageUnmarshalDedup.java:
##
@@ -0,0 +1,112 @@
+/*
+ * 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.managers.communication;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.MarshallableMessage;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+
+/**
+ * Detects a {@link MarshallableMessage} instance being finish-unmarshalled
more than once within the same pass
+ * (cache-aware or cache-free) — a class-loader or receive-path bug. The two
passes over one message (e.g. the
+ * generic {@code GridIoManager} pass plus a subsystem's cache-aware pass) are
legitimate and tracked separately.
+ * Gated by {@link #ENABLED}, so it runs only under tests and is folded away
in production.
+ *
+ * @see MessageMarshaller
+ */
+public class MessageUnmarshalDedup {
Review Comment:
Done — with a detour worth reporting. First I built the literal mirror check
(identity-keyed `MessageMarshalOnceCheck` asserted in
`MessageMarshalling.marshal`, suite-wide): **275 firings**, every grid-starting
test red — discovery ring forwarding re-marshals the *same* instance per hop by
design (`TcpDiscoveryJoinRequestMessage` and its `TcpDiscoveryNode`s, each
repeat a guarded no-op). So marshal-once is not a global per-instance invariant
the way unmarshal-once is: a receive always yields a fresh instance, a send may
legitimately reuse one. The invariant that *does* exist is per transmission
unit: a `GridIoMessage` is marshalled exactly once before transmit. That's now
enforced by construction instead of a weak-set detector: the `prepared` flag
you suggested earlier is generalized to `marshalled`, a private
`GridIoManager.marshal(ioMsg)` asserts not-yet-marshalled → marshals → marks at
all four marshal points (prepare / send / openChannel / sendToMany), and
`sendPrepare
d` asserts marshalled. Any future re-marshal on a retry loop, double prepare,
or transmit of an unmarshalled wrap trips the assert on every test run — no
system property or detector machinery needed.
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/MessageUnmarshalDedup.java:
##
@@ -0,0 +1,112 @@
+/*
+ * 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.managers.communication;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.MarshallableMessage;
+import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageMarshaller;
+
+/**
+ * Detects a {@link MarshallableMessage} instance being finish-unmarshalled
more than once within the same pass
+ * (cache-aware or cache-free) — a class-loader or receive-path bug. The two
passes over
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996566980 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3598672988 ## modules/nio/src/main/java/org/apache/ignite/plugin/extensions/communication/Message.java: ## Review Comment: Done — moved the machinery out of the interface: `REGISTRATIONS` + the `DIRECT_TYPES` cache now live in a package-private `MessageRegistry` (same package), with the conflict validation and the `UnknownMessageException` contract inside. `Message` keeps only the contract — `directType()` / `registerAsDirectType()` delegating. This also fixes what the old shape actually exposed: interface fields are implicitly `public static final`, so the mutable registry map was publicly writable past the validated registration path. -- 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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996240632 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
github-actions[bot] commented on PR #13095: URL: https://github.com/apache/ignite/pull/13095#issuecomment-4996105762 ## Possible compatibility issues. Please, check rolling upgrade cases This PR modifies protected classes (with **Order** annotation). Changes to these classes can break rolling upgrade compatibility. **Affected files:** - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/GenericValueMessage.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryStartRequest.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java` - `modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/metadata/ColocationGroup.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/MessageProcessor.java` - `modules/codegen/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteIoTestMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryPredicateAdapter.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeDirectResult.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIdMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/StoredCacheData.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataVersionInfo.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTtlUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridNearUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnlockRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/TransactionAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/AtomicApplicationAttributesAwareRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicNearResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicSingleUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateResponse.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicFullUpdateRequest.java` - `modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicSingleUpdateFilterRequest.java` -
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3598569576
##
modules/nio/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java:
##
@@ -38,4 +38,36 @@ public interface MessageSerializer {
* @return Whether message was fully read.
*/
public boolean readFrom(M msg, MessageReader reader);
+
+/**
+ * Writes the message using the serializer resolved from the factory.
+ *
+ * @param factory Message factory.
+ * @param msg Message instance.
+ * @param writer Writer.
+ * @param Message type.
+ * @return Whether message was fully written.
+ */
+static boolean writeTo(MessageFactory factory, M msg,
MessageWriter writer) {
+return resolve(factory, msg).writeTo(msg, writer);
+}
+
+/**
+ * Reads the message using the serializer resolved from the factory.
+ *
+ * @param factory Message factory.
+ * @param msg Message instance.
+ * @param reader Reader.
+ * @param Message type.
+ * @return Whether message was fully read.
+ */
+static boolean readFrom(MessageFactory factory, M msg,
MessageReader reader) {
+return resolve(factory, msg).readFrom(msg, reader);
+}
+
+/** @return the serializer registered for {@code msg}'s direct type. */
+@SuppressWarnings("unchecked")
+private static MessageSerializer
resolve(MessageFactory factory, M msg) {
Review Comment:
Done — revisited after the marshalling refactor made the family
inconsistent: the statics (`writeTo`/`readFrom` and the private `resolve`)
moved out of the interface into a new `MessageSerialization` facade (next to
`GridNioServer`), the exact counterpart of `MessageMarshalling` on the
serialization side. `MessageSerializer` is now a pure per-type contract with
the two instance methods.
##
modules/nio/src/main/java/org/apache/ignite/plugin/extensions/communication/MessageSerializer.java:
##
@@ -38,4 +38,36 @@ public interface MessageSerializer {
* @return Whether message was fully read.
*/
public boolean readFrom(M msg, MessageReader reader);
+
+/**
+ * Writes the message using the serializer resolved from the factory.
+ *
+ * @param factory Message factory.
+ * @param msg Message instance.
+ * @param writer Writer.
+ * @param Message type.
+ * @return Whether message was fully written.
+ */
+static boolean writeTo(MessageFactory factory, M msg,
MessageWriter writer) {
Review Comment:
Done — the `SerializationUtil/Helper` you suggested now exists as
`MessageSerialization` (mirroring `MessageMarshalling`): the interface keeps
only the instance contract, the resolve-and-dispatch statics live in the
facade, and the ArchUnit rule enforces that everyone else calls the facade.
--
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]
Re: [PR] IGNITE-28520 Auto-generate message serialization / marshalling / deployment [ignite]
anton-vinogradov commented on code in PR #13095:
URL: https://github.com/apache/ignite/pull/13095#discussion_r3598462845
##
modules/codegen/src/main/java/org/apache/ignite/internal/MarshalledMap.java:
##
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Marks a {@code Map} field whose wire form is a pair of {@code @Order}
companion fields: {@link #keys()} and {@link #values()}. */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.FIELD)
+public @interface MarshalledMap {
Review Comment:
Update: done now — the family is merged into a single `@Marshalled`. The map
flavour kept its two companions as attributes: `@Marshalled(keys = "...",
values = "...")` (mutually exclusive with `value()`, validated by the
processor), and the generator derives the mechanics from the companion shape.
`@MarshalledMap` is gone.
##
modules/codegen/src/main/java/org/apache/ignite/internal/MarshalledObjects.java:
##
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a {@code Collection} field of arbitrary (non-{@code Message}) objects
whose wire form is a companion
+ * {@code @Order Collection} field named by {@link #value()}: each
element is marshalled to its own
+ * {@code byte[]}, so elements that need different deployment class loaders
survive. Use {@code @MarshalledCollection}
+ * instead when the elements are {@code Message}s.
+ *
+ * An unmarshalled {@code Map.Entry} element (a query result row) gets its
{@code KeyCacheObject} key resolved with
+ * the message's cache object context: such a key arrives bytes-only and
forbids lazy resolution.
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.FIELD)
+public @interface MarshalledObjects {
Review Comment:
Update: done now — `@Marshalled` is the single annotation for all flavours,
dispatched by the companion field's shape: `byte[]` = whole-object blob
(non-message fields included), `Message[]` = per-element messages,
`Collection` = per-element blobs. `@MarshalledObjects` is gone.
##
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/IgniteMessageFactoryImpl.java:
##
@@ -132,6 +163,16 @@ public IgniteMessageFactoryImpl(MessageFactoryProvider[]
factories) {
return serializer;
}
+/** {@inheritDoc} */
+@Override public @Nullable MessageMarshaller marshaller(short directType) {
Review Comment:
Update: done by your parametrization patch — `IgniteMessageFactoryImpl` now
holds `MessageSerializer[]` / `MessageMarshaller[]` /
`GridCacheMessageDeployer[]` and the accessors return the parametrized
types.
--
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]
