[
https://issues.apache.org/jira/browse/IGNITE-12766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17064901#comment-17064901
]
Vyacheslav Koptilin commented on IGNITE-12766:
----------------------------------------------
Hello [~Pavlukhin],
Thank you for the review! I have updated the PR. Please take a look.
> I suppose we can make nested {{GridCacheProcessor.LocalAffinityFunction}}
>class _private_ and throw an exception from a constructor as it should not be
>instantiated by calling the constructor.
It makes sense. I have updated the pull-request.
> I noticed that nested affinity function class is listed in a file
>classnames.properties (I forgot why is it needed), should not we add the new
>class to this file as well?
You are right. It does not seem to be required but worth doing. If I am not
mistaken, this file is automatically updated during the release preparation .
Please take a look at {{org.apache.ignite.tools.classgen.ClassesGenerator}}.
{{classnames.properties}} is used by optimized marshaller and it is needed in
order to prepare white list of classes (safe deserialization)
>While it does not seem critical, but quite interesting, can we define
>{{readResolve}} method and replace an instance of the old nested class with an
>instance of the actual one?
Nice catch! Yes, it can be implemented in this way, but I see no real
difference with the proposed change.
> Node startup can be broken in case of using Local cache with persistence
> enabled.
> ---------------------------------------------------------------------------------
>
> Key: IGNITE-12766
> URL: https://issues.apache.org/jira/browse/IGNITE-12766
> Project: Ignite
> Issue Type: Bug
> Reporter: Vyacheslav Koptilin
> Assignee: Vyacheslav Koptilin
> Priority: Major
> Fix For: 2.9
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Trying to upgrade from the previous version of Apache Ignite (AI 2.7.6 for
> example) may result in the following exception when Local cache is used and
> persistence enabled.
> {code}
> [2020-03-05 16:47:39,222][ERROR][main][IgniteKernal] Exception during start
> processors, node will be stopped and close connections[2020-03-05
> 16:47:39,222][ERROR][main][IgniteKernal] Exception during start processors,
> node will be stopped and close connectionsclass
> org.apache.ignite.IgniteCheckedException: An error occurred during cache
> configuration loading from file [file=...] at
> org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.readCacheData(FilePageStoreManager.java:965)
> at
> org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.readCacheConfigurations(FilePageStoreManager.java:907)
> at
> org.apache.ignite.internal.processors.cache.GridLocalConfigManager.restoreCaches(GridLocalConfigManager.java:171)
> at
> org.apache.ignite.internal.processors.cache.GridLocalConfigManager.restoreCacheConfigurations(GridLocalConfigManager.java:124)
> at
> org.apache.ignite.internal.processors.cache.GridCacheProcessor$CacheRecoveryLifecycle.onReadyForRead(GridCacheProcessor.java:5198)
> at
> org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.notifyMetastorageReadyForRead(GridCacheDatabaseSharedManager.java:488)
> at
> org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.readMetastore(GridCacheDatabaseSharedManager.java:824)
> at
> org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.notifyMetaStorageSubscribersOnReadyForRead(GridCacheDatabaseSharedManager.java:5378)
> at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1286) at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2054)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1704)
> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1117) at
> org.apache.ignite.internal.IgnitionEx.startConfigurations(IgnitionEx.java:1035)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:921) at
> org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:820) at
> org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:690) at
> org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:659) at
> org.apache.ignite.Ignition.start(Ignition.java:346) at
> org.apache.ignite.examples.ExampleNodeStartup.main(ExampleNodeStartup.java:38)Caused
> by: class org.apache.ignite.IgniteCheckedException: Failed to find class
> with given class loader for unmarshalling (make sure same versions of all
> classes are available on all nodes or enable peer-class-loading)
> [clsLdr=sun.misc.Launcher$AppClassLoader@18b4aac2,
> cls=org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction]
> at
> org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:129)
> at
> org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:93)
> at
> org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.readCacheData(FilePageStoreManager.java:961)
> ... 18 moreCaused by: java.lang.ClassNotFoundException:
> org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:424) at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:357) at
> java.lang.Class.forName0(Native Method) at
> java.lang.Class.forName(Class.java:348) at
> org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8870) at
> org.apache.ignite.marshaller.jdk.JdkMarshallerObjectInputStream.resolveClass(JdkMarshallerObjectInputStream.java:59)
> at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1826)
> at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713) at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2000) at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535) at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245) at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169) at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027) at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535) at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245) at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169) at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027) at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535) at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:422) at
> org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:124)
> ... 20 more{code}
> The issue is caused by IGNITE-12656. To be more precise, the root cause of
> {{ClassNotFoundException}} is the fact of moving {{LocalAffinityFunction}} to
> a separate class.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)