Closed wangbus closed 12 years ago
My code
on each row -
products.save row, (err, product) ->
util.log "Inserted id: #{product._id}"
when finished saving each row
products.find().toArray (err, products) ->
for product in products
util.log "Loaded id: #{product._id}"
mongoServer.close()
This is weird, as not much changed from 0.1.15 to 0.1.16: https://github.com/marcello3d/node-mongolian/commits/master
Can you gist a self-contained code snippet that reproduces this? (And how to run it as I'm unfamiliar with coffeescript.) What do your row objects look like? Do you have any unique indexes?
This may be related to GH-84.
@marcello3d try to insert some id's of that range into the db and bring it back out. I'll try to come up with some code soon.
I just tested and this happens on 0.1.16 as well.
I think this might be a severe issue. The saving works fine because the IDs are consistent within the call back for the save and also through mongo's REPL and Ruby's mongo driver. I think the problem is with the find().toArray()
@marcello3d I have narrowed it down to the fact that using toArray causes this to happen. When I did forEach on the find(), it gave me the correct values.
Oh interesting! I bet this has to do with buffers being reused within mongolian/buffalo.
For now my temporary fix is to store the hex in a string via iterating from the forEach. Please let me know the level of effort in this and if you need help. I'm willing to contribute. I just don't really know where to look atm. Didn't really dig into it :(
I have a fix for this on node-buffalo, but I want to make some tests to verify it. It also (theoretically) introduces a performance regression, but that's unavoidable.
You are awesome. Can I test the patch out?
Yea, I pushed it to the node-buffalo repo, but I haven't published it to npm yet.
You'll have to manually check out node-buffalo and link it into your mongolian install. Kind of complicated, and there might be a better way to do that, but that's your best bet.
Ok, I was able to create a test to verify this bug and that the fix actually fixes it.
Alright, I've published the updated version of buffalo (turns out I had never pushed my git changes earlier). I'm going to wait a bit on releasing an update of mongolian, so please try out the git master and let me know if it's working for you.
ObjectID's come back wrong
Ids are inserted as 4f2424ba000000e87d000002 to 4f2424ba000000e87d000089
Seems like the top part is completely wrong. But the bottom half seems ok. Seems to happen 0.0.16.
28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000002 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000003 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000004 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000005 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000006 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000007 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000008 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000009 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200000f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000010 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000011 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000012 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000013 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000014 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000015 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000016 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000017 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000018 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000019 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200001f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000020 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000021 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000022 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000023 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000024 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000025 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000026 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000027 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000028 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000029 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200002f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000030 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000031 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000032 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000033 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000034 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000035 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000036 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000037 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000038 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000039 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200003f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000040 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000041 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000042 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000043 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000044 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000045 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000046 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000047 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000048 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000049 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200004f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000050 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000051 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000052 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000053 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000054 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000055 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000056 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000057 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000058 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000059 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200005f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000060 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000061 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000062 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000063 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000064 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000065 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000066 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000067 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000068 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000069 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200006f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000070 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000071 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000072 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000073 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000074 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000075 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000076 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000077 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000078 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000079 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007a 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007b 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007c 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007d 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007e 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd0200007f 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000080 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000081 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000082 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000083 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000084 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000085 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000086 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000087 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000088 28 Jan 07:43:23 - Inserted id: 4f2433bb000000cd02000089 28 Jan 07:43:23 - Loaded id: 6e6400067765627369746500 28 Jan 07:43:23 - Loaded id: 0000066272616e6400067765 28 Jan 07:43:23 - Loaded id: 73000500000000066272616e 28 Jan 07:43:23 - Loaded id: 65730004616c696173657300 28 Jan 07:43:23 - Loaded id: 0000566567657461626c6573 28 Jan 07:43:23 - Loaded id: 000000566567657461626c65 28 Jan 07:43:23 - Loaded id: 726f75747300027479706500 28 Jan 07:43:23 - Loaded id: 6c6f766572205370726f7574 28 Jan 07:43:23 - Loaded id: 0000026e616d65000d000000 28 Jan 07:43:23 - Loaded id: 67000000026e616d65000900 28 Jan 07:43:23 - Loaded id: 6a000000026e616d65000c00 28 Jan 07:43:23 - Loaded id: 000000cd02000072006a0000 28 Jan 07:43:23 - Loaded id: 33bb000000cd020000730078 28 Jan 07:43:23 - Loaded id: 627369746500047461677300 28 Jan 07:43:23 - Loaded id: 000500000000066272616e64 28 Jan 07:43:23 - Loaded id: 626c65730004616c69617365 28 Jan 07:43:23 - Loaded id: 0274797065000b0000005665 28 Jan 07:43:23 - Loaded id: 7273000274797065000b0000 28 Jan 07:43:23 - Loaded id: 68696c692050657070657273 28 Jan 07:43:23 - Loaded id: 0000506f7461746f65730002 28 Jan 07:43:23 - Loaded id: 00180000004f6b696e617761 28 Jan 07:43:23 - Loaded id: 000000cd0200007b005a0000 28 Jan 07:43:23 - Loaded id: 616d6500100000004b61626f 28 Jan 07:43:23 - Loaded id: 066e616d6500027479706500 28 Jan 07:43:23 - Loaded id: 005261646973680002747970 28 Jan 07:43:23 - Loaded id: 7065000b0000005665676574 28 Jan 07:43:23 - Loaded id: 000000566567657461626c65 28 Jan 07:43:23 - Loaded id: 20436f636b7461696c20546f 28 Jan 07:43:23 - Loaded id: 0000cd020000820077000000 28 Jan 07:43:23 - Loaded id: 0500000000075f6964004f24 28 Jan 07:43:23 - Loaded id: 0500000000075f6964004f24 28 Jan 07:43:23 - Loaded id: 000000075f6964004f2433bb 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000086 28 Jan 07:43:23 - Loaded id: 6f6661726d732e636f6d2f31 28 Jan 07:43:23 - Loaded id: 650004746167730005000000 28 Jan 07:43:23 - Loaded id: 74616773000500000000075f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000026 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000027 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000028 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000029 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200002f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000030 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000031 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000032 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000033 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000034 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000035 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000036 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000037 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000038 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000039 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200003f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000040 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000041 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000042 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000043 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000044 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000045 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000046 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000047 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000048 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000049 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200004f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000050 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000051 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000052 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000053 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000054 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000055 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000056 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000057 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000058 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000059 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200005f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000060 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000061 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000062 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000063 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000064 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000065 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000066 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000067 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000068 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000069 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200006f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000070 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000071 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000072 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000073 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000074 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000075 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000076 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000077 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000078 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000079 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007a 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007b 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007c 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007d 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007e 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd0200007f 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000080 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000081 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000082 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000083 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000084 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000085 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000086 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000087 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000088 28 Jan 07:43:23 - Loaded id: 4f2433bb000000cd02000089