MappedUDTCodec might serialize fields in the wrong order

Description

I have a java class with @UDT and @Field annotations, the automatic mapping used to wrok with 2.1 but does not work anymore with 2.2.0-rc2.

It is difficult for me to provide a sample test because our project have another layer above the driver.

I think I found the problem in the com.datastax.driver.mapping.MappedUDTCodec.deserialize(ByteBuffer, ProtocolVersion) method. The mapping is correctly read but the ByteBuffer deserialization is done as values are read rather than explicitly requesting each field of the UDT.

I attached a fix proposal to this Jira issue.

Environment

Cassandra 2.2.0

Pull Requests

None

Activity

Show:
Alexandre Dutra
October 26, 2015, 1:25 PM

your patch is outdated wrt the current 3.0 branch. We do not create an intermediary UDTValue instance anymore when deserializing. Are you still able to reproduce this bug? If yes, please provide a code snippet that shows how to reproduce.

Jacques-Henri Berthemet
October 28, 2015, 5:11 AM

I'm currently OOO for two weeks, I'll test again when I'll be back.

Can I use V3.0 driver with Cassandra 2.2?

Alexandre Dutra
October 28, 2015, 12:16 PM

Can I use V3.0 driver with Cassandra 2.2?

Yes.

Olivier Michallat
November 16, 2015, 11:24 AM

It's been reported by another user on the mailing list (thread). As hinted by Jacques-Henri, the problem is that we serialize UDT field in the order that they come from annotation parsing, which might be different from the correct UDT definition order.

Jacques-Henri Berthemet
January 29, 2016, 8:52 AM

FYI we upgraded to 3.0 rc1 and problem is fixed, thx!

Fixed

Assignee

Olivier Michallat

Reporter

Jacques-Henri Berthemet

Labels

PM Priority

None

Reproduced in

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Components

Priority

Critical
Configure