<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:20:41 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>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-9526] Log messages regarding chunks not very informative when the shard key is of type BinData</title>
                <link>https://jira.mongodb.org/browse/SERVER-9526</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When the data type of the shard key is BinData, log messages regarding chunk limits and split keys are not very informative since BinData keys are printed in abbreviated form like:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ _id: BinData } --&amp;gt; { _id: BinData }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;If, on the other hand, the type of the shard key is say a number, the log messages are useful:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ _id: 103 } --&amp;gt; { _id: 206 }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;This truncation of BinData in the log messages makes it difficult to track sharding problems when BinData is used as a shard key.&lt;/p&gt;</description>
                <environment></environment>
        <key id="73796">SERVER-9526</key>
            <summary>Log messages regarding chunks not very informative when the shard key is of type BinData</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="greg_10gen">Greg Studer</assignee>
                                    <reporter username="jhn">Johan Hedin</reporter>
                        <labels>
                            <label>logging</label>
                            <label>sharding</label>
                    </labels>
                <created>Wed, 1 May 2013 16:51:33 +0000</created>
                <updated>Mon, 11 Jul 2016 17:39:40 +0000</updated>
                            <resolved>Fri, 23 May 2014 13:37:29 +0000</resolved>
                                    <version>2.2.4</version>
                    <version>2.4.3</version>
                                    <fixVersion>2.6.4</fixVersion>
                    <fixVersion>2.7.2</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="660942" author="xgen-internal-githook" created="Wed, 16 Jul 2014 18:46:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;johanhedin&apos;, u&apos;name&apos;: u&apos;Johan Hedin&apos;, u&apos;email&apos;: u&apos;johan.o.hedin@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9526&quot; title=&quot;Log messages regarding chunks not very informative when the shard key is of type BinData&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9526&quot;&gt;&lt;del&gt;SERVER-9526&lt;/del&gt;&lt;/a&gt; a more elegant solution to printout of BinData in log messages&lt;/p&gt;

&lt;p&gt;This commit changes the behaviour of BSONElement::toString() to print BinData in the same way as the other element types. It puts a cap on the lenght of the binary data in the same way as for string. Using full == true overrides the cap in the same way.&lt;/p&gt;

&lt;p&gt;Signed-off-by: Greg Studer &amp;lt;greg@10gen.com&amp;gt;&lt;br/&gt;
(cherry picked from commit 54845ac08d80b9556cbcbea711ad0529feb09c0f)&lt;br/&gt;
Branch: v2.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5bd773e65e130fc46d6969356a94400d5a37b1f6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5bd773e65e130fc46d6969356a94400d5a37b1f6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="594277" author="xgen-internal-githook" created="Fri, 23 May 2014 13:36:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;johanhedin&apos;, u&apos;name&apos;: u&apos;Johan Hedin&apos;, u&apos;email&apos;: u&apos;johan.o.hedin@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9526&quot; title=&quot;Log messages regarding chunks not very informative when the shard key is of type BinData&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9526&quot;&gt;&lt;del&gt;SERVER-9526&lt;/del&gt;&lt;/a&gt; a more elegant solution to printout of BinData in log messages&lt;/p&gt;

&lt;p&gt;This commit changes the behaviour of BSONElement::toString() to print BinData in the same way as the other element types. It puts a cap on the lenght of the binary data in the same way as for string. Using full == true overrides the cap in the same way.&lt;/p&gt;

&lt;p&gt;Signed-off-by: Greg Studer &amp;lt;greg@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/54845ac08d80b9556cbcbea711ad0529feb09c0f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/54845ac08d80b9556cbcbea711ad0529feb09c0f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="327305" author="jhn" created="Fri, 3 May 2013 06:28:01 +0000"  >&lt;p&gt;I&apos;m running the second patch my self right now on 2.4.3. My fist concern with that patch was that other pieces of code relied on BSONObject::operator&amp;lt;&amp;lt; but the comment for that function mention it&apos;s usage to be for things like log printouts. And when you use operator&amp;lt;&amp;lt; today for strings that are longer than 160 characters they will get truncated so the usage of operator&amp;lt;&amp;lt; can&apos;t be in any critical parts of the code.&lt;/p&gt;

&lt;p&gt;A quick look among the tools (like mongodump etc) show that they use there own conversion of BinData to JSON. And the shell does not use BSONObject::operator&amp;lt;&amp;lt; ether.&lt;/p&gt;

&lt;p&gt;So, based on this quick scan of the code, the second patch looks like a good solution&lt;/p&gt;</comment>
                            <comment id="327247" author="eliot" created="Fri, 3 May 2013 03:38:39 +0000"  >&lt;p&gt;Not 100% sure what the right solution is, but agree it needs improvement.  &lt;/p&gt;</comment>
                            <comment id="325861" author="jhn" created="Wed, 1 May 2013 17:39:21 +0000"  >&lt;p&gt;A more elegant fix: &lt;a href=&quot;https://github.com/johanhedin/mongo/commit/a551787f799a38f9bfdbdbaec9996d71079bfac1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/johanhedin/mongo/commit/a551787f799a38f9bfdbdbaec9996d71079bfac1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This commit fixes BSONElement::toString so that it prints out BinData &quot;correctly&quot;. It contain a cap in the same way as for strings to prevent overflow the log in cases where the bindata contain a lot of bytes.&lt;/p&gt;

&lt;p&gt;This fix should probably be moved to its own ticket for clarity, but I&apos;ll keep it here until I get some feedback. I can create a pull request for any of the solutions as well if this is something that you would like to consider.&lt;/p&gt;</comment>
                            <comment id="325834" author="jhn" created="Wed, 1 May 2013 17:14:34 +0000"  >&lt;p&gt;This is one way of fixing it: &lt;a href=&quot;https://github.com/johanhedin/mongo/commit/f97b2ce741f71420b346ed7d04f7edb09b42fa51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/johanhedin/mongo/commit/f97b2ce741f71420b346ed7d04f7edb09b42fa51&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The commit adds &lt;tt&gt;.toString(false, true)&lt;/tt&gt; to a lot of places where chunk max/min:s are printed to the log. This triggers full printout of BinData in the logs.&lt;/p&gt;

&lt;p&gt;I&apos;ll admit that this is a bit ugly and error prone since it is easy to forget to write &lt;tt&gt;.toString(false, true)&lt;/tt&gt; everywhere chunk limits and shard keys should be printed to the log. I&apos;m not sure that I have traced down all places ether, but it is a start.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="70706">SERVER-9236</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="14092">2.6.4</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 3 May 2013 03:38:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 31 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/WRITING-893'>WRITING-893</a></s>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 31 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>greg_10gen</customfieldvalue>
            <customfieldvalue>jhn</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmv0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfqsn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4317</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11856"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht0m87:</customfieldvalue>

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