<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:43:30 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-36570] Make OplogEntry mutable</title>
                <link>https://jira.mongodb.org/browse/SERVER-36570</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The goal is to allow building OplogEntry progressively and pass OplogEntry into &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0ed9472dc8c2f85e957052f01336b1247c7a6e75/src/mongo/db/repl/oplog.cpp#L425-L437&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;logOp()&lt;/tt&gt;&lt;/a&gt;, which has 13 arguments right now, and the functions under it. This ticket is a prerequisite of that work.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5b6fbcf0dc4065d725b23c6fd3911a24e078e34d/src/mongo/db/repl/oplog_entry.h#L82-L97&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Building oplog entry&lt;/a&gt; with 16 arguments is cumbersome and hard to read. We&apos;ve seen people define various &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4e8b282809ba28eb2da14435a91981a3821343e1/src/mongo/db/s/session_catalog_migration_source.cpp#L78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;makeOplogEntry()&lt;/tt&gt; helpers&lt;/a&gt;, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/52b2cc0886cdb992e2491067bdc029301d5bb6af/src/mongo/db/session_test.cpp#L61&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;especially&lt;/a&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35757e8ef3134fad1a09cb09a69882929d9ebb76/src/mongo/db/repl/sync_tail_test.cpp#L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;in&lt;/a&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f23b7e7bf3a2960b76a29709a7adeba0effa6b42/src/mongo/db/transaction_history_iterator_test.cpp#L60&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tests&lt;/a&gt;, to ease it. The ticket will help on that too.&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31356&quot; title=&quot;make OplogEntry immutable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31356&quot;&gt;&lt;del&gt;SERVER-31356&lt;/del&gt;&lt;/a&gt;, we made OplogEntry immutable because the comparison compares &lt;tt&gt;raw&lt;/tt&gt;. We also used to use BSONObj everywhere to reference an oplog entry. Besides, OplogEntry isn&apos;t referenced as &lt;tt&gt;const&lt;/tt&gt;, so it&apos;s safer to make them immutable.&lt;/p&gt;

&lt;p&gt;As of now, I think it&apos;s possible to make OplogEntry mutable again.&lt;/p&gt;

&lt;p&gt;The comparison of OplogEntry is only called by &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a9cb61a6ebe8e7dd04f81da40663d335ccbe26ef/src/mongo/db/repl/oplog_applier.cpp#L188&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dasserts&lt;/a&gt; and in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35757e8ef3134fad1a09cb09a69882929d9ebb76/src/mongo/db/repl/sync_tail_test.cpp#L496&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tests&lt;/a&gt;. It&apos;s fine to replace them with a slower version or invariant &lt;tt&gt;raw&lt;/tt&gt; is set.&lt;/p&gt;

&lt;p&gt;After &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=benety.goh&quot; class=&quot;user-hover&quot; rel=&quot;benety.goh&quot;&gt;benety.goh&lt;/a&gt;&apos;s applier refactoring, OplogEntry replaces BSONObj in the whole oplog application process after popping from the oplog buffer (&lt;tt&gt;SyncTail::tryPopAndWaitForMore&lt;/tt&gt;). The &lt;tt&gt;raw&lt;/tt&gt; field is only used at where we write down the original oplog entry on secondary, which makes sense for performance reasons. We could make &lt;tt&gt;raw&lt;/tt&gt; private as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5b6fbcf0dc4065d725b23c6fd3911a24e078e34d/src/mongo/db/repl/oplog_entry.h#L156&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this comment&lt;/a&gt; says, expose a getter and add an invariant to ensure it&apos;s set.&lt;/p&gt;

&lt;p&gt;We&apos;ll need to audit the types in secondary oplog application to make sure OplogEntry is referenced as &lt;tt&gt;const&lt;/tt&gt; everywhere. Another idea is to rename &lt;tt&gt;OplogEntry&lt;/tt&gt; to &lt;tt&gt;MutableOplogEntry&lt;/tt&gt; and make &lt;tt&gt;OplogEntry&lt;/tt&gt; as &lt;tt&gt;const MutableOplogEntry&lt;/tt&gt;.&#160;&lt;a href=&quot;https://stackoverflow.com/questions/4908539/a-way-in-c-to-hide-a-specific-function&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Private inheritance or&#160;explicitly&#160;&lt;tt&gt;delete&lt;/tt&gt;&#160;the inherited methods&lt;/a&gt; in a subclass are&#160;other ideas.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="586381">SERVER-36570</key>
            <summary>Make OplogEntry mutable</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="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="lingzhi.deng@mongodb.com">Lingzhi Deng</assignee>
                                    <reporter username="siyuan.zhou@mongodb.com">Siyuan Zhou</reporter>
                        <labels>
                            <label>former-quick-wins</label>
                    </labels>
                <created>Fri, 10 Aug 2018 07:06:56 +0000</created>
                <updated>Sun, 29 Oct 2023 22:29:04 +0000</updated>
                            <resolved>Thu, 13 Jun 2019 14:25:30 +0000</resolved>
                                                    <fixVersion>4.2.1</fixVersion>
                    <fixVersion>4.3.1</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2402561" author="xgen-internal-githook" created="Fri, 30 Aug 2019 21:44:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Lingzhi Deng&apos;, &apos;username&apos;: &apos;ldennis&apos;, &apos;email&apos;: &apos;lingzhi.deng@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36570&quot; title=&quot;Make OplogEntry mutable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36570&quot;&gt;&lt;del&gt;SERVER-36570&lt;/del&gt;&lt;/a&gt;: make OplogEntryBase mutable but keep OplogEntry immutable&lt;/p&gt;

&lt;p&gt;Also make OplogEntry.raw private&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 25f11192a656ff72a2fe54e8b5e1373f84381953)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d046020279c3a1af2d9c05d40cdaef84610f611d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d046020279c3a1af2d9c05d40cdaef84610f611d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2281730" author="xgen-internal-githook" created="Wed, 12 Jun 2019 19:20:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Lingzhi Deng&apos;, &apos;email&apos;: &apos;lingzhi.deng@mongodb.com&apos;, &apos;username&apos;: &apos;ldennis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36570&quot; title=&quot;Make OplogEntry mutable&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36570&quot;&gt;&lt;del&gt;SERVER-36570&lt;/del&gt;&lt;/a&gt;: make OplogEntryBase mutable but keep OplogEntry immutable&lt;/p&gt;

&lt;p&gt;Also make OplogEntry.raw private&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/25f11192a656ff72a2fe54e8b5e1373f84381953&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/25f11192a656ff72a2fe54e8b5e1373f84381953&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="438772">SERVER-31356</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="553207">SERVER-35353</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="606225">SERVER-37180</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16775"><![CDATA[v4.2]]></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, 11 Jun 2019 14:28:42 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 23 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1449</customfieldvalue>
                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 23 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu5607:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hur01z:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3000">Repl 2019-06-17</customfieldvalue>

                        </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|hu4s9j:</customfieldvalue>

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