<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:57:04 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[CONTROLLER-2044] Improve sal-akka-raft serialization protocol</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-2044</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;The cutover to Akka Artery and tell-based protocol (which puts more strain on persistence) crops up problems with serialization of our messages, like &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2037&quot; title=&quot;Fail to serialize oversized message&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2037&quot;&gt;&lt;del&gt;CONTROLLER-2037&lt;/del&gt;&lt;/a&gt; (estimates) and  &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2043&quot; title=&quot;Circuit breaker timeout with BGP and tell-based protocol&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2043&quot;&gt;CONTROLLER-2043&lt;/a&gt; (raw volume).&lt;/p&gt;

&lt;p&gt;Given that Akka has deprecated Java serialization as the protocol to use and the mentioned issues, it would be prudent to implement a better serialization protocol around Payloads, both in order to remove dependency on Java serialization and to improve its efficiency.&lt;/p&gt;

&lt;p&gt;This mostly revolves around org.opendaylight.controller.cluster.raft.messages.Payload extensibility &amp;#8211; we really want to attach a PayloadRegistry which will handle dispatch to serialization based on a single-byte type and base it on DataOutput/WritableObject interfaces. This will allow us to reduce the message overheads (which are significant).&lt;/p&gt;

&lt;p&gt;We should also deal with sal-akka-raft message serialization based on similar interface and tie it in with sal-akka-segmented-journal, so that it can operate more efficiently than through Serializable.&lt;/p&gt;</description>
                <environment></environment>
        <key id="35828">CONTROLLER-2044</key>
            <summary>Improve sal-akka-raft serialization protocol</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</priority>
                        <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Thu, 26 May 2022 20:19:44 +0000</created>
                <updated>Tue, 16 Jan 2024 09:23:06 +0000</updated>
                                                            <fixVersion>10.0.0</fixVersion>
                    <fixVersion>9.0.1</fixVersion>
                                    <component>clustering</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="71620" author="tibor.kral" created="Fri, 11 Nov 2022 03:57:42 +0000"  >&lt;p&gt;Even when we design and implement the new Serialization utils and the PayloadRegistry, we can&apos;t simply replace the old java serialization. Since this is a breaking change, we will need to support both the old solution as well as the new one. The old one will need to be deprecated first and removed in the subsequent major release.&lt;/p&gt;</comment>
                            <comment id="71719" author="rovarga" created="Fri, 2 Dec 2022 15:10:31 +0000"  >&lt;p&gt;Right, except we are more flexible than that.&lt;/p&gt;

&lt;p&gt;Our upgrade matrix says &apos;upgrade from latest SR&apos;, which means we can very much evolve the format as long as we backport the bits needed for reading to active streams. See &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2056&quot; title=&quot;Minimize serialization proxy names in controller.datastore.persisted&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2056&quot;&gt;&lt;del&gt;CONTROLLER-2056&lt;/del&gt;&lt;/a&gt;, which will enable new proxies in Chlorine SR2 and Argon, with read-size of those bits being backported to Sulfur SR3 and Chlorine SR1.&lt;/p&gt;</comment>
                            <comment id="72041" author="rovarga" created="Thu, 2 Mar 2023 21:16:44 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2071&quot; title=&quot;Switch to our fork of atomix-storage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2071&quot;&gt;&lt;del&gt;CONTROLLER-2071&lt;/del&gt;&lt;/a&gt; imports atomix-storage in a very minimal form.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2072&quot; title=&quot;Remove Kryo from atomix-storage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2072&quot;&gt;CONTROLLER-2072&lt;/a&gt; further narrows the serialization interface down so as not to expose Kryo (and eliminate it from the picture while still retaining its serialization format).&lt;/p&gt;

&lt;p&gt;This issue needs to pick up from there. Next steps are to narrow down the interface between sal-akka-segmented-journal and sal-akka-raft.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2043&quot; title=&quot;Circuit breaker timeout with BGP and tell-based protocol&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2043&quot;&gt;CONTROLLER-2043&lt;/a&gt; has interplay here, as it provides data as to what our actual binary looks like. A brief analysis shows at least uuid being repeated, but certainly are other, deeper, connections to make.&lt;/p&gt;

&lt;p&gt;The end zone is &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2073&quot; title=&quot;Ditch Akka persistence from sal-akka-raft&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2073&quot;&gt;CONTROLLER-2073&lt;/a&gt;, which ties the entire stack together.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="72043" author="rovarga" created="Thu, 2 Mar 2023 21:55:35 +0000"  >&lt;p&gt;The end-to-end serialization protocol needs to achieve something that &#160;&lt;a href=&quot;https://github.com/real-logic/aeron&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Aeron&lt;/a&gt; has integrated: a single logical message (say, CommitTransactionPayload) is not written as a single byte[] prepared beforehand, but rather is scattered into multiple fragments which have some (possibly small) maximum size &#8211; in our world each such fragment would be a single SegmentedJournal entries. These then get presented to upper layers on reception, i.e. we are looking at doing &lt;a href=&quot;#message-reassembly&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;reassembly&lt;/a&gt;.] In concrete terms this would mean that a ReplicatedLog entry is backed by multiple SegmentedJournal entries.&lt;/p&gt;

&lt;p&gt;For our implementation purposes, I think we should be okay by not exposing fragmentation explictly, but hiding it behind a DataOutput &#8211; which on writeInt() does the right thing behind the scenes. On reception, the callback would be a DataInput, which actually goes to multiple SegmentedJournal spans (suitably abstracted as ByteBuffer, or similar) and reads them as things are being read it.&lt;/p&gt;

&lt;p&gt;I am not sure this will cut it, though: the read side may be fine being synchronous, the write side, though, can hit storage allocation (i.e. when SegmentedJournal creates the next file) and at least in CSIT that operation can take almost a minute &#8211; and during that time we need to be able to handle RAFT messages, so as not to lose leadership (for example).&lt;/p&gt;</comment>
                            <comment id="72123" author="JIRAUSER14508" created="Wed, 19 Apr 2023 13:46:13 +0000"  >&lt;p&gt; &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;18710_thumb&quot; href=&quot;https://jira.opendaylight.org/secure/attachment/18710/18710_Screenshot+from+2023-04-19+15-36-12.png&quot; title=&quot;Screenshot from 2023-04-19 15-36-12.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;18710&quot; file-preview-title=&quot;Screenshot from 2023-04-19 15-36-12.png&quot;&gt;&lt;img src=&quot;https://jira.opendaylight.org/secure/thumbnail/18710/_thumb_18710.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; design of &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/controller/+/105485&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/controller/+/105485&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="72125" author="rovarga" created="Wed, 19 Apr 2023 21:28:45 +0000"  >&lt;p&gt;Right, and that&apos;s all centralized in one place and does not bring sal-akka-segmented-journal into the picture at all.&lt;/p&gt;

&lt;p&gt;So let&apos;s start at the bottom and design how will things get persisted in sal-akka-segmented-journal and atomix-storage, what interface will be available for sal-akka-raft to plug into. That includes how things will hit storage, but also how things will get restored &amp;#8211; potentially in a different version.&lt;/p&gt;

&lt;p&gt;The goal is not to rely on Serializable anywhere in the stack.&lt;/p&gt;</comment>
                            <comment id="73005" author="rovarga" created="Sun, 31 Dec 2023 11:44:57 +0000"  >&lt;p&gt;Alright, after spending a couple of days in the area, this is a tad more complicated.&lt;/p&gt;

&lt;p&gt;SegmentedJournal&apos;s API captures the RAFT journal, i.e. Journal&amp;lt;E&amp;gt; would really like to be Journal&amp;lt;ReplicatedLogEntry&amp;gt;, which is quite a bit different layer from where sal-akka-segmented-journal operates.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/c/controller/+/109487&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/controller/+/109487&lt;/a&gt; shows a prototype outline of what we would like to see w.r.t. serialization API: each entry ends up writing multiple fragments and on read it is composed of a number of read only ByteBuffer (backed by the mapped file).&lt;/p&gt;

&lt;p&gt;The end play is &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-2073&quot; title=&quot;Ditch Akka persistence from sal-akka-raft&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-2073&quot;&gt;CONTROLLER-2073&lt;/a&gt;, which ends up integrating persistence into ReplicatedLog implementation, so that the implementation deals with snapshots, trimming, persistence etc. etc.&lt;/p&gt;

&lt;p&gt;Digging into this deeper, we have two technologies available off the shelf:&lt;br/&gt;
1. Aeron Archive, which uses multiple segments and allows querying it via replay, but the problem is this functionality assumes remote access and therefore there is no way to take a reference to the off-heap DirectBuffer for efficient fragment reassembly (i.e. for messages &amp;gt;16MiB it is recommended to perform application-level reassembly). The up side is that Aeron has log replication freely available.&lt;br/&gt;
2. Chronicle Queue, which uses multiple segments and heavily assumes local control plus offers a very neat API to stored bytes (&lt;a href=&quot;https://www.javadoc.io/static/net.openhft/chronicle-bytes/2.25ea3/net/openhft/chronicle/bytes/BytesMarshallable.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.javadoc.io/static/net.openhft/chronicle-bytes/2.25ea3/net/openhft/chronicle/bytes/BytesMarshallable.html&lt;/a&gt;) with possibly being able to retain references (BytesStore and ReferenceCounted interfaces). The down side is that log replication is a commercial feature.&lt;/p&gt;

&lt;p&gt;The BytesMarshallable interface certainly looks like something we&apos;d like as the base model of how a payload gets serialized/deserialized.&lt;/p&gt;

&lt;p&gt;The second part of this is the fact that Payload users seem to want the associated Identifier &amp;#8211; all relevant implementations have some sort of identifier and those which do not can fake it. Lifecycle is quite murky, but it would seem advantageous to move the identifier into an envelope, so it is available without deserializing the entire payload (as it is at the head of it!).&lt;/p&gt;

&lt;p&gt;That brings us to the Serdes API. As the mentioned patch shows, we want to side-step the need for writeObject() in sal-akka-segmented-journal by having a each Payload type:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;having a symbolic name (plain ASCII, i.e. 0-127, bytes, so encoding is single-byte)&lt;/li&gt;
	&lt;li&gt;be dynamically bound to marshallers, so that each symbolic name has an assigned int32 (or smaller) unique to the set of known marshallers&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Based on this API, segmented-journal should be able to side-step writeObject() and thus eliminate the worst Java serialization overhead.&lt;/p&gt;

&lt;p&gt;In parallel to this, we need to fix the entry UUID duplications, which looks like something that is internal to the journal plugin and does not need any other help.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="36726">CONTROLLER-2073</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="36723">CONTROLLER-2071</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="36725">CONTROLLER-2072</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="33481">CONTROLLER-1969</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10300">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="37804">CONTROLLER-2089</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="35426">CONTROLLER-2037</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="35717">CONTROLLER-2043</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="18710" name="Screenshot from 2023-04-19 15-36-12.png" size="93200" author="SamoSchneider" created="Wed, 19 Apr 2023 13:42:55 +0000"/>
                            <attachment id="18821" name="Serialization-redesign-draft-02.png" size="227708" author="tibor.kral" created="Thu, 1 Jun 2023 09:38:57 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i042h3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>