You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kellan <ke...@gmail.com> on 2019/03/07 12:04:31 UTC

BinaryInvalidTypeException "Unknown Pair" after node restart

I'm using indexed types for my cache. Here is my cache configuration:

                <bean
class="org.apache.ignite.configuration.CacheConfiguration">
                    <property name="name" value="DailyEventTheta"/>
                    <property name="indexedTypes">
                        <list>
                           
<value>co.mira.etl.load.ignite.models.DailyEventThetaKey</value>
                           
<value>co.mira.etl.load.ignite.models.DailyEventTheta</value>                            
                        </list>
                    </property>
                    <property name="cacheMode" value="PARTITIONED"/>
                    <property name="sqlSchema" value="PUBLIC"/>
                </bean>

Here's the class:

	case class DailyEventTheta(
		@(QueryTextField@field) theta: Array[Byte]
	) extends EventTheta

I have a query that runs as part of task that looks like this:

	val query = new SqlQuery[DailyEventThetaKey, DailyEventTheta](
		classOf[DailyEventTheta],
		"eventDate = ? AND s2CellId BETWEEN ? AND ?"
	).setArgs(
		List(sts, minId, maxId).map(v => v.asInstanceOf[AnyRef]):_*
	)

        cache.query(query.setLocal(true).setPageSize(pageSize)).iterator()

When I launch my cluster for the first time, I get back my expected result
set, however if I have to restart my nodes for any reason, like an update or
a crash, this query stops working and I get the following error:

	class org.apache.ignite.binary.BinaryInvalidTypeException: Unknown pair
[platformId=0, typeId=-1905551001]
		at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:707)
		at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1757)
		at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1716)
		at
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:798)
		at
org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:143)
		at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:177)
		at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinaryIfNeeded(CacheObjectUtils.java:67)
		at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$7$1.next(IgniteH2Indexing.java:1593)
		at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$7$1.next(IgniteH2Indexing.java:1580)
		at
co.mira.etl.load.ignite.compute.query.EventThetaQueries$$anonfun$co$mira$etl$load$ignite$compute$query$EventThetaQueries$$query$1.apply(EventThetaQueries.scala:49)
		at
co.mira.etl.load.ignite.compute.query.EventThetaQueries$$anonfun$co$mira$etl$load$ignite$compute$query$EventThetaQueries$$query$1.apply(EventThetaQueries.scala:49)
		at scala.collection.Iterator$$anon$9.next(Iterator.scala:162)
		at scala.collection.Iterator$$anon$16.hasNext(Iterator.scala:599)
		at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
		at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:462)
		at scala.collection.Iterator$GroupedIterator.fill(Iterator.scala:1124)
		at scala.collection.Iterator$GroupedIterator.hasNext(Iterator.scala:1130)
		at scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
		at scala.collection.Iterator$class.foreach(Iterator.scala:891)
		at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
		at
scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59)
		at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:183)
		at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
		at scala.collection.TraversableOnce$class.to(TraversableOnce.scala:310)
		at scala.collection.AbstractIterator.to(Iterator.scala:1334)
		at
scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:294)
		at scala.collection.AbstractIterator.toList(Iterator.scala:1334)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5$$anonfun$6.apply(EventThetasExtractor.scala:152)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5$$anonfun$6.apply(EventThetasExtractor.scala:152)
		at co.mira.common.util.TryAll$.apply(TryAll.scala:7)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5.apply(EventThetasExtractor.scala:135)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5.apply(EventThetasExtractor.scala:135)
		at co.mira.services.metrics.Profiler.profile(Profiler.scala:6)
		at
co.mira.etl.load.ignite.metrics.MeteredObject.profile(MeteredObject.scala:12)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor.co$mira$etl$load$ignite$compute$data$cache$extractors$EventThetasExtractor$$fetchEventsFromCache(EventThetasExtractor.scala:133)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$11.apply(EventThetasExtractor.scala:316)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$11.apply(EventThetasExtractor.scala:315)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$fetch$1$$anonfun$apply$18$$anonfun$apply$19.apply(EventThetasExtractor.scala:339)
		at
co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$fetch$1$$anonfun$apply$18$$anonfun$apply$19.apply(EventThetasExtractor.scala:339)
		at
scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
		at
scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
		at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at java.lang.Thread.run(Thread.java:748)
	Caused by: java.lang.ClassNotFoundException: Unknown pair [platformId=0,
typeId=-1905551001]
		at
org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:394)
		at
org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:344)
		at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:698)
		... 43 more

From what I can surmise, Ignite can't find the class type id, like my
indexed types aren't being reregistered on restart, but it's unclear. This
is a blocking issue because otherwise I have to rebuild my entire data set 
every time I have to restart a node.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by kellan <ke...@gmail.com>.
Yes. That did the trick. I don't know if you've included this under your
Kubernetes documentation, but you might want to recommended that users set
up a persistent volume for their working directories so that it doesn't get
deleted between restarts.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Can you try ignite.binary().toBinary(new DailyEventTheta()) first thing
after node start?

Note that I don't recommend doing that from listeners, please try going
that on Ignite instance once it's started, just to make sure.

Regards,
-- 
Ilya Kasnacheev


чт, 7 мар. 2019 г. в 16:59, kellan <ke...@gmail.com>:

> I'm sure. When I log out the typename in the start up script:
>
>                 val typeId =
> ignite$.binary().typeId("co.mira.etl.load.ignite.models.DailyEventTheta")
>                 println(s"Type Id: $typeId")
>
> I get "Type Id: -1905551001"
>
> Again, here's the error message: "class
> org.apache.ignite.binary.BinaryInvalidTypeException: Unknown pair
> [platformId=0, typeId=-1905551001]"
>
> This is error is being thrown when I try to iterate over results from an
> SqlQuery on a server node.
>
> I don't know if this matters but when I look in my marshaller directory, I
> don't see a file called -1905551001.
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by kellan <ke...@gmail.com>.
I'm sure. When I log out the typename in the start up script:

		val typeId =
ignite$.binary().typeId("co.mira.etl.load.ignite.models.DailyEventTheta")
		println(s"Type Id: $typeId")

I get "Type Id: -1905551001"

Again, here's the error message: "class
org.apache.ignite.binary.BinaryInvalidTypeException: Unknown pair
[platformId=0, typeId=-1905551001]"

This is error is being thrown when I try to iterate over results from an
SqlQuery on a server node.

I don't know if this matters but when I look in my marshaller directory, I
don't see a file called -1905551001.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Are you sure that package and class name did not change between restarts?
When is this exception thrown?

Regards,
-- 
Ilya Kasnacheev


чт, 7 мар. 2019 г. в 16:13, kellan <ke...@gmail.com>:

> OK. Did this, but still seeing the same exception.
>
>         class SetUpIgniteBinaries extends LifecycleBean {
>                 override def onLifecycleEvent(evt: LifecycleEventType):
> Unit = if(evt ==
> LifecycleEventType.AFTER_NODE_START) {
>                         ignite$.binary().`type`(classOf[DailyEventTheta])
>
> ignite$.binary().`type`(classOf[DailyEventThetaKey])
>                 }
>         }
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by kellan <ke...@gmail.com>.
OK. Did this, but still seeing the same exception.

	class SetUpIgniteBinaries extends LifecycleBean {
		override def onLifecycleEvent(evt: LifecycleEventType): Unit = if(evt ==
LifecycleEventType.AFTER_NODE_START) {
			ignite$.binary().`type`(classOf[DailyEventTheta])
			ignite$.binary().`type`(classOf[DailyEventThetaKey])
		}
	}	



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: BinaryInvalidTypeException "Unknown Pair" after node restart

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

It likely means that you have lost your marshaller/ dir which is normally
under Ignite workdir. Please take care to preserve it.

You can repopulate it by calling ignite.binary().type(PojoClass.class) on
startup for all affected classes.

Regards,
-- 
Ilya Kasnacheev


чт, 7 мар. 2019 г. в 15:04, kellan <ke...@gmail.com>:

> I'm using indexed types for my cache. Here is my cache configuration:
>
>                 <bean
> class="org.apache.ignite.configuration.CacheConfiguration">
>                     <property name="name" value="DailyEventTheta"/>
>                     <property name="indexedTypes">
>                         <list>
>
> <value>co.mira.etl.load.ignite.models.DailyEventThetaKey</value>
>
> <value>co.mira.etl.load.ignite.models.DailyEventTheta</value>
>
>                         </list>
>                     </property>
>                     <property name="cacheMode" value="PARTITIONED"/>
>                     <property name="sqlSchema" value="PUBLIC"/>
>                 </bean>
>
> Here's the class:
>
>         case class DailyEventTheta(
>                 @(QueryTextField@field) theta: Array[Byte]
>         ) extends EventTheta
>
> I have a query that runs as part of task that looks like this:
>
>         val query = new SqlQuery[DailyEventThetaKey, DailyEventTheta](
>                 classOf[DailyEventTheta],
>                 "eventDate = ? AND s2CellId BETWEEN ? AND ?"
>         ).setArgs(
>                 List(sts, minId, maxId).map(v => v.asInstanceOf[AnyRef]):_*
>         )
>
>         cache.query(query.setLocal(true).setPageSize(pageSize)).iterator()
>
> When I launch my cluster for the first time, I get back my expected result
> set, however if I have to restart my nodes for any reason, like an update
> or
> a crash, this query stops working and I get the following error:
>
>         class org.apache.ignite.binary.BinaryInvalidTypeException: Unknown
> pair
> [platformId=0, typeId=-1905551001]
>                 at
>
> org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:707)
>                 at
>
> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1757)
>                 at
>
> org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1716)
>                 at
>
> org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:798)
>                 at
>
> org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:143)
>                 at
>
> org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:177)
>                 at
>
> org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinaryIfNeeded(CacheObjectUtils.java:67)
>                 at
>
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$7$1.next(IgniteH2Indexing.java:1593)
>                 at
>
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$7$1.next(IgniteH2Indexing.java:1580)
>                 at
>
> co.mira.etl.load.ignite.compute.query.EventThetaQueries$$anonfun$co$mira$etl$load$ignite$compute$query$EventThetaQueries$$query$1.apply(EventThetaQueries.scala:49)
>                 at
>
> co.mira.etl.load.ignite.compute.query.EventThetaQueries$$anonfun$co$mira$etl$load$ignite$compute$query$EventThetaQueries$$query$1.apply(EventThetaQueries.scala:49)
>                 at
> scala.collection.Iterator$$anon$9.next(Iterator.scala:162)
>                 at
> scala.collection.Iterator$$anon$16.hasNext(Iterator.scala:599)
>                 at
> scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:409)
>                 at
> scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:462)
>                 at
> scala.collection.Iterator$GroupedIterator.fill(Iterator.scala:1124)
>                 at
> scala.collection.Iterator$GroupedIterator.hasNext(Iterator.scala:1130)
>                 at
> scala.collection.Iterator$$anon$12.hasNext(Iterator.scala:440)
>                 at
> scala.collection.Iterator$class.foreach(Iterator.scala:891)
>                 at
> scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
>                 at
> scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59)
>                 at
> scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:183)
>                 at
> scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
>                 at scala.collection.TraversableOnce$class.to
> (TraversableOnce.scala:310)
>                 at scala.collection.AbstractIterator.to
> (Iterator.scala:1334)
>                 at
> scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:294)
>                 at
> scala.collection.AbstractIterator.toList(Iterator.scala:1334)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5$$anonfun$6.apply(EventThetasExtractor.scala:152)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5$$anonfun$6.apply(EventThetasExtractor.scala:152)
>                 at co.mira.common.util.TryAll$.apply(TryAll.scala:7)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5.apply(EventThetasExtractor.scala:135)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$5.apply(EventThetasExtractor.scala:135)
>                 at
> co.mira.services.metrics.Profiler.profile(Profiler.scala:6)
>                 at
>
> co.mira.etl.load.ignite.metrics.MeteredObject.profile(MeteredObject.scala:12)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor.co
> $mira$etl$load$ignite$compute$data$cache$extractors$EventThetasExtractor$$fetchEventsFromCache(EventThetasExtractor.scala:133)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$11.apply(EventThetasExtractor.scala:316)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$11.apply(EventThetasExtractor.scala:315)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$fetch$1$$anonfun$apply$18$$anonfun$apply$19.apply(EventThetasExtractor.scala:339)
>                 at
>
> co.mira.etl.load.ignite.compute.data.cache.extractors.EventThetasExtractor$$anonfun$fetch$1$$anonfun$apply$18$$anonfun$apply$19.apply(EventThetasExtractor.scala:339)
>                 at
>
> scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
>                 at
> scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
>                 at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>                 at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>                 at java.lang.Thread.run(Thread.java:748)
>         Caused by: java.lang.ClassNotFoundException: Unknown pair
> [platformId=0,
> typeId=-1905551001]
>                 at
>
> org.apache.ignite.internal.MarshallerContextImpl.getClassName(MarshallerContextImpl.java:394)
>                 at
>
> org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:344)
>                 at
>
> org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:698)
>                 ... 43 more
>
> From what I can surmise, Ignite can't find the class type id, like my
> indexed types aren't being reregistered on restart, but it's unclear. This
> is a blocking issue because otherwise I have to rebuild my entire data set
> every time I have to restart a node.
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>