<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:08:16 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>[CDRIVER-34] add custom C function for incremeting sequence #&apos;s</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-34</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Ahh, sorry, i misunderstood your usecase and thought you were talking&lt;br/&gt;
about thread-safety rather than process-safety. Yes, you are correct&lt;br/&gt;
and the server (and C++ driver) use platform-specific tricks to ensure&lt;br/&gt;
that we don&apos;t generate duplicate OIDs. Unfortunately that isn&apos;t&lt;br/&gt;
possible for the C driver since it shouldn&apos;t have any&lt;br/&gt;
platform-specific code.&lt;/p&gt;

&lt;p&gt;I think a good solution would be to add a set_oid_fuzz(int) method&lt;br/&gt;
that will allow users to set that as needed. I should probably also&lt;br/&gt;
allow you to use a custom inc function to use atomic incs if using&lt;br/&gt;
threading.&lt;/p&gt;

&lt;p&gt;Could you file a JIRA ticket for those?&lt;/p&gt;

&lt;p&gt;On Mon, Jan 3, 2011 at 2:48 PM, Greg Sabatino &amp;lt;gsabatino@dnsstuff.com&amp;gt; wrote:&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; Mathias:&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; Thanks for quick reply. &#160;We did see the comment in the code, but don&apos;t&lt;br/&gt;
&amp;gt; believe the atomic increment would not completely solve our use-case issue.&lt;br/&gt;
&amp;gt; &#160;Generally, we sort of hoped to get a call to &apos;rand&apos; (or other API) each&lt;br/&gt;
&amp;gt; time through. &#160;However, around the topic you mention, the only ANSI solution&lt;br/&gt;
&amp;gt; we have for you is a file system write-lock. &#160;Other solutions of course get&lt;br/&gt;
&amp;gt; into system level resource management which will vary by platform.&lt;br/&gt;
&amp;gt; Some quick things we were thinking of to improve the seeding across&lt;br/&gt;
&amp;gt; processes would be to use microseconds (rather than seconds), or (on linux)&lt;br/&gt;
&amp;gt; use a read from /dev/urandom to seed. &#160;Either should improve initial random&lt;br/&gt;
&amp;gt; values by process but are not 100% guaranteed to be unique. &#160;We did plan to&lt;br/&gt;
&amp;gt; call the randomizer each time through the routine.&lt;br/&gt;
&amp;gt; We additionally planned to look into some other solutions for uid generation&lt;br/&gt;
&amp;gt; out there, but haven&apos;t put the time in yet...&lt;br/&gt;
&amp;gt; -Greg&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; On 1/3/11 2:00 PM, &quot;Mathias Stearn&quot; &amp;lt;mathias@10gen.com&amp;gt; wrote:&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; You are correct. If you look at line 114 of bson.c you&apos;ll see a TODO&lt;br/&gt;
&amp;gt; to make the inc atomic. Unfortunately there is no way to do that in&lt;br/&gt;
&amp;gt; ANSI C. Do you know any good way to do that?&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt; On Mon, Jan 3, 2011 at 1:43 PM, Greg Sabatino &amp;lt;gsabatino@dnsstuff.com&amp;gt;&lt;br/&gt;
&amp;gt; wrote:&lt;br/&gt;
&amp;gt;&amp;gt;&lt;br/&gt;
&amp;gt;&amp;gt; Hello Mathias:&lt;br/&gt;
&amp;gt;&amp;gt;&lt;br/&gt;
&amp;gt;&amp;gt; We are in a development project, and looking to implement the C version of&lt;br/&gt;
&amp;gt;&amp;gt; the mongoDB driver (pulled down from github a few weeks back). &#160;The&lt;br/&gt;
&amp;gt;&amp;gt; &apos;oid_gen&apos; routine in the bson.c file is not quite as robust as we would&lt;br/&gt;
&amp;gt;&amp;gt; like. &#160;In our scenario, there will likely be multiple processes executing&lt;br/&gt;
&amp;gt;&amp;gt; concurrently on the same host and making connections. &#160;&#160;It&apos;s reasonable to&lt;br/&gt;
&amp;gt;&amp;gt; assume that they may hit this code block in the same second, likely&lt;br/&gt;
&amp;gt;&amp;gt; generating the same oid. &#160;&#160;Any planned rev on the driver in the near-term&lt;br/&gt;
&amp;gt;&amp;gt; that may touch this area? &#160;If not, we may take a pass at it sometime in&lt;br/&gt;
&amp;gt;&amp;gt; the&lt;br/&gt;
&amp;gt;&amp;gt; next month or two and can send back to you.&lt;br/&gt;
&amp;gt;&amp;gt;&lt;br/&gt;
&amp;gt;&amp;gt; Thanks,&lt;br/&gt;
&amp;gt;&amp;gt; -Greg&lt;br/&gt;
&amp;gt;&amp;gt;&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;&lt;/p&gt;
</description>
                <environment>C / any platform</environment>
        <key id="14163">CDRIVER-34</key>
            <summary>add custom C function for incremeting sequence #&apos;s</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="3">Duplicate</resolution>
                                        <assignee username="kbanker">Kyle Banker</assignee>
                                    <reporter username="dnsstuff">DNS Stuff</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Jan 2011 17:09:42 +0000</created>
                <updated>Wed, 3 May 2017 22:14:24 +0000</updated>
                            <resolved>Wed, 29 Jun 2011 19:14:22 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="14162">CDRIVER-33</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <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_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh6zb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>13930</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>