<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:55:13 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-1314] Clustering : Issues with direct commit</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-1314</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;I created a unit test in DistributedDataStoreIntegrationTest that accesses 2 shards using a Tx chain:&lt;/p&gt;

&lt;p&gt;  DOMStoreWriteTransaction writeTx = txChain.newWriteOnlyTransaction();&lt;/p&gt;

&lt;p&gt;  writeTx.write(CarsModel.BASE_PATH, CarsModel.emptyContainer());&lt;br/&gt;
  writeTx.write(PeopleModel.BASE_PATH, PeopleModel.emptyContainer());&lt;/p&gt;

&lt;p&gt;  writeTx.write(CarsModel.CAR_LIST_PATH, CarsModel.newCarMapNode());&lt;br/&gt;
  writeTx.write(PeopleModel.PERSON_LIST_PATH, PeopleModel.newPersonMapNode());&lt;/p&gt;

&lt;p&gt;  DOMStoreThreePhaseCommitCohort cohort1 = writeTx.ready();&lt;/p&gt;

&lt;p&gt;  ListenableFuture&amp;lt;Boolean&amp;gt; canCommit1 = cohort1.canCommit();&lt;/p&gt;

&lt;p&gt;  DOMStoreReadWriteTransaction readWriteTx = txChain.newReadWriteTransaction();&lt;/p&gt;

&lt;p&gt;  MapEntryNode car = CarsModel.newCarEntry(&quot;optima&quot;, BigInteger.valueOf(20000));&lt;br/&gt;
  YangInstanceIdentifier carPath = CarsModel.newCarPath(&quot;optima&quot;);&lt;br/&gt;
  readWriteTx.write(carPath, car);&lt;/p&gt;

&lt;p&gt;  MapEntryNode person = PeopleModel.newPersonEntry(&quot;jack&quot;);&lt;br/&gt;
  YangInstanceIdentifier personPath = PeopleModel.newPersonPath(&quot;jack&quot;);&lt;br/&gt;
  readWriteTx.merge(personPath, person);&lt;/p&gt;

&lt;p&gt;  DOMStoreThreePhaseCommitCohort cohort2 = readWriteTx.ready();&lt;/p&gt;

&lt;p&gt;  ListenableFuture&amp;lt;Boolean&amp;gt; canCommit2 = cohort2.canCommit();&lt;/p&gt;

&lt;p&gt;  writeTx = txChain.newWriteOnlyTransaction();&lt;/p&gt;

&lt;p&gt;  writeTx.delete(personPath);&lt;/p&gt;

&lt;p&gt;  DOMStoreThreePhaseCommitCohort cohort3 = writeTx.ready();&lt;/p&gt;

&lt;p&gt;  doCommit(canCommit1, cohort1);&lt;br/&gt;
  doCommit(canCommit2, cohort2);&lt;br/&gt;
  doCommit(cohort3);&lt;/p&gt;

&lt;p&gt;The first 2 txns write to both shards and thus are coordinated commits, ie they they go thru the normal 3PC coordinated by the front-end. The 3rd txn only accesses 1 shard and thus does a direct commit, eliding the front-end 3PC coordination.&lt;/p&gt;

&lt;p&gt;The test fails with an AskTimeoutEx on the &quot;dummy&quot; canCommit for the 3rd txn, which doesn&apos;t actually send the CanCommit message but simply waits on the direct commit ReadyLocalTransaction message.&lt;/p&gt;

&lt;p&gt;I found 2 issues causing the AskTimeoutEx. When the ReadyLocalTransaction is processed for the 3rd txn, the 2nd txn&apos;s commit is still in progress so the 3rd txn&apos;s CohortEntry is queued. When the 2nd txn finishes commit, the 3rd txn&apos;s CohortEntry is dequeued and proceeds to doCanCommit. Since it&apos;s an immediate commit, it proceeds right to commit which calls the RaftActor to persist. In the debug output I saw the call to persistence but it never got the callback that persist completed. Thus it never finished the commit and sent the CommitTransactionReply which resulted in the AskTimeoutEx. &lt;/p&gt;

&lt;p&gt;The problem is that the 2nd tnx finished it&apos;s commit via a direct call to applyState from the RaftActor&apos;s persist apply callback. The shard then immediately proceeds to the 3rd txn and tries to persist the its entry but, apparently, akka&apos;s persistence isn&apos;t re-entrant. So you can&apos;t try to do another persist from a previous persist callback.&lt;/p&gt;

&lt;p&gt;I change the RaftActor to send the ApplyState message instead of calling applyState directly. However I still saw the AskTimeoutEx. The 2nd issue is that the shard was using the wrong sender when sending the CommitTransactionReply for the 3rd txn. It was using getSender() which, in this case, was the sender for the first txn. After changing it to use the correct sender from tnx 3&apos;s  CohortEntry, the test succeeded.&lt;/p&gt;

&lt;p&gt;However the test still fails sporadically b/c, due to timing, the 3rd direct commit txn can be committed before the prior coordinated commit. I still need to look into that.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="25868">CONTROLLER-1314</key>
            <summary>Clustering : Issues with direct commit</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="tpantelis">Tom Pantelis</assignee>
                                    <reporter username="tpantelis">Tom Pantelis</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 May 2015 15:35:35 +0000</created>
                <updated>Fri, 22 May 2015 23:20:00 +0000</updated>
                            <resolved>Fri, 22 May 2015 23:20:00 +0000</resolved>
                                    <version>Post-Helium</version>
                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="50633" author="tpantelis" created="Wed, 13 May 2015 20:38:51 +0000"  >&lt;p&gt;Submitted &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/20271/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/20271/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3206</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=3206]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10361"><![CDATA[Lithium-RC0]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10312"><![CDATA[High]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i02pt3:</customfieldvalue>

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