Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13096

Java thin client: Binary type schema is not registered for nested objects when CompactFooter is enabled

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9
    • Component/s: binary
    • Labels:

      Description

      When we first time marshal object, a binary type registration request is sent to the server. This request contains schemas for deserialization (deserialization without schema is not possible when CompactFooter is enabled). If the object contains references to objects of other types these types also sent to the server, but without schemas.

      Reproducer:

      try (Ignite ignite = Ignition.start(Config.getServerConfiguration())) {
          try (IgniteClient client = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER)
              .setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(true)))
          ) {
              IgniteCache<Integer, Person[]> igniteCache = ignite.getOrCreateCache(Config.DEFAULT_CACHE_NAME);
              ClientCache<Integer, Person[]> clientCache = client.getOrCreateCache(Config.DEFAULT_CACHE_NAME);
      
              Person[] val = new Person[] {new Person(1, "Joe")};
              clientCache.put(1, val);
              assertArrayEquals(val, igniteCache.get(1));
          }
      }
      

      Fails with exception:

      Caused by: class org.apache.ignite.binary.BinaryObjectException: Cannot find schema for object with compact footer [typeName=org.apache.ignite.client.Person, typeId=1468224522, missingSchemaId=970781171, existingSchemaIds=[]]
          at org.apache.ignite.internal.binary.BinaryReaderExImpl.getOrCreateSchema(BinaryReaderExImpl.java:2028) at org.apache.ignite.internal.binary.BinaryReaderExImpl.<init>(BinaryReaderExImpl.java:287)
          at org.apache.ignite.internal.binary.BinaryReaderExImpl.<init>(BinaryReaderExImpl.java:186)
          at org.apache.ignite.internal.binary.BinaryObjectImpl.reader(BinaryObjectImpl.java:830)
          at org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:793)

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex_pl Aleksey Plekhanov
                Reporter:
                alex_pl Aleksey Plekhanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m