<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:54:15 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-936] Clustering:ShardManager does not return the leader of the Shard in FindPrimary</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-936</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;In ShardManager&apos;s FindPrimary, it attemps to return a shard replica , which may or may not be the leader of the shard. &lt;/p&gt;

&lt;p&gt;The logic to return it from the local exists, but to find the actual leader of the shard is missing.&lt;/p&gt;

&lt;p&gt;For a 3 node cluster, this might not be introducing a significant dent in the performance, as each node has atleast one replica of each shard.&lt;/p&gt;

&lt;p&gt;But when we move to more fine-grained sharding, the number of hops will be 1 more.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="25490">CONTROLLER-936</key>
            <summary>Clustering:ShardManager does not return the leader of the Shard in FindPrimary</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="kramesha@cisco.com">Kamal Rameshan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Oct 2014 17:19:40 +0000</created>
                <updated>Thu, 26 Mar 2015 21:42:40 +0000</updated>
                            <resolved>Thu, 26 Mar 2015 21:42:40 +0000</resolved>
                                    <version>Post-Helium</version>
                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="49551" author="mark.mozolewski@hp.com" created="Thu, 30 Oct 2014 00:05:49 +0000"  >&lt;p&gt;(Proposed Fix - Implemented &amp;amp; Testing)&lt;/p&gt;

&lt;p&gt;The Shard&#8217;s Leader (aka &#8220;primary&#8221;) is reported to each Shard while adjusting its behavior (changing leadership) and to report in the ShardStats MBean for JMX access. The ShardManager needs some way to identify the Shard leader without coupling the Shard and ShardMananger or being part of the election process that the RaftActor is running. &lt;/p&gt;

&lt;p&gt;My proposed fix that I&apos;ve implemented and am testing is to allow the Shard to register Leader changed listeners and report a Leader change event to those registered listeners. In this case the ShardManager will register a Leader change listener with its local shard upon that Shard&#8217;s creation (if it has one). When ShardManager#findPrimary is called it may know who the Leader is and can report that. &lt;/p&gt;

&lt;p&gt;There will still be cases where it doesn&#8217;t know who the Leader is, e.g. it doesn&#8217;t have a local shard for this shard configuration or the information has not been reported yet. In those cases #findPrimary will function as it does today where from the local shard configuration file it knows which nodes in the system have shard replicas and it reports one of those as primary to allow them complete the findPrimary request. (Note: A Shard will forward any requests to the Leader if contacted, we are just trying to optimize how often the the Leader can be identified correctly.)&lt;/p&gt;</comment>
                            <comment id="49552" author="moraja@cisco.com" created="Thu, 30 Oct 2014 17:13:18 +0000"  >&lt;p&gt;In the case where we do not have a local shard how about forwarding the findprimary to a shardmanager on a node which we do know has a local shard?&lt;/p&gt;</comment>
                            <comment id="49553" author="tpantelis" created="Wed, 11 Mar 2015 21:21:58 +0000"  >&lt;p&gt;The ShardManager now listens for RoleChangedNotificatons so it knows the raft state of each shard. I have also added a LeaderStateChange notification with &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/16328/1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/16328/1&lt;/a&gt; so the ShardManager knows the current leaderId.&lt;/p&gt;

&lt;p&gt;With these changes and &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/16164/14&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/16164/14&lt;/a&gt;, the ShardManager now returns the actual shard leader actor path from FindPrimary. Also if there is no leader yet, it waits a period of time (shardInitializationTimeout) for a leader to be elected before returning a response. If there is no leader after the timeout, it returns a NoShardLeaderException failure response.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/16194/7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/16194/7&lt;/a&gt;, if there&apos;s no local shard it forwards the FindPrimary message to another remote ShardManager.&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>2194</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=2194]]></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="10315"><![CDATA[Lithium]]></customfieldvalue>

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

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