[CONTROLLER-2072] Remove Kryo from atomix-storage Created: 02/Mar/23  Updated: 29/Dec/23

Status: In Review
Project: controller
Component/s: clustering
Affects Version/s: None
Fix Version/s: 8.0.5

Type: Improvement Priority: High
Reporter: Robert Varga Assignee: Samuel Schneider
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks CONTROLLER-2044 Improve sal-akka-raft serialization p... Confirmed
is blocked by CONTROLLER-2071 Switch to our fork of atomix-storage Resolved

 Description   

We do not need full serdes capabilities of Kryo, certainly not its ASM/Objenesis dependencies. Examine the interplay of sal-akka-segmented-journal with Kryo and replace it with a simpler interface, which will result in binary-compatible serialization format.

This will allow us to not shade Kryo, significantly reducing the amount of classes we ship.



 Comments   
Comment by Robert Varga [ 02/Mar/23 ]

Patches leading to https://git.opendaylight.org/gerrit/c/controller/+/104745 encapulate Kryo so users are not directly exposed to it, while defanging the implementation. At that patch Kryo is an implementation detail and can be replaced by providing an alternative to KryoJournalSerdes – which really boils down to:

  • keeping track of registration IDs and their manifestation in the serialized format
  • implementing EntryInput/EntryOutput is a binary compatible way, of which
  • perhaps readObject()/writeObject() are the most bothersome, but should boil down to Externalizable serialization, which in turn sal-akka-segmented-journal can enforce

 

Comment by Robert Varga [ 02/Mar/23 ]

Also, the @VisibleForTesting methods can actually be replaced with either a plain DataOutput.writeInt(), or perhaps WritableObjects.writeLong() – it is just testing, we do not actually need that.

Comment by Tibor Král [ 01/Jun/23 ]

In terms of us implementing EntryInput/EntryOutput in a binary compatible way, we'll probably need to directly reuse the implementation from com.esotericsoftware.kryo.io.Output and Input classes. Basically a copy-paste into our EntryInput/EntryOutput classes. I don't like this approach. Do we have any other choice? 

Comment by Robert Varga [ 01/Jun/23 ]

Depends on how much of that we are really using in the codepaths we are taking.

Generated at Wed Feb 07 19:57:08 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.