<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:19:47 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-4050] GridFS Bucket File Save stores incorrect uploadDate</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4050</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The &lt;tt&gt;gridfs_bucket_file_save&lt;/tt&gt; API is setting &lt;tt&gt;uploadDate&lt;/tt&gt; to the value returned from &lt;tt&gt;bson_monotonic_time()&lt;/tt&gt;, which is incorrect in two ways:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;tt&gt;bson_append_datetime&lt;/tt&gt; expects time as milliseconds since the epoch, whereas the monotonic time is returned in microseconds. This is fixed by a simple division (but loses precision).&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;bson_monotonic_time()&lt;/tt&gt; on POSIX returns the &lt;tt&gt;CLOCK_REALTIME&lt;/tt&gt; clock value, which is relative to &quot;an unspecified point in the past.&quot; Which &lt;em&gt;may&lt;/em&gt; be the epoch, but can be arbitrary. On my system (and several systems in CI), the return value is relative to the system uptime. This results in an &lt;tt&gt;uploadDate&lt;/tt&gt; only a few hours/days after 1970.&lt;/li&gt;
&lt;/ul&gt;

</description>
                <environment></environment>
        <key id="1806564">CDRIVER-4050</key>
            <summary>GridFS Bucket File Save stores incorrect uploadDate</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="13201">Fixed</resolution>
                                        <assignee username="colby.pike@mongodb.com">Colby Pike</assignee>
                                    <reporter username="colby.pike@mongodb.com">Colby Pike</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2021 20:59:43 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:26 +0000</updated>
                            <resolved>Wed, 4 Aug 2021 18:35:18 +0000</resolved>
                                    <version>1.9.0</version>
                                    <fixVersion>1.19.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3981230" author="JIRAUSER1260880" created="Wed, 4 Aug 2021 18:35:18 +0000"  >&lt;p&gt;Change will result in different (correct) timestamps on files uploaded with the new driver.&lt;/p&gt;</comment>
                            <comment id="3979521" author="xgen-internal-githook" created="Wed, 4 Aug 2021 01:55:17 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;vector-of-bool&apos;, &apos;email&apos;: &apos;vectorofbool@gmail.com&apos;, &apos;username&apos;: &apos;vector-of-bool&apos;}
&lt;p&gt;Message: Fix: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4050&quot; title=&quot;GridFS Bucket File Save stores incorrect uploadDate&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4050&quot;&gt;&lt;del&gt;CDRIVER-4050&lt;/del&gt;&lt;/a&gt;: Set the correct uploadDate on GridFS files (#818)&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Fix: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4050&quot; title=&quot;GridFS Bucket File Save stores incorrect uploadDate&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4050&quot;&gt;&lt;del&gt;CDRIVER-4050&lt;/del&gt;&lt;/a&gt;: Set the correct uploadDate on GridFS files&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Previously used the time from bson_get_monotonic_time(), which is&lt;br/&gt;
incorrect on most systems, as it is usually realtive to the system&lt;br/&gt;
uptime and is stored as microseconds, whereas uploadDate should be&lt;br/&gt;
stored as number of milliseconds since the Unix Epoch.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Propagate failure from bson_gettimeofday&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Make get_real_time_ms a private API (for now)&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Fix inverted error case and tests on file uploadDate&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Fix test cases that check file uploadDate to use a more precise time&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Fix integer overflow in _mongoc_get_real_time_ms on MSVC&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/c6b1ed097099f12baab5a64c515c5cf3316c4677&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/c6b1ed097099f12baab5a64c515c5cf3316c4677&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </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="10011"><![CDATA[Minor Change]]></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|hzak67:</customfieldvalue>

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