[SERVER-1782] Data loss after $set Created: 12/Sep/10 Updated: 12/Jul/16 Resolved: 03/Nov/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.6.2 |
| Fix Version/s: | 1.6.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Heiko Weible | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows + Linux |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
To reproduce the bug, I run these 3 commands: db.bugtest.insert( { _id: ObjectId("4c8d156f6709000000001176")}); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" }}); I expect this object: { _id: ObjectId("4c8d156f6709000000001176"), "babca304b2c79a6801200000": "Test 01", "babca304b2c79a6801210000": "Test 02"}Instead, "babca304b2c79a6801200000": "Test 01" is missing: { "_id" : ObjectId("4c8d156f6709000000001176"), "babca304b2c79a6801210000" : "Test 02" } |
| Comments |
| Comment by Mathias Stearn [ 03/Nov/10 ] |
|
I've backported the changes to 1.7.x that fix this issue. You can build from git v1.6 branch now or wait until tomorrow's nightly. |
| Comment by Mathias Stearn [ 01/Nov/10 ] |
|
I have reproduced the issue on windows. It doesn't effect linux or the 1.7.x branch on windows. I'll try to isolate the issue. |
| Comment by Eliot Horowitz (Inactive) [ 15/Sep/10 ] |
|
@mathias - can you try to reproduce on windows |
| Comment by Ulrich Ahrendt [ 14/Sep/10 ] |
|
I can reproduce this on Windows 7 (32bit) + 1.6.2: > db.bugtest.drop() ); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" } }); On my Linux server (64bit) it works fine: > db.bugtest.drop() ; ); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" } }); |
| Comment by Heiko Weible [ 13/Sep/10 ] |
|
Here is the output of the linux version. 81-89-110-253:~ # mongo ); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" } }); Mon Sep 13 13:10:13 MongoDB starting : pid=13611 port=27017 dbpath=/var/data 32-bit
Mon Sep 13 13:10:13 db version v1.6.2, pdfile version 4.5 Mon Sep 13 13:10:13 [initandlisten] Accessing: local for the first time Mon Sep 13 13:10:24 [conn1] run command admin.$cmd { whatsmyuri: 1 }Mon Sep 13 13:10:24 [conn1] query admin.$cmd ntoreturn:1 command: { whatsmyuri: 1 } reslen:78 2ms , orderby: {} } , orderby: {} } }, orderby: { Roles: 1 } } Mon Sep 13 13:11:01 [conn1] run command TestDB.$cmd { drop: "bugtest" }Mon Sep 13 13:11:01 [conn1] Accessing: TestDB for the first time reslen:137 115ms } for TestDB.bugtest } Mon Sep 13 13:11:12 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Mon Sep 13 13:11:12 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:65 0ms update: { $set: { babca304b2c79a6801200000: "Test 01" } } byid 0ms Mon Sep 13 13:11:22 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Mon Sep 13 13:11:22 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:83 0ms , orderby: {} } update: { $set: { babca304b2c79a6801210000: "Test 02" } } byid 0ms Mon Sep 13 13:11:30 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Mon Sep 13 13:11:30 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:83 0ms Mon Sep 13 13:11:44 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Mon Sep 13 13:11:44 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 }reslen:65 0ms It's the 32-bit version of mongo. Have you tried a 32-bit version in your tests? |
| Comment by Eliot Horowitz (Inactive) [ 13/Sep/10 ] |
|
Can you send the same info for linux? Have tried 1.6.2 on various platforms and its working fine. |
| Comment by Heiko Weible [ 12/Sep/10 ] |
|
Wow, that reply was incredibly quick! The problem happens every single time on my machine. C:\Programme\MongoDB\bin>mongo ); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" } }); Here's the output of mongod: C:\Programme\MongoDB\bin>mongod -vvvvvvvv
Sun Sep 12 21:47:50 db version v1.6.2, pdfile version 4.5 Sun Sep 12 21:47:50 [initandlisten] Accessing: local for the first time Sun Sep 12 21:48:16 [conn1] run command TestDB.$cmd { drop: "bugtest" }Sun Sep 12 21:48:16 [conn1] Accessing: TestDB for the first time reslen:137 0ms for TestDB.bugtest } Sun Sep 12 21:48:25 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Sun Sep 12 21:48:25 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:65 0ms update: { $set: { babca304b2c79a6801200000: "Test 01" } } byid 0ms Sun Sep 12 21:48:28 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Sun Sep 12 21:48:28 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:83 0ms update: { $set: { babca304b2c79a6801210000: "Test 02" } } byid 0ms Sun Sep 12 21:48:30 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Sun Sep 12 21:48:30 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 } reslen:83 0ms Sun Sep 12 21:48:31 [conn1] run command TestDB.$cmd { getlasterror: 1.0 }Sun Sep 12 21:48:31 [conn1] query TestDB.$cmd ntoreturn:1 command: { getlasterror: 1.0 }reslen:65 0ms The same thing is happening using the Linux version. |
| Comment by Eliot Horowitz (Inactive) [ 12/Sep/10 ] |
|
I tried on a number of versions including 1.6.2 but can't reproduce > db.bugtest.drop() ); , { $set: { "babca304b2c79a6801200000": "Test 01" } }); , { $set: { "babca304b2c79a6801210000": "Test 02" } }); |