<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:57:08 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-2073] Ditch Akka persistence from sal-akka-raft</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-2073</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;Our current interplay with persistence and replication is rather flawed, as we allow for way too much generic things to be pluggable through interfaces which are not designed to handle them.&lt;/p&gt;

&lt;p&gt;There are four aspects here:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;we need provide the ability to efficiently send journal entries to remote peers&lt;/li&gt;
	&lt;li&gt;we need to persist those journal entries to storage, durability of which is optional, EXCEPT for ServerConfigurationPayloads, which are &lt;b&gt;always&lt;/b&gt; durable&lt;/li&gt;
	&lt;li&gt;we use a custom journal plugin, based on atomix.io&apos;s requirements &#8211; which boil down to providing RAFT on top of a rolling set of files. As Atomix has moved away from Java and do their stuff now with Go, we have adopted their code in &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;.&lt;/li&gt;
	&lt;li&gt;we use a custom snapshot plugin to store snapshots&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;We use an on-heap cache of entries serialized to byte[] to serve (1) and we use Akka Peristence to provide (2) via a custom hack, which overrides the normal durability knobs &#8211; all the while plugging in (3) and (4) into it.&lt;/p&gt;

&lt;p&gt;So we are dealing with 4 layers of indirection:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;sal-distributed-datastore, talks to&lt;/li&gt;
	&lt;li&gt;sal-akka-raft, talks to&lt;/li&gt;
	&lt;li&gt;AbstractPersistentActor, talks to&lt;/li&gt;
	&lt;li&gt;sal-akka-segmented journal, talks to&lt;/li&gt;
	&lt;li&gt;atomix-storage (which then talks to Kryo, but we are ditching that in &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;)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;At the end of the day the serialized view of each journal entry is available, through familiar 64bit ID growing index, from atomix-storage, the contents of which is in a (set of) memory-mapped files. When we need to send a stream of entries to a peer we should be able to just replay them from there, without the need to keeping anything at all on heap.&lt;/p&gt;

&lt;p&gt;The second part of the picture here is Akka Persistence protocol &#8211; which requires each object to be stored into a byte[] before anything happens to it. This absolutely sucks when combined with huge datastore writes and G1 GC&apos;s treatment of humongous objects (for which we already provide a workaround).&lt;/p&gt;

&lt;p&gt;What we really need is a streaming input/output interface, where on one side we have a Payload (say, a DataTree delta, in its native form) and on the other side we have a sequence of&#160; binary blocks (i.e. SegmentedJournal entries), where the translation between the two works in terms of DataInput/DataOutput (essentially), without intermediate byte[] or other buffers which would hold the entirety of the serialized form.&lt;/p&gt;

&lt;p&gt;So long story short, this issue is about ditching the use of AbstractPersistentActor and replace it with an explicit interface very much aligned to what atomix-storage provides, i.e. storage of bytes identified by logical numbers which we can read again if the need arises.&lt;/p&gt;</description>
                <environment></environment>
        <key id="36726">CONTROLLER-2073</key>
            <summary>Ditch Akka persistence from sal-akka-raft</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</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="tibor.kral">Tibor Kr&#225;l</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pick-next</label>
                            <label>pt</label>
                    </labels>
                <created>Thu, 2 Mar 2023 21:16:22 +0000</created>
                <updated>Mon, 15 Jan 2024 12:48:46 +0000</updated>
                                                            <fixVersion>10.0.0</fixVersion>
                                    <component>clustering</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72042" author="rovarga" created="Thu, 2 Mar 2023 21:35:43 +0000"  >&lt;p&gt;The flow should something like:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;sal-distributed-datastore defines the set of payloads that are valid for sal-akka-raft&apos;s AppendEntries and provides serdes for them&lt;/li&gt;
	&lt;li&gt;sal-akka-raft defines valid atomix-storage journal entries&lt;/li&gt;
	&lt;li&gt;sal-akka-raft uses atomix-storage to implement ReplicatedLog&lt;/li&gt;
	&lt;li&gt;sal-akka-raft handles ServerConfiguration payload ... somehow, but out-of-band, it just needs to be applied at the right position in ReplicatedLog&lt;/li&gt;
	&lt;li&gt;atomix-storage provides flexible storage sync &#8211; i.e. operational datastore it does &lt;b&gt;not&lt;/b&gt; sync data to storage, but uses the memory-mapped file region (which boils down to page cache memory on Linux) instead of usual virtual memory&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Most notably ReplicatedLog contents are always backed by SegmentedJournal, i.e. purges of JournalSegmentedFile occur when the corresponding entries are trimmed and any access to their contents (for the purposes of sending AppendEntries) go through SegmentedJournalReader.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="35828">CONTROLLER-2044</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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|i044gn:</customfieldvalue>

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