<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:38:25 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>[GODRIVER-2364] A single InsertOne() API invocation causes unexpected two write operations</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2364</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;1Summary&quot;&gt;&lt;/a&gt;1 Summary&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;I wrote a piece of golang code to insert a document&lt;/em&gt; &lt;em&gt;by using insertOne() API&lt;/em&gt;&lt;em&gt;, however, two field values of the values of the newly inserted document were incorrect.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This problem was recreated through mongosh CLI as well.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The problem is that a single db.arboralerts.insertOne() command produced two write operations while the second write operation was clearly unwanted? And it&apos;s the second write operation that created incorrect result. I wonder where the second write/modify operation came from. I wonder who issued the second write op that&apos;s definitely unwanted.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Golang Mongodb driver version: 1.8.4&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;MongoDBserverversion%3A3.6.23&quot;&gt;&lt;/a&gt;MongoDB server version: 3.6.23&lt;/h4&gt;
&lt;h4&gt;&lt;a name=&quot;Topo%3Areplicaset&quot;&gt;&lt;/a&gt;Topo: replica set&lt;/h4&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;2HowtoReproduce&quot;&gt;&lt;/a&gt;2 How to Reproduce&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Steps to reproduce. If possible, please include a &lt;a href=&quot;http://sscce.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Short, Self Contained, Correct (Compilable), Example&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1) issue an insertOne()&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;rs0 &lt;span class=&quot;error&quot;&gt;&amp;#91;primary&amp;#93;&lt;/span&gt; attacklogger&amp;gt; db.arboralerts.insertOne(&lt;/p&gt;

&lt;p&gt;... &#160; {&#160; &#160;&lt;/p&gt;

&lt;p&gt;..... &#160; &#160; id: &apos;25e4593f-5341-4c4c-934e-2c3112c14213&apos;,&lt;/p&gt;

&lt;p&gt;..... &#160; &#160; customer: &apos;SP_SICHUANMO&apos;,&lt;/p&gt;

&lt;p&gt;..... &#160; &#160; details: {&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; alerttype: &apos;intf_status&apos;,&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; starttime: ISODate(&quot;2021-12-04T06:09:13.000Z&quot;),&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; stoptime: ISODate(&quot;2021-12-04T06:09:14.000Z&quot;),&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; importance: Long(&quot;2&quot;),&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; ongoing: true,&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; &#160; subobject: {&lt;/p&gt;

&lt;p&gt;......... &#160; &#160; &#160; &#160; subobjectdos: &lt;/p&gt;
{

........... &#160; &#160; &#160; &#160; &#160; hostaddress: &apos;195.244.198.98-lcy-SP_BWIN_GRE-TE_GIB-0000333&apos;

........... &#160; &#160; &#160; &#160; }
&lt;p&gt;&#160; &#160;&lt;/p&gt;

&lt;p&gt;......... &#160; &#160; &#160; }&#160; &#160;&lt;/p&gt;

&lt;p&gt;....... &#160; &#160; }, &#160;&lt;/p&gt;

&lt;p&gt;..... &#160; &#160; provider: &apos;ifstatnotif&apos;&lt;/p&gt;

&lt;p&gt;..... &#160; }&#160; &#160;&lt;/p&gt;

&lt;p&gt;...&#160;&lt;/p&gt;

&lt;p&gt;... )&lt;/p&gt;

{

&#160; acknowledged: true,

&#160; insertedId: ObjectId(&quot;6244bc7cf20ab78056db86d4&quot;)

}

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;2) Immediately issued the following query, and got correct result&lt;/p&gt;

&lt;p&gt;rs0 &lt;span class=&quot;error&quot;&gt;&amp;#91;primary&amp;#93;&lt;/span&gt; attacklogger&amp;gt; db.arboralerts.find({ &quot;details.alerttype&quot;: /intf/ })&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;&#160; {&lt;/p&gt;

&lt;p&gt;&#160; &#160; _id: ObjectId(&quot;6244bc7cf20ab78056db86d4&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; id: &apos;25e4593f-5341-4c4c-934e-2c3112c14213&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; customer: &apos;SP_SICHUANMO&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; details: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; alerttype: &apos;intf_status&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; starttime: ISODate(&quot;2021-12-04T06:09:13.000Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; stoptime: ISODate(&quot;2021-12-04T06:09:14.000Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; importance: Long(&quot;2&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; ongoing: true,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; subobject: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; subobjectdos: &lt;/p&gt;
{

&#160; &#160; &#160; &#160; &#160; hostaddress: &apos;195.244.198.98-lcy-SP_BWIN_GRE-TE_GIB-0000333&apos;

&#160; &#160; &#160; &#160; }
&lt;p&gt;&#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; }&#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; }, &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; provider: &apos;ifstatnotif&apos;&lt;/p&gt;

&lt;p&gt;&#160; }&lt;/p&gt;

&lt;p&gt;]&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;3) However, continued to issue the same query in two seconds, and as shown below, the returned query result became incorrect, where &apos;ongoing&apos; was changed from &apos;true&apos; to &apos;false&apos; and &apos;stoptime&apos; got changed from ISODate(&quot;2021-12-04T06:09:14.000Z&quot;), to ISODate(&quot;2021-12-04T07:09:13.000Z&quot;).&lt;/p&gt;

&lt;p&gt;rs0 &lt;span class=&quot;error&quot;&gt;&amp;#91;primary&amp;#93;&lt;/span&gt; attacklogger&amp;gt; db.arboralerts.find({ &quot;details.alerttype&quot;: /intf/ })&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;&#160; {&lt;/p&gt;

&lt;p&gt;&#160; &#160; _id: ObjectId(&quot;6244bc7cf20ab78056db86d4&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; id: &apos;25e4593f-5341-4c4c-934e-2c3112c14213&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; customer: &apos;SP_SICHUANMO&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; details: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; alerttype: &apos;intf_status&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; starttime: ISODate(&quot;2021-12-04T06:09:13.000Z&quot;),&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; stoptime: ISODate(&quot;2021-12-04T07:09:13.000Z&quot;),&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; importance: Long(&quot;2&quot;),&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; ongoing: false,&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; subobject: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; subobjectdos: &lt;/p&gt;
{

&#160; &#160; &#160; &#160; &#160; hostaddress: &apos;195.244.198.98-lcy-SP_BWIN_GRE-TE_GIB-0000333&apos;

&#160; &#160; &#160; &#160; }

&lt;p&gt;&#160; &#160; &#160; }&lt;/p&gt;

&lt;p&gt;&#160; &#160; },&lt;/p&gt;

&lt;p&gt;&#160; &#160; provider: &apos;ifstatnotif&apos;&lt;/p&gt;

&lt;p&gt;&#160; }&lt;/p&gt;

&lt;p&gt;]&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;4) I then checked oplog. It showed two ops were incurred.&#160;&lt;font color=&quot;#de350b&quot;&gt;Why did the above&#160;db.arboralerts.insertOne() command produced two write operations while the second write operation was clearly unwanted? And it&apos;s the second write operation that created incorrect result.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;rs0 &lt;span class=&quot;error&quot;&gt;&amp;#91;direct: primary&amp;#93;&lt;/span&gt; local&amp;gt; db.oplog.rs.find({ &quot;wall&quot;: &lt;/p&gt;
{ $gte: ISODate(&quot;2022-03-30T20:24:00.000Z&quot;) }
&lt;p&gt;, ns: &quot;attacklogger.arboralerts&quot; })&lt;/p&gt;

&lt;p&gt;[&lt;/p&gt;

&lt;p&gt;&#160; &lt;/p&gt;
{

&#160; &#160; ts: Timestamp(\{ t: 1648671868, i: 5 }
&lt;p&gt;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; t: Long(&quot;25&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; h: Long(&quot;-1732375391739529287&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; v: 2,&lt;/p&gt;

&lt;p&gt;&#160; &#160; op: &apos;i&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; ns: &apos;attacklogger.arboralerts&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; ui: UUID(&quot;89a562fc-c301-4908-abde-5aec99a37405&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; wall: ISODate(&quot;2022-03-30T20:24:28.977Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; lsid: &lt;/p&gt;
{

&#160; &#160; &#160; id: UUID(&quot;a6e50a9b-de68-40d0-a6c7-8f8c6d307e3a&quot;),

&#160; &#160; &#160; uid: Binary(Buffer.from(&quot;5e749eb669bcd1cd41cb3edec0f640c4462283c91bd22fda79c04a0c9bfba5bf&quot;, &quot;hex&quot;), 0)

&#160; &#160; }
&lt;p&gt;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; txnNumber: Long(&quot;3&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; stmtId: 0,&lt;/p&gt;

&lt;p&gt;&#160; &#160; prevOpTime: { ts: Timestamp(&lt;/p&gt;
{ t: 0, i: 0 }
&lt;p&gt;), t: Long(&quot;-1&quot;) },&lt;/p&gt;

&lt;p&gt;&#160; &#160; o: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; _id: ObjectId(&quot;6244bc7cf20ab78056db86d4&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; id: &apos;25e4593f-5341-4c4c-934e-2c3112c14213&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; customer: &apos;SP_SICHUANMO&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; details: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; alerttype: &apos;intf_status&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; starttime: ISODate(&quot;2021-12-04T06:09:13.000Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; stoptime: ISODate(&quot;2021-12-04T06:09:14.000Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; importance: Long(&quot;2&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; ongoing: true,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; subobject: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; subobjectdos: &lt;/p&gt;
{

&#160; &#160; &#160; &#160; &#160; &#160; hostaddress: &apos;195.244.198.98-lcy-SP_BWIN_GRE-TE_GIB-0000333&apos;

&#160; &#160; &#160; &#160; &#160; }

&lt;p&gt;&#160; &#160; &#160; &#160; }&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; },&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; provider: &apos;ifstatnotif&apos;&lt;/p&gt;

&lt;p&gt;&#160; &#160; }&lt;/p&gt;

&lt;p&gt;&#160; },&lt;/p&gt;

&lt;p&gt;&#160; { &lt;font color=&quot;#FF0000&quot;&gt;### &amp;lt;------------- this op was unexpected, I wonder who issued this op?&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160; &#160; ts: Timestamp({ t: 1648671878, i: 5 }),&lt;/p&gt;

&lt;p&gt;&#160; &#160; t: Long(&quot;25&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; h: Long(&quot;8243783122415082031&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; v: 2,&lt;/p&gt;

&lt;p&gt;&#160; &#160; op: &apos;u&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; ns: &apos;attacklogger.arboralerts&apos;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; ui: UUID(&quot;89a562fc-c301-4908-abde-5aec99a37405&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; o2: &lt;/p&gt;
{ _id: ObjectId(&quot;6244bc7cf20ab78056db86d4&quot;) }
&lt;p&gt;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; wall: ISODate(&quot;2022-03-30T20:24:38.559Z&quot;),&lt;/p&gt;

&lt;p&gt;&#160; &#160; o: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &apos;$v&apos;: 1,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &apos;$set&apos;: {&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &lt;font color=&quot;#FF0000&quot;&gt;&apos;details.ongoing&apos;: false,&#160; &#160; &#160; &#160; &#160; &#160;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#160; &#160; &#160; &#160; &apos;details.stoptime&apos;: ISODate(&quot;2021-12-04T07:09:13.000Z&quot;)&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; }&lt;/p&gt;

&lt;p&gt;&#160; &#160; }&lt;/p&gt;

&lt;p&gt;&#160; }&lt;/p&gt;

&lt;p&gt;]&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;It doesn&apos;t happen with standalone mongodb server.&#160;&lt;/p&gt;

&lt;p&gt;It doesn&apos;t happen with insertion of a document with timestamp (for starttime/stoptime) being recent or future timestamps such as.&#160;ISODate(&quot;2025-12-04T06:09:13.000Z&quot;)&lt;/p&gt;</description>
                <environment></environment>
        <key id="2014440">GODRIVER-2364</key>
            <summary>A single InsertOne() API invocation causes unexpected two write operations</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="9">Done</resolution>
                                        <assignee username="benji.rewis@mongodb.com">Benji Rewis</assignee>
                                    <reporter username="gctang20@gmail.com">Gary Tang</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Apr 2022 18:19:51 +0000</created>
                <updated>Tue, 19 Apr 2022 15:27:20 +0000</updated>
                            <resolved>Tue, 19 Apr 2022 15:27:20 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4491311" author="benji.rewis" created="Tue, 19 Apr 2022 15:27:20 +0000"  >&lt;p&gt;No worries, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gctang20%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;gctang20@gmail.com&quot;&gt;gctang20@gmail.com&lt;/a&gt; ! Happy to help out and glad you were able to find the underlying issue. Feel free to reopen this ticket or create new one if you find an issue.&lt;/p&gt;</comment>
                            <comment id="4486681" author="JIRAUSER1265745" created="Sat, 16 Apr 2022 03:36:03 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=benji.rewis%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;benji.rewis@mongodb.com&quot;&gt;benji.rewis@mongodb.com&lt;/a&gt;, thank you for helping look into this. Your comment helped me looking into the probable background process, which I also had suspected. After I checked with a couple of other teams, it turns out there is indeed a background service that is polling this collection and updating the documents dynamically.&lt;/p&gt;

&lt;p&gt;So it&apos;s a false alarm, not really an issue.&#160;&lt;/p&gt;

&lt;p&gt;I&apos;m so sorry for the confusion, and thank you so much for looking into this and pointing to the right direction.&#160;&lt;/p&gt;</comment>
                            <comment id="4477460" author="benji.rewis" created="Tue, 12 Apr 2022 15:51:09 +0000"  >&lt;p&gt;Hello again, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gctang20%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;gctang20@gmail.com&quot;&gt;gctang20@gmail.com&lt;/a&gt;! Very odd indeed. The first thing I&#8217;ll say is that because this extra operation you&#8217;re seeing happens in both mongosh &lt;em&gt;and&lt;/em&gt; the Go driver, it&#8217;s unlikely that there&#8217;s strictly a bug in the Go driver here. Unless you consider retryable writes, the Go driver only sends one &lt;tt&gt;insert&lt;/tt&gt; operation per call to the &lt;tt&gt;InsertOne&lt;/tt&gt; method. And, that second, unexpected operation is an &lt;tt&gt;update&lt;/tt&gt; that does not resemble the first insert, so it&#8217;s certainly not a retry of the original operation. I&#8217;ve modified your code slightly in &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/372709/372709_doublewrite.go&quot; title=&quot;doublewrite.go attached to GODRIVER-2364&quot;&gt;doublewrite.go&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; and can&#8217;t seem to find anything out of the ordinary (neither stoptime nor ongoing seems to change between two sequential find operations). Unrelatedly, if you&apos;d like your documents to have named fields in the encoded BSON, you should use &lt;tt&gt;bson&lt;/tt&gt; struct tags as I&apos;ve done in my linked code as opposed to &lt;tt&gt;json&lt;/tt&gt; ones.&lt;/p&gt;

&lt;p&gt;Do you have any other processes running that are sending writes to your server? I see that the unexpected operation has no &lt;tt&gt;txnNumber&lt;/tt&gt; (the expected insert has a &lt;tt&gt;txnNumber&lt;/tt&gt; of 3), so it could be emanating from a separate process with no acquired session. It&#8217;s also interesting that this doesn&#8217;t happen on standalones; do you have a non-standard write preference or concern set on your &lt;tt&gt;Client&lt;/tt&gt;? As far as only timestamps in the past being altered, the Go driver does almost no inspection of the contents of inserted documents, so I doubt that logic is coming from our side.&lt;/p&gt;

&lt;p&gt;Apologies that I can&#8217;t be of more help here, but I have a feeling this issue is not coming from the driver. Let me know if you can provide any more info on the questions above.&lt;/p&gt;</comment>
                            <comment id="4468617" author="JIRAUSER1265745" created="Fri, 8 Apr 2022 18:48:27 +0000"  >&lt;p&gt;Sure, here&apos;s the code:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;func (accessor *Accessor) InsertIAlert(ctx context.Context, st *IData) error {&lt;/p&gt;

&lt;p&gt;&#160; &#160; coll := accessor.db.Collection(myCollection)&lt;/p&gt;

&lt;p&gt;&#160; &#160; if coll == nil&lt;/p&gt;

{ &#160; &#160; &#160; &#160; return fmt.Errorf(&quot;%w error getting collection&quot;, errDB) &#160; &#160; }

&lt;p&gt;&#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; if _, err := coll.InsertOne(ctx, toAlert(st)); err != nil&lt;/p&gt;

{ &#160; &#160; &#160; &#160; return fmt.Errorf(&quot;%v failed in insertOne, %w&quot;, errDB, err) &#160; &#160; }

&lt;p&gt;&#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; return nil&#160;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;func toAlert(st *IData) *iAlert {&lt;/p&gt;

&lt;p&gt;&#160; &#160; timeStamp := time.Unix(st.TimestampEvent, 0)&lt;/p&gt;

&lt;p&gt;&#160; &#160; return &amp;amp;iAlert{&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; ID: &#160; &#160; &#160; uuid.NewString(),&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; Customer: st.Name,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; Provider: &quot;in&quot;,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; Details: Details{&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; AlertType:&#160; isAlert,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; Importance: high,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; StartTime:&#160; timeStamp,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; StopTime: &#160; timeStamp,&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; Ongoing:&#160; &#160; strings.ToLower(st.Status) == &quot;down&quot;,&#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; Subobject: Subobject{&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Subobjectdos: Subobjectdos&lt;/p&gt;

{ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Hostaddress: st.Meta.TunnelDestination + &quot;-&quot; + st.Location + &quot;-&quot; + st.IfAlias, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }

&lt;p&gt;, &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; &#160; &#160; }, &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; &#160; &#160; }, &#160;&lt;/p&gt;

&lt;p&gt;&#160; &#160; }&#160; &#160;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&#160;&#160; &#160; &#160; &#160; &#160; &#160;&lt;/p&gt;

&lt;p&gt;type IData struct&lt;/p&gt;

{ &#160; &#160; MD5&#160; &#160; &#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;md5&quot;` &#160; &#160; InterfacePath&#160; string &#160; &#160; &#160; `json:&quot;interface_path&quot;` &#160; &#160; TimestampEvent int64&#160; &#160; &#160; &#160; `json:&quot;event_timestamp&quot;` &#160; &#160; Name&#160; &#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;name&quot;` &#160; &#160; Location &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;node_name&quot;` &#160; &#160; Hostname &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;hostname&quot;` &#160; &#160; Devicename &#160; &#160; string &#160; &#160; &#160; `json:&quot;device_name&quot;` &#160; &#160; DeviceID &#160; &#160; &#160; int64&#160; &#160; &#160; &#160; `json:&quot;device_id&quot;` &#160; &#160; PortID &#160; &#160; &#160; &#160; int64&#160; &#160; &#160; &#160; `json:&quot;port_id&quot;` &#160; &#160; IfAlias&#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;if_alias&quot;`&#160; &#160; &#160; IfDescr&#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;if_descr&quot;` &#160; &#160; IfIndex&#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;if_index&quot;` &#160; &#160; IfName &#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;if_name&quot;` &#160; &#160; Event&#160; &#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;event&quot;` &#160; &#160; Status &#160; &#160; &#160; &#160; string &#160; &#160; &#160; `json:&quot;status&quot;` &#160; &#160; Meta &#160; &#160; &#160; &#160; &#160; GIntf `json:&quot;meta&quot;` }

&lt;p&gt;&#160; &#160; &#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160;&#160; &#160;&lt;/p&gt;

&lt;p&gt;type GIntf struct&lt;/p&gt;

{ &#160; &#160; Description &#160; &#160; &#160; string `json:&quot;description&quot;` &#160; &#160; Address &#160; &#160; &#160; &#160; &#160; string `json:&quot;ip&quot;` &#160; &#160; AddressV6 &#160; &#160; &#160; &#160; string `json:&quot;ip_v6&quot;` &#160; &#160; TunnelSource&#160; &#160; &#160; string `json:&quot;tunnel_src&quot;` &#160; &#160; TunnelDestination string `json:&quot;tunnel_dest&quot;` }

&lt;p&gt;&#160; &#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;type iAlert struct&lt;/p&gt;

{ &#160; &#160; ID &#160; &#160; &#160; string &#160; &#160; Customer string &#160; &#160; Details &#160; &#160; Provider string }

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;type Details struct&lt;/p&gt;

{ &#160; &#160; AlertType&#160; string &#160; &#160; StartTime&#160; time.Time &#160; &#160; StopTime &#160; time.Time &#160; &#160; Importance uint32 &#160; &#160; Ongoing&#160; &#160; bool&#160; &#160; &#160; Subobject }

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;type Subobject struct&lt;/p&gt;

{ &#160; &#160; Subobjectdos }

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;type Subobjectdos struct&lt;/p&gt;

{ &#160; &#160; Hostaddress string }</comment>
                            <comment id="4455986" author="esha.bhargava" created="Mon, 4 Apr 2022 19:49:21 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=gctang20%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;gctang20@gmail.com&quot;&gt;gctang20@gmail.com&lt;/a&gt; Thank you for reporting this issue. Can you please provide the code that&apos;s directly using the Go driver?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="372709" name="doublewrite.go" size="2030" author="benji.rewis@mongodb.com" created="Tue, 12 Apr 2022 15:51:29 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i08g8k:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>