<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:01:04 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-64752] Does WT metadata change when closing a readonly WT_CONNECTION?</title>
                <link>https://jira.mongodb.org/browse/SERVER-64752</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we started implementing PM-2353, Dan Gottlieb provided &lt;a href=&quot;https://gist.github.com/ajdavis/f511a63dd607acbce82b9d0635eb346d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this helpful sketch&lt;/a&gt; that shows how to import MongoDB collections from a directory full of WT files. It follows these steps:&lt;/p&gt;

&lt;p&gt;1. Call wiredtiger_open on the directory of WT files&lt;br/&gt;
2. Fetch WT table and file metadata and save them in memory&lt;br/&gt;
3. Close the WT_CONNECTION&lt;br/&gt;
4. Select which files to import&lt;br/&gt;
5. Move selected files from temp directory to mongod&apos;s dbpath&lt;br/&gt;
6. Call WT_SESSION::create for each selected file, using metadata from step 2&lt;/p&gt;

&lt;p&gt;Dan asked, regarding step 3:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Closing WT I believe will take a checkpoint. Even though we did no logical writes, it&apos;s not obvious to me that the root node offsets we saved as part of the WT metadata sit still. The most conservative thing to do is copy the files at this step before closing WT. Obviously that&apos;s less desirable than just moving the files. Moving the files underneath WT while running will almost certainly result WT taking down the whole mongod process.&lt;/p&gt;

&lt;p&gt;Worth clarifying with WT how these files can be safely and optimally transfered to the &quot;real&quot; dbpath. If my hunch is right that moving files after closing is not safe today &amp;#8211; my guess is it&apos;s easy for WT to add configuration string to `WT_CONNECTION::close` that skips taking a checkpoint or find some equivalent solution.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Could a WiredTiger expert answer his question?&lt;/p&gt;</description>
                <environment></environment>
        <key id="2005772">SERVER-64752</key>
            <summary>Does WT metadata change when closing a readonly WT_CONNECTION?</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                            <label>shard-merge-milestone-1</label>
                    </labels>
                <created>Mon, 21 Mar 2022 18:05:53 +0000</created>
                <updated>Sun, 29 Oct 2023 21:40:47 +0000</updated>
                            <resolved>Mon, 21 Mar 2022 18:51:08 +0000</resolved>
                                                    <fixVersion>6.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4442957" author="keith.smith" created="Tue, 29 Mar 2022 19:01:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;, your guess is correct. &#160;WiredTiger&#160;&lt;a href=&quot;https://github.com/wiredtiger/wiredtiger/blob/fd276e7f8f6c8bf2817faed9e3f5461fba1d87da/src/txn/txn_recover.c#L1024&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;doesn&apos;t perform rollback-to-stable&lt;/a&gt;&#160;on a readonly connection.&#160;&lt;/p&gt;</comment>
                            <comment id="4442922" author="jesse" created="Tue, 29 Mar 2022 18:53:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=keith.smith&quot; class=&quot;user-hover&quot; rel=&quot;keith.smith&quot;&gt;keith.smith&lt;/a&gt; late-breaking question about this: Does WT execute rollback-to-stable if we open a WT database in readonly mode? If so we could call wiredtiger_open just once. But I&apos;m guessing the answer is &quot;no&quot;, since rollback-to-stable would seem to violate the &quot;readonly&quot; contract.&lt;/p&gt;</comment>
                            <comment id="4424831" author="jesse" created="Mon, 21 Mar 2022 18:50:30 +0000"  >&lt;p&gt;Let&apos;s follow Keith&apos;s suggestion. Even if our current code is safe, it relies on WT internals instead of the WT API. It&apos;s more future-proof to close and reopen with &quot;readonly=true&quot;.&lt;/p&gt;</comment>
                            <comment id="4424777" author="keith.smith" created="Mon, 21 Mar 2022 18:31:32 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Dan G is correct that WT will take a checkpoint at connection close. &#160;Normally we skip checkpoint on a file if no data has changed. I&apos;m not sure offhand whether the checkpoint at close behaves the same way. &#160;I will look into that. &#160;&lt;/p&gt;

&lt;p&gt;Regardless of the answer, an alternative that would certainly work would be to reopen the connection readonly after step #1. &#160;I.e., expand #1 to:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Call wiredtiger_open on the directory of backed up WT files&lt;/li&gt;
	&lt;li&gt;Close the connection&lt;/li&gt;
	&lt;li&gt;Open a new WT connection with the &lt;tt&gt;readonly=true&lt;/tt&gt; config setting&lt;/li&gt;
	&lt;li&gt;Continue as&#160;described&#160;above.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2005831">SERVER-64759</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>4.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>Mon, 21 Mar 2022 18:31:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 45 weeks, 1 day 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-2353</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>
                            1 year, 45 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>keith.smith@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0nz0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i06gbv:r</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></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|i0nl5z:</customfieldvalue>

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