orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Binary protocol: passing class and no rid has no effect

Open nethertek opened this issue 12 years ago • 6 comments

When performing a RECORD_CREATE over the binary protocol, passing the class and no rid has no effect.

The discussion can be followed here:

https://groups.google.com/forum/embed/?place=forum/orient-database&theme=default&fragments=true&showsearch=true&showtabs=true&hideforumtitle=true&hidesubject=true&parenturl=http%3A%2F%2Fwww.orientechnologies.com%2Factive-user-community%2F#!topic/orient-database/eGX0PNpOcIU

nethertek avatar Oct 01 '14 17:10 nethertek

Hi @nethertek,

I investigate a bit, and actually the protocol wasn't designed for resolve the clusterId server side, but should be done client side. also like you see in the (documentation)[http://www.orientechnologies.com/docs/last/orientdb.wiki/Network-Binary-Protocol.html#request_record_create] the clusterId is not returned after the create operation, is returned just the position inside the cluster.

for allow this we have to review the protocol specification and return also the clusterId.

so i think if you can just solve it client side, anyway we will think about this improvement.

tglman avatar Nov 05 '14 14:11 tglman

We definitely need it for sharding, otherwise the client has to know the cluster selection strategy. @tglman please could you update the binary protocol supporting returning of clusterId?

lvca avatar Nov 05 '14 14:11 lvca

Hi @tglman,

I agree with what you say. It used to work for us this way, before 2.0 release.

However, since 2.0, the client has no way of knowing the clusterid, since each node has been automagically assigned a different clusterid. Passing the master clusterid results in "com.orientechnologies.orient.server.distributed.ODistributedException: Error on inserting into cluster 'sms' where local node 'node_a' is not the master of it, but it's 'node_b' [ 18 ]".

If we could go back to the way it was in pre 2.0, this would not present a problem.

nethertek avatar Nov 05 '14 14:11 nethertek

Going to implement it ASAP because of the cluster selection strategy

tglman avatar Nov 05 '14 15:11 tglman

should be fixed, create a new version of the protocol with the clusertId in the RECORD_CREATE response, it's seems work. update also the documentation.

tglman avatar Nov 05 '14 18:11 tglman

Great, so have you already tested retro-compatibility?

lvca avatar Nov 05 '14 18:11 lvca