Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSBTreeRidBag cannot be cast to OEmbeddedRidBag #9499

Closed
johny65 opened this issue Dec 28, 2020 · 3 comments
Closed

OSBTreeRidBag cannot be cast to OEmbeddedRidBag #9499

johny65 opened this issue Dec 28, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@johny65
Copy link

johny65 commented Dec 28, 2020

OrientDB Version: 3.1.6

Java Version: openjdk version "11.0.9.1"

OS: Ubuntu 20.10

Expected behavior

To activate the tree implementation of ridbags (setting -DridBag.embeddedToSbtreeBonsaiThreshold = -1) and use the database without problems, as the documentation says: "By default newly created RidBags are embedded and they are automatically converted to tree-based after reaching a threshold." This works fine in 3.0.x version.

Actual behavior

When the mentioned option is set, all vertices are unusable. The following exception is thrown:

Error deserializing record with id #10:0 send this data for debugging: ARwIbmFtZQYHCG91dF8IFgRWMQECLAA=  [ORecordSerializerBinary]$ANSI{green {db=test2}} Error while binary response serialization
com.orientechnologies.orient.core.exception.OSerializationException: Error on unmarshalling record #10:0 (java.lang.ClassCastException: class com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag cannot be cast to class com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag (com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag and com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag are in unnamed module of loader 'app'))
	DB name="test2"
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeRecord(OMessageHelper.java:76)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeIdentifiable(OMessageHelper.java:57)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeDocument(OMessageHelper.java:458)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeVertex(OMessageHelper.java:439)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeResult(OMessageHelper.java:467)
	at com.orientechnologies.orient.client.remote.message.OQueryResponse.write(OQueryResponse.java:68)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:391)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:239)
	at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:67)
Caused by: java.lang.ClassCastException: class com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag cannot be cast to class com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag (com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag and com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag are in unnamed module of loader 'app')
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.HelperClasses.readRidbag(HelperClasses.java:468)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.readRidbag(ORecordSerializerBinaryV1.java:736)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:876)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:746)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserialize(ORecordSerializerBinaryV1.java:292)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:103)
	at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:2422)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.getRecordBytes(OMessageHelper.java:89)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeRecord(OMessageHelper.java:69)
	... 8 more
java.lang.ClassCastException: class com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag cannot be cast to class com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag (com.orientechnologies.orient.core.storage.ridbag.sbtree.OSBTreeRidBag and com.orientechnologies.orient.core.db.record.ridbag.embedded.OEmbeddedRidBag are in unnamed module of loader 'app')
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.HelperClasses.readRidbag(HelperClasses.java:468)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.readRidbag(ORecordSerializerBinaryV1.java:736)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:876)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:746)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserialize(ORecordSerializerBinaryV1.java:292)
	at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:103)
	at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:2422)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.getRecordBytes(OMessageHelper.java:89)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeRecord(OMessageHelper.java:69)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeIdentifiable(OMessageHelper.java:57)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeDocument(OMessageHelper.java:458)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeVertex(OMessageHelper.java:439)
	at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeResult(OMessageHelper.java:467)
	at com.orientechnologies.orient.client.remote.message.OQueryResponse.write(OQueryResponse.java:68)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:391)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:239)
	at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:67)

Steps to reproduce

  • Open the server with default options.
  • In console:
$ orientdb> create database remote:localhost/test2 root pass;

Creating database [remote:localhost/test2] using the storage type [PLOCAL]...
Database created successfully.

Current database is: remote:localhost/test2

$ orientdb {db=test2}> script sql
[Started multi-line command. Type just 'end' to finish and execute]
orientdb {db=test2}> let $v1 = create vertex V set name = 'V1';
orientdb {db=test2}> let $v2 = create vertex V set name = 'V2';
orientdb {db=test2}> create edge from $v1 to $v2;
orientdb {db=test2}> end
  • Now open server with -DridBag.embeddedToSbtreeBonsaiThreshold = -1.
  • In console:
$ orientdb> connect remote:localhost/test2 admin admin;
IMPORTANT! Using default password is unsafe, please change password for user 'admin' on database 'test2'
Connecting to database [remote:localhost/test2] with user 'admin'...OK
orientdb {db=test2}> select from v;

Error: com.orientechnologies.common.io.OIOException

Error: java.io.EOFException
@lvca lvca added the bug label Jan 11, 2021
@tglman tglman added this to the 3.1.x milestone Feb 23, 2022
@suneelkumarch
Copy link

Taggin myself in here, as I am experiencing this observation, too!

@tglman this does not seem to have fixed with 3.2.18. I have observed the same behavior with 3.2.18

tglman added a commit that referenced this issue Sep 5, 2023
@tglman
Copy link
Member

tglman commented Sep 5, 2023

Hi,

I figured out why this happen, sometimes the server may have a setting that do not ever embedded ridbag, but the client still create that and send them to the server, but the server following the server setting fail in the cast, the specific cast was actually not needed I changed it to a more generic, this should be fixed in the next hotfix 3.2.23

Regards

@tglman tglman modified the milestones: 3.1.x, 3.2.23 Sep 5, 2023
@tglman
Copy link
Member

tglman commented Sep 21, 2023

Hi,

the 3.2.23 is out, closing this.

@tglman tglman closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants