<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:30:11 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-53188] Consider implementing a cursor &apos;reserve&apos; feature</title>
                <link>https://jira.mongodb.org/browse/SERVER-53188</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This came up as a part of the resharding project, as resharding oplog application is subject to write skew. An initial thought was that if the server had a reserve feature that exposed &lt;a href=&quot;https://source.wiredtiger.com/develop/struct_w_t___c_u_r_s_o_r.html#a3acc1fd180c4a4220b459734305c90a6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;WT&apos;s reserve method&lt;/a&gt;, we could use this to generate write conflicts and avoid write skew. For now, we have instead implemented functionality that will first read a doc, and then do an unreplicated no-op update on this doc in order to get the desired behavior. After speaking with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; , we think that it&apos;s still worthwhile to consider implementing a &apos;reserve&apos; feature to be used instead because:&lt;/p&gt;

&lt;p&gt;1. This code path will be executed for every oplog entry a given resharding recipient applies, and a &apos;reserve&apos; method would have less of an impact on the WT cache.&lt;br/&gt;
 2. &apos;reserve&apos; would not generate oplog entries, and so wouldn&apos;t need any extra code to avoid generating oplog entries that we have now&lt;/p&gt;</description>
                <environment></environment>
        <key id="1557468">SERVER-53188</key>
            <summary>Consider implementing a cursor &apos;reserve&apos; feature</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-execution">Backlog - Storage Execution Team</assignee>
                                    <reporter username="janna.golden@mongodb.com">Janna Golden</reporter>
                        <labels>
                            <label>pavi-interest</label>
                    </labels>
                <created>Wed, 2 Dec 2020 19:50:01 +0000</created>
                <updated>Tue, 6 Dec 2022 01:42:38 +0000</updated>
                                                                            <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="3588759" author="alexander.gorrod" created="Fri, 29 Jan 2021 00:16:02 +0000"  >&lt;p&gt;Thanks for following up and for the detailed explanation.&lt;/p&gt;

&lt;p&gt;It&apos;s not simple to change the WiredTiger &lt;tt&gt;reserve&lt;/tt&gt; operation to remain in place after a WiredTiger transaction is resolved, so it sounds like the no-op approach is the best solution.&lt;/p&gt;</comment>
                            <comment id="3585938" author="daniel.gottlieb@10gen.com" created="Wed, 27 Jan 2021 20:55:11 +0000"  >&lt;p&gt;To follow up on Alex&apos; questions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;1) What does a no-op operation translate to in terms of a WiredTiger operation. Does it translate into an insert operation of exactly the same document as previously existed?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Correct&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;2) Is this mechanism being used to protect based on timestamps?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;That&apos;s an astute observation, but I don&apos;t think it&apos;s the kind of timestamps you&apos;re concerned with. These operations will replicate normally(-ish)[1] so they&apos;ll get legal timestamp values (meaning the update chain will always be in ascending/descending timestamp order, whichever order you prefer to think about it). Timestamps from the sharding perspective make this mechanism &quot;fun&quot;. &lt;/p&gt;

&lt;p&gt;Consider an update that changes a shard key on a document. This turns into a delete on one shard and an insert into another. MDB does not guarantee that the TS(delete) &amp;lt; TS (insert), so when resharding is applying these oplog entries from different oplogs, it has to resolve these sorts of conflicts.&lt;/p&gt;

&lt;p&gt;But the way to think about this from WT&apos;s perspective is that a primary does all the work of &quot;cloning&quot; some initial data (replicated) and applying the changes (which may have spanned across multiple shards as the document moves). It&apos;s not possible in all cases to tell the exact order the global set of oplog entries need to be applied, so resharding has an algorithm where, effectively, each individual oplog is applied in order, but the operations across oplogs can be applied concurrently.&lt;/p&gt;

&lt;p&gt;[1] Some discussion brought up there might be cases in development that result in untimestamped updates. We&apos;ll take a closer look and make sure any of those are squashed.&lt;/p&gt;</comment>
                            <comment id="3585490" author="janna.golden" created="Wed, 27 Jan 2021 18:25:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; thanks for following up, in that case reserve does not have the desired behavior for the resharding use case. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=daniel.gottlieb&quot; class=&quot;user-hover&quot; rel=&quot;daniel.gottlieb&quot;&gt;daniel.gottlieb&lt;/a&gt; and I walked through a number of possible concurrent transactions that could arise during resharding, and determined that it is important that a conflict is still generated even after a transaction commits in order to ensure correctness.&lt;/p&gt;</comment>
                            <comment id="3566406" author="alexander.gorrod" created="Fri, 15 Jan 2021 00:49:13 +0000"  >&lt;p&gt;I think it&apos;s also relevant to know two further things:&lt;/p&gt;

&lt;p&gt;1) What does a no-op operation translate to in terms of a WiredTiger operation. Does it translate into an insert operation of exactly the same document as previously existed?&lt;br/&gt;
2) Is this mechanism being used to protect based on timestamps?&lt;/p&gt;</comment>
                            <comment id="3566095" author="louis.williams" created="Thu, 14 Jan 2021 21:52:01 +0000"  >&lt;p&gt;After talking with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=agorrod&quot; class=&quot;user-hover&quot; rel=&quot;agorrod&quot;&gt;agorrod&lt;/a&gt;, I understand that reserve has a distinct behavioral difference from a no-op update:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A no-op update will always generate a conflict for concurrent writes even after it commits.&lt;/li&gt;
	&lt;li&gt;reserve() will only generate a conflict while it is in an active transaction, but not after that transaction completes.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=daniel.gottlieb&quot; class=&quot;user-hover&quot; rel=&quot;daniel.gottlieb&quot;&gt;daniel.gottlieb&lt;/a&gt;/&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=janna.golden&quot; class=&quot;user-hover&quot; rel=&quot;janna.golden&quot;&gt;janna.golden&lt;/a&gt;, given this difference, can you confirm whether reserve has the desired behavior for the resharding use case? That is, would resharding be able to temporarily reserve a record and then roll-back its transaction when it no longer needs to generate conflicts, or does a conflict need to persist after a transaction completes?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25136"><![CDATA[Storage Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 14 Jan 2021 21:52:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 1 week, 6 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 1 week, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alexander.gorrod@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-execution</customfieldvalue>
            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>janna.golden@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyjzrb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr24mf:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</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|hyjm0n:</customfieldvalue>

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