cloudstateio / cloudstate

Distributed State Management for Serverless
https://cloudstate.io
Apache License 2.0
762 stars 97 forks source link

Error on multiple CRDT StatefulServices #142

Open politrons opened 5 years ago

politrons commented 5 years ago

Having a CRDT StatefulService, when I deploy one instance, everything work just fine, but once I deploy 2 replicas using

kubectl -n cloudstate scale deploy cloudstate-rest-connector-deployment --replicas=1 I receive this error in all pod instances

[ERROR] [11/09/2019 19:35:06.309] [StatefulService-akka.actor.default-dispatcher-11] [akka://StatefulService/system/StreamSupervisor-0/flow-6-1-mapAsyncUnordered] Error in stage [Recover(<function1>)]: Unable to find descriptor for type: type.googleapis.com/io.cloudstate.connector.RestRequest
io.cloudstate.javasupport.impl.SerializationException: Unable to find descriptor for type: type.googleapis.com/io.cloudstate.connector.RestRequest
    at io.cloudstate.javasupport.impl.AnySupport.decode(AnySupport.scala:364)
    at io.cloudstate.javasupport.impl.AnySupport.decode(AnySupport.scala:334)
    at io.cloudstate.javasupport.impl.crdt.LWWRegisterImpl$$anonfun$2.applyOrElse(LWWRegisterImpl.scala:51)
    at io.cloudstate.javasupport.impl.crdt.LWWRegisterImpl$$anonfun$2.applyOrElse(LWWRegisterImpl.scala:49)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
    at io.cloudstate.javasupport.impl.crdt.CrdtStateTransformer$.create(CrdtStateTransformer.scala:27)
    at io.cloudstate.javasupport.impl.crdt.ORMapImpl$$anonfun$3.$anonfun$applyOrElse$5(ORMapImpl.scala:189)
    at scala.collection.Iterator.foreach(Iterator.scala:941)
    at scala.collection.Iterator.foreach$(Iterator.scala:941)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
    at scala.collection.IterableLike.foreach(IterableLike.scala:74)
    at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
    at io.cloudstate.javasupport.impl.crdt.ORMapImpl$$anonfun$3.applyOrElse(ORMapImpl.scala:186)
    at io.cloudstate.javasupport.impl.crdt.ORMapImpl$$anonfun$3.applyOrElse(ORMapImpl.scala:183)
    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
    at io.cloudstate.javasupport.impl.crdt.CrdtStateTransformer$.create(CrdtStateTransformer.scala:27)
    at io.cloudstate.javasupport.impl.crdt.CrdtImpl.$anonfun$runEntity$2(CrdtImpl.scala:84)
    at scala.Option.map(Option.scala:230)
    at io.cloudstate.javasupport.impl.crdt.CrdtImpl.runEntity(CrdtImpl.scala:83)
    at io.cloudstate.javasupport.impl.crdt.CrdtImpl.$anonfun$handle$1(CrdtImpl.scala:68)
    at akka.stream.impl.fusing.Map$$anon$1.onPush(Ops.scala:54)
    at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:523)
    at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:510)

Any ides what's wrong?

Here my yaml file


apiVersion: cloudstate.io/v1alpha1
kind: StatefulService
metadata:
  name: cloudstate-rest-connector
  labels:
    app: cloudstate-rest-connector
spec:
  containers:
    - image: politrons/rest-connector:latest
---

apiVersion: v1
kind: Service
metadata:
  name: cloudstate-rest-connector-service
spec:
  type: LoadBalancer
  ports:
    - port: 2981
      targetPort: 8013
  selector:
    app: cloudstate-rest-connector
viktorklang commented 5 years ago

@politrons Did you register that descriptor when you called: https://cloudstate.io/docs/user/lang/java/api/io/cloudstate/javasupport/CloudState.html#registerCrdtEntity(java.lang.Class,com.google.protobuf.Descriptors.ServiceDescriptor,com.google.protobuf.Descriptors.FileDescriptor...)

marcoderama commented 4 years ago

The link(s) above no longer work. Hopefully these are useful:

https://cloudstate.io/docs/core/current/user/lang/java/crdt.html#registering-the-entity

https://github.com/cloudstateio/cloudstate/blob/8dd86bcfc952dad6147a61d95252e1466a6185d6/java-support/src/main/java/io/cloudstate/javasupport/CloudState.java#L203