<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:03:05 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-3447] journal exception during large operations within db.eval (multi update)</title>
                <link>https://jira.mongodb.org/browse/SERVER-3447</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Query is:&lt;br/&gt;
     db.ActivityEvent.update(&lt;/p&gt;
{type:&quot;NEWS&quot;}
&lt;p&gt;,&lt;br/&gt;
                    {$set: {className:&quot;com.activitystream.common.dto.News&quot;}}, false, true);&lt;/p&gt;

&lt;p&gt;Collection has 700k entries and the raw bson is about 685MB&lt;/p&gt;

&lt;p&gt;If we turn journaling off the query completes and mongo doesn&apos;t die.&lt;/p&gt;

&lt;p&gt;Attached mongodb.log.  Pertinent lines:&lt;br/&gt;
Mon Jul 18 21:37:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn88&amp;#93;&lt;/span&gt;  notifications_uat Assertion failure a &amp;lt;= 256*1024*1024 util/alignedbuilder.cpp 51&lt;/p&gt;

&lt;p&gt;Mon Jul 18 21:37:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn88&amp;#93;&lt;/span&gt; dbexception in groupCommit causing immediate shutdown: 0 assertion util/alignedbuilder.cpp:52&lt;br/&gt;
Mon Jul 18 21:37:43 Got signal: 6 (Aborted).&lt;/p&gt;</description>
                <environment>CentOS 5.6</environment>
        <key id="19865">SERVER-3447</key>
            <summary>journal exception during large operations within db.eval (multi update)</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="chrisferry">chrisferry@gmail.com</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Jul 2011 15:56:50 +0000</created>
                <updated>Tue, 12 Jul 2016 00:18:29 +0000</updated>
                            <resolved>Mon, 1 Aug 2011 23:43:06 +0000</resolved>
                                    <version>1.8.2</version>
                                    <fixVersion>1.9.2</fixVersion>
                                    <component>Stability</component>
                    <component>Storage</component>
                                        <votes>2</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="46357" author="auto" created="Thu, 4 Aug 2011 14:40:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;erh&apos;, u&apos;name&apos;: u&apos;Eliot Horowitz&apos;, u&apos;email&apos;: u&apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3447&quot; title=&quot;journal exception during large operations within db.eval (multi update)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3447&quot;&gt;&lt;del&gt;SERVER-3447&lt;/del&gt;&lt;/a&gt; we were overcounting bytes since last commit in some cases&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 3b4b0026cd2e018346bf068109ba0a9368a07eeb.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7dd8b4c1dc20f1a5bd84efae63fdca1d8cfd1bc6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7dd8b4c1dc20f1a5bd84efae63fdca1d8cfd1bc6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="46350" author="auto" created="Thu, 4 Aug 2011 14:12:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;erh&apos;, u&apos;name&apos;: u&apos;Eliot Horowitz&apos;, u&apos;email&apos;: u&apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: backport of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3447&quot; title=&quot;journal exception during large operations within db.eval (multi update)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3447&quot;&gt;&lt;del&gt;SERVER-3447&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: v1.8&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/fba78d46345423318b9eb08bcc51c733e6dc0c5e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/fba78d46345423318b9eb08bcc51c733e6dc0c5e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="46012" author="auto" created="Wed, 3 Aug 2011 03:03:25 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;dwight&apos;, u&apos;name&apos;: u&apos;dwight&apos;, u&apos;email&apos;: u&apos;dwight@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3447&quot; title=&quot;journal exception during large operations within db.eval (multi update)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3447&quot;&gt;&lt;del&gt;SERVER-3447&lt;/del&gt;&lt;/a&gt; we were overcounting bytes since last commit in some cases&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3b4b0026cd2e018346bf068109ba0a9368a07eeb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3b4b0026cd2e018346bf068109ba0a9368a07eeb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="45946" author="auto" created="Tue, 2 Aug 2011 19:58:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;stbrody&apos;, u&apos;name&apos;: u&apos;Spencer T Brody&apos;, u&apos;email&apos;: u&apos;spencer@10gen.com&apos;}
&lt;p&gt;Message: Add test for journal exception during large operations within db.eval &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3447&quot; title=&quot;journal exception during large operations within db.eval (multi update)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3447&quot;&gt;&lt;del&gt;SERVER-3447&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/681a4c7225eed0cf813f7cb5d7c1079dde9175b5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/681a4c7225eed0cf813f7cb5d7c1079dde9175b5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="45786" author="auto" created="Mon, 1 Aug 2011 23:39:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: always commitIfNeeded in multi-update. Fixes db.eval() &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3447&quot; title=&quot;journal exception during large operations within db.eval (multi update)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3447&quot;&gt;&lt;del&gt;SERVER-3447&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ad9b50e4e45ec704305173f7081100a0090de672&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ad9b50e4e45ec704305173f7081100a0090de672&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="45604" author="redbeard0531" created="Mon, 1 Aug 2011 15:13:22 +0000"  >&lt;p&gt;I think if you add $atomic:1 (&lt;a href=&quot;http://www.mongodb.org/display/DOCS/Atomic+Operations#AtomicOperations-ApplyingtoMultipleObjectsAtOnce&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/display/DOCS/Atomic+Operations#AtomicOperations-ApplyingtoMultipleObjectsAtOnce&lt;/a&gt;) to the query it will work with journaling. The issue is that we assume journal commits will happen automatically if you are not using $atomic, but you are using db.eval() to make it atomic (really isolated in ACID-speak) without using $atomic. I can fix the code to remove this assumption, but in the meantime adding $atomic should work around this while allowing you to use journaling.&lt;/p&gt;

&lt;p&gt;Implementation note: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/db/ops/update.cpp#L1295-1296&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/master/db/ops/update.cpp#L1295-1296&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="45464" author="dwight_10gen" created="Sun, 31 Jul 2011 13:11:44 +0000"  >&lt;p&gt;we will fix bug it will be a while.  in the meantime i would recommend running without journaling, or making java code that does the first case as a regular update from that code, and does what you have already above for the rest.  perhaps it is only the first multi-update that is problematic (maybe 2nd one is too though not sure would have to try).&lt;/p&gt;</comment>
                            <comment id="45463" author="epishkin" created="Sun, 31 Jul 2011 12:55:43 +0000"  >&lt;p&gt;I can not. The idea of that tool - developers add mongo queries into xml file like this&lt;/p&gt;

&lt;p&gt;&amp;lt;mongoChangeLog&amp;gt;&lt;br/&gt;
    &amp;lt;changeSet changeId=&quot;SMS-1221&quot; author=&quot;oleksii&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;script&amp;gt;&lt;br/&gt;
            db.ActivityEvent.update(&lt;/p&gt;
{type:&quot;NEWS&quot;}
&lt;p&gt;, {$set: {className:&quot;com.activitystream.common.dto.News&quot;}}, false, true);&lt;br/&gt;
        &amp;lt;/script&amp;gt;&lt;br/&gt;
    &amp;lt;/changeSet&amp;gt;&lt;/p&gt;

&lt;p&gt;    &amp;lt;changeSet changeId=&quot;SMS-1221 rename newsGuid&quot; author=&quot;oleksii&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;script&amp;gt;&lt;br/&gt;
            var events = db.ActivityEvent.find({type:&quot;NEWS_VOTED_UP&quot;, &quot;properties.newsGuid&quot;: {$exists: true}});&lt;br/&gt;
            events.forEach(function(item) {&lt;br/&gt;
                db.ActivityEvent.update({_id: item._id},&lt;br/&gt;
                        {$set: &lt;/p&gt;
{&quot;properties.guid&quot;: item.properties.newsGuid}
&lt;p&gt;, $unset: {&quot;properties.newsGuid&quot;: 1}},&lt;br/&gt;
                        false, false);&lt;br/&gt;
            });&lt;br/&gt;
        &amp;lt;/script&amp;gt;&lt;br/&gt;
    &amp;lt;/changeSet&amp;gt;&lt;/p&gt;

&lt;p&gt;    &amp;lt;changeSet changeId=&quot;SMS-1258&quot; author=&quot;oleksii&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;script&amp;gt;&lt;br/&gt;
            db.ActivityEvent.ensureIndex(&lt;/p&gt;
{&quot;type&quot;:1, &quot;properties.guid&quot;:1, &quot;active&quot;: 1}
&lt;p&gt;);&lt;br/&gt;
            db.ActivityEvent.ensureIndex(&lt;/p&gt;
{&quot;type&quot;:1, &quot;active&quot;: 1, &quot;actor&quot;: 1, &quot;timestamp&quot;: -1, &quot;rating.upVoteCount&quot;: -1}
&lt;p&gt;);&lt;br/&gt;
        &amp;lt;/script&amp;gt;&lt;br/&gt;
    &amp;lt;/changeSet&amp;gt;&lt;br/&gt;
&amp;lt;/mongoChangeLog&amp;gt;&lt;/p&gt;

&lt;p&gt;and every time application starts&lt;/p&gt;

&lt;p&gt;1. every query is verified if it has been executed or not&lt;br/&gt;
2. if it&apos;s a new query it&apos;s executed using&lt;/p&gt;

&lt;p&gt;import com.mongodb.DB;&lt;br/&gt;
public class MongeezDao {&lt;br/&gt;
private DB db;&lt;br/&gt;
public void runScript(String code) {&lt;br/&gt;
        db.eval(code);&lt;br/&gt;
}&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;I have an experimental impl of that dao that uses mongo shell instead of mongo java driver. DB doesn&apos;t crash in that mode but that impl has some problems so it&apos;s not ready to be used in the production code.&lt;/p&gt;

&lt;p&gt;I&apos;m going to test with mongodb-osx-x86_64-1.9.1.tgz and will report the result.&lt;/p&gt;</comment>
                            <comment id="45462" author="dwight_10gen" created="Sun, 31 Jul 2011 12:44:33 +0000"  >&lt;p&gt;that helps i think i know what is happening then.&lt;br/&gt;
can you use update from your tool instead of eval()?&lt;/p&gt;</comment>
                            <comment id="45461" author="epishkin" created="Sun, 31 Jul 2011 12:41:29 +0000"  >&lt;p&gt;Dwight,&lt;/p&gt;

&lt;p&gt;More details that could be helpful to fix the issue.&lt;br/&gt;
We run that update query by executing db.eval( ) in our db change management tool &lt;a href=&quot;http://mongeez.org&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongeez.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;db.eval(function() { &lt;br/&gt;
db.ActivityEvent.update(&lt;/p&gt;
{type:&quot;NEWS&quot;}
&lt;p&gt;, &lt;br/&gt;
                    {$set: {className:&quot;com.activitystream.common.dto.News&quot;}}, false, true); &lt;br/&gt;
});&lt;/p&gt;


&lt;p&gt;When I run that update query using mongo shell DB doesn&apos;t crash.&lt;/p&gt;</comment>
                            <comment id="45460" author="dwight_10gen" created="Sun, 31 Jul 2011 12:33:58 +0000"  >&lt;p&gt;there is a change that might fix this in 1.9&lt;/p&gt;

&lt;p&gt;more testing needed to be sure.&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>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="19689">SERVER-3439</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="18377">SERVER-3278</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="12362" name="mongodb.log" size="10111" author="chrisferry" created="Tue, 19 Jul 2011 15:56:50 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 31 Jul 2011 12:33:58 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 28 weeks, 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 28 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>chrisferry</customfieldvalue>
            <customfieldvalue>dwight@mongodb.com</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>epishkin</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrovjb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23209</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|ht0efz:</customfieldvalue>

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