<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:22:20 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-10123] Support Timestamp(0,0) server replace for update (mods)</title>
                <link>https://jira.mongodb.org/browse/SERVER-10123</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a Timestamp(0,0) is sent via an update then do the server replacement of the value. &lt;/p&gt;

&lt;p&gt;Currently this behavior is only supported for the first 2 fields during an insert operation, but not updates.&lt;/p&gt;</description>
                <environment></environment>
        <key id="81540">SERVER-10123</key>
            <summary>Support Timestamp(0,0) server replace for update (mods)</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="3">Duplicate</resolution>
                                        <assignee username="scotthernandez">Scott Hernandez</assignee>
                                    <reporter username="scotthernandez">Scott Hernandez</reporter>
                        <labels>
                            <label>timestamp</label>
                            <label>transformation</label>
                            <label>update</label>
                    </labels>
                <created>Mon, 8 Jul 2013 13:26:39 +0000</created>
                <updated>Wed, 10 Dec 2014 23:04:35 +0000</updated>
                            <resolved>Fri, 11 Oct 2013 15:12:42 +0000</resolved>
                                                                    <component>Write Ops</component>
                                        <votes>6</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="463458" author="scotthernandez" created="Sat, 30 Nov 2013 00:35:45 +0000"  >&lt;p&gt;If you follow &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10911&quot; title=&quot;Add $currentDate update modifier&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10911&quot;&gt;&lt;del&gt;SERVER-10911&lt;/del&gt;&lt;/a&gt; you will see that you can use the new $currentDate update modifier in 2.5.3 (dev release) and will be in the 2.6 stable release.&lt;/p&gt;</comment>
                            <comment id="463451" author="tpneumat" created="Fri, 29 Nov 2013 23:41:56 +0000"  >&lt;p&gt;What version / release will this feature be in?&lt;/p&gt;</comment>
                            <comment id="439635" author="tpneumat" created="Fri, 11 Oct 2013 15:49:32 +0000"  >&lt;p&gt;Great.  Can&apos;t wait to try it out.&lt;/p&gt;</comment>
                            <comment id="439618" author="scotthernandez" created="Fri, 11 Oct 2013 15:36:46 +0000"  >&lt;p&gt;Yes, it is the same Timestamp type &amp;#8211; &lt;a href=&quot;http://bsonspec.org/#/specification&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bsonspec.org/#/specification&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="439612" author="tpneumat" created="Fri, 11 Oct 2013 15:32:38 +0000"  >&lt;p&gt;Hey Scott, &lt;/p&gt;

&lt;p&gt;Does $currentDate allow us to create the timestamp + unique increment like the Timestamp(0,0)?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Jeremy&lt;/p&gt;</comment>
                            <comment id="439593" author="scotthernandez" created="Fri, 11 Oct 2013 15:12:42 +0000"  >&lt;p&gt;We now have $currentDate which allows you to set either a date or timestamp on the server &amp;#8211; see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-10911&quot; title=&quot;Add $currentDate update modifier&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-10911&quot;&gt;&lt;del&gt;SERVER-10911&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="398851" author="tpneumat" created="Thu, 8 Aug 2013 18:32:16 +0000"  >&lt;p&gt;Regarding this:  &quot;This doesn&apos;t do what you suggest in a sharded environment since you don&apos;t get monotonically increasing values over a sharded collection, since there are multiple servers doing writes. Each shard (a replica set) basically will have its own oplog, and ordering of writes local to that shard.&quot;&lt;/p&gt;

&lt;p&gt;Actually, even in a shared environment, could this feature not still be used just by use the same shard key when incrementing is desired?  Yes, it would only write to 1 place per key, but by using different keys for unrelated channels, you could still scale out writes.&lt;/p&gt;</comment>
                            <comment id="391577" author="tpneumat" created="Tue, 30 Jul 2013 05:23:36 +0000"  >&lt;p&gt;Thanks Scott,&lt;/p&gt;

&lt;p&gt;Understood about sharding--I wouldn&apos;t expect sequencing to happen across multi-servers.  In our case, there are many more readers than writers, so a single replica set with many secondaries works great...just that we need to improve on this model. I recently discovered that using the MongoTimestamp isn&apos;t exactly working 100% anyway since it can still be committed to the db out of order (rare but does happen).&lt;/p&gt;

&lt;p&gt;See below where my &apos;ts&apos; i value is not in order (87 got committed before 86).&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
	&quot;ts&quot;: &lt;/p&gt;
{
		&quot;t&quot;: 1374700873,
		&quot;i&quot;: 88
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;h&quot;: NumberLong(&quot;7696705560612586844&quot;),&lt;br/&gt;
	&quot;v&quot;: 2,&lt;br/&gt;
	&quot;op&quot;: &quot;i&quot;,&lt;br/&gt;
	&quot;ns&quot;: &quot;rt01.notice&quot;,&lt;br/&gt;
	&quot;o&quot;: {&lt;br/&gt;
		&quot;ts&quot;: &lt;/p&gt;
{
			&quot;t&quot;: 1374700873,
			&quot;i&quot;: 87
		}
&lt;p&gt;,&lt;br/&gt;
		&quot;vars&quot;: &lt;/p&gt;
{
			..object here.
		},&lt;br/&gt;
		&quot;_id&quot;: &quot;0f882b762b6f9f00f76562caac6550ba&quot;&lt;br/&gt;
	}&lt;br/&gt;
}&lt;br/&gt;
&lt;br/&gt;
{&lt;br/&gt;
	&quot;ts&quot;: {
		&quot;t&quot;: 1374700873,
		&quot;i&quot;: 89
	},&lt;br/&gt;
	&quot;h&quot;: NumberLong(&quot;-6769405481799817919&quot;),&lt;br/&gt;
	&quot;v&quot;: 2,&lt;br/&gt;
	&quot;op&quot;: &quot;i&quot;,&lt;br/&gt;
	&quot;ns&quot;: &quot;rt01.notice&quot;,&lt;br/&gt;
	&quot;o&quot;: {&lt;br/&gt;
		&quot;ts&quot;: {
			&quot;t&quot;: 1374700873,
			&quot;i&quot;: 86
		},&lt;br/&gt;
		&quot;vars&quot;: {			..object here.		}
&lt;p&gt;,&lt;br/&gt;
		&quot;_id&quot;: &quot;0252a912a919c7ebd4c7d0d5020c6e13&quot;&lt;br/&gt;
	}&lt;br/&gt;
}&lt;/p&gt;
</comment>
                            <comment id="391565" author="scotthernandez" created="Tue, 30 Jul 2013 04:40:41 +0000"  >&lt;p&gt;Jeremy,&lt;/p&gt;

&lt;p&gt;Replication no longer uses this. We will see if it will fit in the update refactoring or if another modifier is a better solution. &lt;/p&gt;

&lt;p&gt;This doesn&apos;t do what you suggest in a sharded environment since you don&apos;t get monotonically increasing values over a sharded collection, since there are multiple servers doing writes. Each shard (a replica set) basically will have its own oplog, and ordering of writes local to that shard.&lt;/p&gt;

&lt;p&gt;Feel free to collect votes and add ideas/feedback here.&lt;/p&gt;</comment>
                            <comment id="391058" author="tpneumat" created="Mon, 29 Jul 2013 17:00:16 +0000"  >&lt;p&gt;HOW ABOUT THIS IDEA THAT WOULD ELIMINATE THE MongoTimestamp HACK?&lt;/p&gt;

&lt;p&gt;In the oplog, there is a &apos;ts&apos;.  Would it possible to just have a feature that will let us add this &apos;ts&apos; to our own document instead of generating one with the null hack? If so, that would be a much better and more reliable solution.  &lt;/p&gt;

&lt;p&gt;Maybe a new operator called &apos;$oplogTimestamp&apos;.&lt;/p&gt;

&lt;p&gt;db.test.save({ _id:&apos;test&apos;, &apos;info&apos;:&apos;insert and stamp&apos;, $oplogTimestamp:&lt;/p&gt;
{&apos;ts&apos;:1}
&lt;p&gt; );&lt;br/&gt;
db.test.find().pretty();&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot;: &quot;test&quot;,&lt;br/&gt;
	&quot;info&quot;: &quot;insert and stamp&quot;,&lt;br/&gt;
	&quot;ts&quot;: &lt;/p&gt;
{
		&quot;t&quot;: 1375116500,
		&quot;i&quot;: 1
	}
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;AND IN OPLOG&lt;/p&gt;

&lt;p&gt;db.oplog.rs.find().sort({$natural:-1}).limit(1).pretty()&lt;br/&gt;
{&lt;br/&gt;
	&quot;ts&quot; : &lt;/p&gt;
{
		&quot;t&quot; : 1375116500,
		&quot;i&quot; : 1
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;h&quot; : NumberLong(&quot;8697630143468493520&quot;),&lt;br/&gt;
	&quot;v&quot; : 2,&lt;br/&gt;
	&quot;op&quot; : &quot;i&quot;,&lt;br/&gt;
	&quot;ns&quot; : &quot;mydb.test&quot;,&lt;br/&gt;
	&quot;o&quot; : {&lt;br/&gt;
		&quot;_id&quot; : &quot;test&quot;,&lt;br/&gt;
		&quot;info&quot; : &quot;insert and stamp&quot;,&lt;br/&gt;
		&quot;ts&quot; : &lt;/p&gt;
{
			&quot;t&quot; : 1375116500,
			&quot;i&quot; : 1
		}
&lt;p&gt;	}&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;AND IN UPDATES&lt;/p&gt;

&lt;p&gt;db.test.update(&lt;/p&gt;
{ _id:&apos;test&apos;}
&lt;p&gt;, { $oplogTimestamp:&lt;/p&gt;
{&apos;tsu&apos;:1}
&lt;p&gt; } );&lt;br/&gt;
db.test.find();&lt;br/&gt;
{&lt;br/&gt;
	&quot;_id&quot;: &quot;test&quot;,&lt;br/&gt;
	&quot;info&quot;: &quot;insert and stamp&quot;,&lt;br/&gt;
	&quot;ts&quot;: &lt;/p&gt;
{
		&quot;t&quot;: 1375116500,
		&quot;i&quot;: 1
	}
&lt;p&gt;,&lt;br/&gt;
	&quot;tsu&quot;:&lt;/p&gt;
{
		&quot;t&quot;: 1375116850,
		&quot;i&quot;: 3
	}
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Am I just dreaming here?&lt;/p&gt;</comment>
                            <comment id="385489" author="tpneumat" created="Sat, 20 Jul 2013 19:34:06 +0000"  >&lt;p&gt;Hey Scott. &lt;/p&gt;

&lt;p&gt;While the notion that this is hack may be true, please consider for a moment why many of us want to use this hack.  Just having a &apos;$now&apos; option isn&apos;t good enough for a polling mechanism since it would be possible for 2 or more records inserted at the same time to have the same timestamp.  What is quite lovely about your MongoTimestamp is that it is guaranteed to be unique (at least in non-sharded setup).  Also, it not only provides a centrally generated timestamp, but also gives an order (increment) to these inserted records.  This lets me do some neat stuff.  For example: if &apos;ts&apos; is a MongoTimestamp, it lets us make a query such as &apos;get the next 10 records where &apos;ts&apos; is greater than last &apos;ts&apos; received-&amp;gt;sort by &apos;ts&apos;.  On response, we can take the last &apos;ts&apos; and use it for the next &apos;gte&apos; polling.  If we did this just on a time, we would consistently be skipping records (limit 10 gte a $now might give us 10 back but, there could be 3 more after with same timestamp that wouldn&apos;t be captured on next polling).  Here is our how we use this in our API:  &lt;a href=&quot;http://rtrt.me/docs/api/rest#polling&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://rtrt.me/docs/api/rest#polling&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If your Replication implementation needs this feature, why not let others use it for similar reasons.    If you support this better, MongoDB could find many more uses...I can see it becoming a great backend store for a message bus.&lt;/p&gt;

&lt;p&gt;A a regular server side timestamp might be OK if you could also provide us with a server-side auto-incrementing option.  I&apos;ve seen people talk about a findAndModify option for this, but doesn&apos;t that require some more intense locking?  And, getting a timestamp from client isn&apos;t very good idea since clients are never 100% in time sync.&lt;/p&gt;

&lt;p&gt;Finally, I&apos;m not sure why the ticket says that currently this behavior is only supported for &apos;inserts&apos; and not &apos;updates&apos;.  You can actually use the &apos;update&apos; command, but you cannot do a &apos;$set&apos; of a field with this null timestamp and have it re-stamp the field.  Being able to &apos;$set&apos; for this, and being able to use this on more than one field at a time is really all I am asking for.&lt;/p&gt;


&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Jeremy&lt;/p&gt;</comment>
                            <comment id="377052" author="scotthernandez" created="Tue, 9 Jul 2013 13:26:20 +0000"  >&lt;p&gt;Once we have &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1650&quot; title=&quot;Server Side Timestamps&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1650&quot;&gt;&lt;del&gt;SERVER-1650&lt;/del&gt;&lt;/a&gt; ($now/$date) with a update modifier that can set the date/time on the server I&apos;m not sure this is all that important and us just duplicated functionality &amp;#8211; currently using a Timestamp is really a hack and relic from the replication implementation and not something meant to be surfaced or used outside of that.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="91556">SERVER-10911</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="81034">SERVER-10113</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="12861">SERVER-1650</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>12.0</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>Tue, 9 Jul 2013 02:03:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 11 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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>
                            10 years, 11 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>tpneumat</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmo1z:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>74544</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs1w9j:</customfieldvalue>

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