[SERVER-2175] Userids from the shell in windows miss machineid and pid Created: 05/Dec/10  Updated: 12/Jul/16  Resolved: 06/Dec/10

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.6.4, 1.6.5
Fix Version/s: 1.7.4

Type: Bug Priority: Major - P3
Reporter: Justin Dearing Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Operating System: ALL
Participants:

 Description   

I've noticed this for a while, but I've been remiss about reporting it. From the shell in windows:

> new ObjectId()
ObjectId("4cfbd47d2c320000000013a3")
> new ObjectId()
ObjectId("4cfbd47e2c320000000013a4")
> new ObjectId()
ObjectId("4cfbd4832c320000000013a5")
> new ObjectId()
ObjectId("4cfbd4832c320000000013a6")
> new ObjectId()
ObjectId("4cfbd4842c320000000013a7")
> new ObjectId()
ObjectId("4cfbd4842c320000000013a8")
> new ObjectId()
ObjectId("4cfbd4842c320000000013a9")

On linux (using the static binaries from a tarball):

ObjectId("4cfbefe976250bd3d7522fc4")
> ObjectId()
ObjectId("4cfbefe976250bd3d7522fc5")
> ObjectId()
ObjectId("4cfbefea76250bd3d7522fc6")
> ObjectId()
ObjectId("4cfbefeb76250bd3d7522fc7")
>
> exit
bye
[dearingj@buddygroup-web2 bin]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
[dearingj@buddygroup-web2 bin]$ uname -a
Linux buddygroup-web2 2.6.18-92.1.6.el5 #1 SMP Fri Jun 20 02:36:06 EDT 2008 x86_ 64 x86_64 x86_64 GNU/Linux
[dearingj@buddygroup-web2 bin]$



 Comments   
Comment by Justin Dearing [ 06/Dec/10 ]

I can live with that for the duration.

Comment by Dwight Merriman [ 06/Dec/10 ]

i think the shell inserts them

what i would recommend is using the 1.7.x shell with the 1.6.5 mongod. that feels pretty safe to me.

Comment by Justin Dearing [ 06/Dec/10 ]

I need it for when I do ad-hoc inserts from the shell. Does the shell append _id fields to objects like the drivers do, or does it allow the server to handle it? If the server handles it, I can certainly explicitly add _id tags in my shell insert() calls until 1.8 is released.

Comment by Dwight Merriman [ 06/Dec/10 ]

btw the machine/pid isn't completely zero. it's just a lot more zeroes than it should be. e.g.

time 4cfbd47d
machineandpid 2c32000000
inc 0013a3

Comment by Dwight Merriman [ 06/Dec/10 ]

do you need it for shell or for mongod?

Comment by Justin Dearing [ 06/Dec/10 ]

Any hance to backcommit this to 1.6.5 RC2.

Comment by auto [ 06/Dec/10 ]

Author:

{'login': 'dwight', 'name': 'dwight', 'email': 'dwight@10gen.com'}

Message: refactor OID class a bit, cleanup, better id generation SERVER-2175
/mongodb/mongo/commit/4a5a00525b669e895993e74155deb85312bedce0

Comment by auto [ 06/Dec/10 ]

Author:

{'login': 'dwight', 'name': 'dwight', 'email': 'dwight@10gen.com'}

Message: better getrandomnumber on windows SERVER-2175
/mongodb/mongo/commit/ece71ea21fdf9d87cdd4bbf0f6fcfbdba1277e5e

Generated at Thu Feb 08 02:59:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.